Skip to content

Commit 6aabdc6

Browse files
committed
Fix for requested changes.
1 parent 0aad09f commit 6aabdc6

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,11 @@ private void collectCommentsFrom(final CommentsInfoItemsCollector collector,
215215
contents.remove(index);
216216
}
217217

218-
String jsonKey = contents.getObject(0).has("commentThreadRenderer") ? "commentThreadRenderer" : "commentRenderer";
218+
final String jsonKey = contents.getObject(0).has("commentThreadRenderer") ? "commentThreadRenderer" : "commentRenderer";
219219

220220
final List<Object> comments;
221221
try {
222-
comments = JsonUtils.getValues(contents,
223-
jsonKey);
222+
comments = JsonUtils.getValues(contents, jsonKey);
224223
} catch (final Exception e) {
225224
throw new ParsingException("Unable to get parse youtube comments", e);
226225
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public Page getReplies() throws ParsingException {
250250
final String id = JsonUtils.getString(JsonUtils.getArray(json, "replies.commentRepliesRenderer.contents").getObject(0), "continuationItemRenderer.continuationEndpoint.continuationCommand.token");
251251
return new Page(url, id);
252252
} catch (final Exception e) {
253-
return null;
253+
return null; // Would return null for Comment Replies, since YouTube does not support nested replies.
254254
}
255255
}
256256
}

0 commit comments

Comments
 (0)