Skip to content

Commit b608587

Browse files
authored
Merge pull request #572 from golfinq/fixed-comments
Fixes missing comments under videos
2 parents 9256b3b + 0521317 commit b608587

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ public YoutubeCommentsExtractor(StreamingService service, ListLinkHandler uiHand
4646

4747
@Override
4848
public InfoItemsPage<CommentsInfoItem> getInitialPage() throws IOException, ExtractionException {
49-
final String commentsTokenInside = findValue(responseBody, "commentSectionRenderer", "}");
49+
final String commentsTokenInside;
50+
if (responseBody.contains("commentSectionRenderer")) {
51+
commentsTokenInside = findValue(responseBody, "commentSectionRenderer", "}");
52+
} else {
53+
commentsTokenInside = findValue(responseBody, "sectionListRenderer", "}");
54+
}
5055
final String commentsToken = findValue(commentsTokenInside, "continuation\":\"", "\"");
5156
return getPage(getNextPage(commentsToken));
5257
}

0 commit comments

Comments
 (0)