Skip to content

Commit 35e32c4

Browse files
committed
Fix comment extraction
1 parent 993d3a5 commit 35e32c4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/invidious/extractors/InvidiousCommentsExtractor.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ public InfoItemsPage<CommentsInfoItem> getInitialPage() throws ExtractionExcepti
4747
public InfoItemsPage<CommentsInfoItem> getPage(
4848
final Page page
4949
) throws IOException, ExtractionException {
50+
if (page == null) {
51+
return InfoItemsPage.emptyPage();
52+
}
53+
5054
final Downloader dl = NewPipe.getDownloader();
5155
final Response response = dl.get(page.getUrl());
5256

@@ -59,8 +63,14 @@ public InfoItemsPage<CommentsInfoItem> getPage(
5963

6064

6165
public Page getNextPage() throws ParsingException {
66+
final String continuation = json.getString("continuation");
67+
68+
if (continuation == null || continuation.isEmpty()) {
69+
return null;
70+
}
71+
6272
return new Page(baseUrl + "/api/v1/comments/" + getId()
63-
+ "?continuation=" + json.getString("continuation"));
73+
+ "?continuation=" + continuation);
6474
}
6575

6676
@Override

0 commit comments

Comments
 (0)