Merge pull request #572 from golfinq/fixed-comments

Fixes missing comments under videos
This commit is contained in:
Tobi 2021-03-05 11:42:40 +01:00 committed by GitHub
commit b608587e4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,12 @@ public class YoutubeCommentsExtractor extends CommentsExtractor {
@Override
public InfoItemsPage<CommentsInfoItem> getInitialPage() throws IOException, ExtractionException {
final String commentsTokenInside = findValue(responseBody, "commentSectionRenderer", "}");
final String commentsTokenInside;
if (responseBody.contains("commentSectionRenderer")) {
commentsTokenInside = findValue(responseBody, "commentSectionRenderer", "}");
} else {
commentsTokenInside = findValue(responseBody, "sectionListRenderer", "}");
}
final String commentsToken = findValue(commentsTokenInside, "continuation\":\"", "\"");
return getPage(getNextPage(commentsToken));
}