Skip to content

Commit 1df3f67

Browse files
committed
Fix YouTube's channel extractor
1 parent 466d87c commit 1df3f67

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeChannelExtractor.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
5151
*/
5252
private Document nextStreamsAjax;
5353

54+
private boolean fetchingNextStreams;
55+
5456
public YoutubeChannelExtractor(StreamingService service, String url, String nextStreamsUrl) throws IOException, ExtractionException {
5557
super(service, url, nextStreamsUrl);
5658
}
@@ -63,14 +65,17 @@ public void fetchPage() throws IOException, ExtractionException {
6365
String pageContent = downloader.download(channelUrl);
6466
doc = Jsoup.parse(pageContent, channelUrl);
6567

66-
nextStreamsUrl = getNextStreamsUrlFrom(doc);
68+
if (!fetchingNextStreams) {
69+
nextStreamsUrl = getNextStreamsUrlFrom(doc);
70+
}
6771
nextStreamsAjax = null;
6872
}
6973

7074
@Override
7175
protected boolean fetchPageUponCreation() {
7276
// Unfortunately, we have to fetch the page even if we are getting only next streams,
7377
// as they don't deliver enough information on their own (the channel name, for example).
78+
fetchingNextStreams = nextStreamsUrl != null && !nextStreamsUrl.isEmpty();
7479
return true;
7580
}
7681

0 commit comments

Comments
 (0)