diff --git a/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubePlaylistExtractor.java b/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubePlaylistExtractor.java index c6e5c064d..112872378 100644 --- a/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubePlaylistExtractor.java +++ b/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubePlaylistExtractor.java @@ -265,7 +265,7 @@ public class YoutubePlaylistExtractor extends PlaylistExtractor { @Override public String getUploaderUrl() throws ParsingException { - return getUploaderLink().attr("href"); + return getUploaderLink().attr("abs:href"); } @Override diff --git a/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamInfoItemExtractor.java b/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamInfoItemExtractor.java index 3e9f51365..7e792c1af 100644 --- a/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamInfoItemExtractor.java +++ b/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamInfoItemExtractor.java @@ -94,23 +94,13 @@ public class YoutubeStreamInfoItemExtractor implements StreamInfoItemExtractor { } } - private static String fixRelativeUrls(String url) { - if(url == null || url.isEmpty()) return url; - if(url.startsWith("/")) { - return "https://youtube.com" + url; - } else { - return url; - } - } - @Override public String getUploaderUrl() throws ParsingException { try { try { - String url = item.select("div[class=\"yt-lockup-byline\"]").first() + return item.select("div[class=\"yt-lockup-byline\"]").first() .select("a").first() - .attr("href"); - return fixRelativeUrls(url); + .attr("abs:href"); } catch (Exception e){} // try this if the first didn't work diff --git a/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeTrendingExtractor.java b/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeTrendingExtractor.java index 5c357405d..20177ef8f 100644 --- a/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeTrendingExtractor.java +++ b/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeTrendingExtractor.java @@ -110,7 +110,7 @@ public class YoutubeTrendingExtractor extends KioskExtractor { @Override public String getUploaderUrl() throws ParsingException { try { - String link = getUploaderLink().attr("href"); + String link = getUploaderLink().attr("abs:href"); if (link.isEmpty()) { throw new IllegalArgumentException("is empty"); }