Fix for requested changes.

pull/703/head
FireMasterK 2021-09-12 01:09:10 +05:30
rodzic 0aad09fa22
commit 6aabdc6d16
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 49451E4482CC5BCD
2 zmienionych plików z 3 dodań i 4 usunięć

Wyświetl plik

@ -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);
}

Wyświetl plik

@ -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.
}
}
}