mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-27 23:40:36 +05:30
Fix relative url in uploader URL
This commit is contained in:
parent
06ea74cbb8
commit
7cfdaf39a4
@ -94,13 +94,23 @@ 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 {
|
||||
return item.select("div[class=\"yt-lockup-byline\"]").first()
|
||||
String url = item.select("div[class=\"yt-lockup-byline\"]").first()
|
||||
.select("a").first()
|
||||
.attr("href");
|
||||
return fixRelativeUrls(url);
|
||||
} catch (Exception e){}
|
||||
|
||||
// try this if the first didn't work
|
||||
|
Loading…
x
Reference in New Issue
Block a user