Fix for requested changes.
This commit is contained in:
parent
0aad09fa22
commit
6aabdc6d16
|
@ -215,12 +215,11 @@ public class YoutubeCommentsExtractor extends CommentsExtractor {
|
|||
contents.remove(index);
|
||||
}
|
||||
|
||||
String jsonKey = contents.getObject(0).has("commentThreadRenderer") ? "commentThreadRenderer" : "commentRenderer";
|
||||
final String jsonKey = contents.getObject(0).has("commentThreadRenderer") ? "commentThreadRenderer" : "commentRenderer";
|
||||
|
||||
final List<Object> comments;
|
||||
try {
|
||||
comments = JsonUtils.getValues(contents,
|
||||
jsonKey);
|
||||
comments = JsonUtils.getValues(contents, jsonKey);
|
||||
} catch (final Exception e) {
|
||||
throw new ParsingException("Unable to get parse youtube comments", e);
|
||||
}
|
||||
|
|
|
@ -250,7 +250,7 @@ public class YoutubeCommentsInfoItemExtractor implements CommentsInfoItemExtract
|
|||
final String id = JsonUtils.getString(JsonUtils.getArray(json, "replies.commentRepliesRenderer.contents").getObject(0), "continuationItemRenderer.continuationEndpoint.continuationCommand.token");
|
||||
return new Page(url, id);
|
||||
} catch (final Exception e) {
|
||||
return null;
|
||||
return null; // Would return null for Comment Replies, since YouTube does not support nested replies.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue