mirror of
https://github.com/TeamNewPipe/NewPipeExtractor
synced 2024-12-12 11:59:45 +01:00
Fix comment reply continuations.
This commit is contained in:
parent
666b45958e
commit
e8e9e6cd00
@ -112,12 +112,6 @@ public class CommentsInfoItemsCollector extends InfoItemsCollector<CommentsInfoI
|
||||
}
|
||||
|
||||
public List<CommentsInfoItem> getCommentsInfoItemList() {
|
||||
List<CommentsInfoItem> siiList = new ArrayList<>();
|
||||
for (InfoItem ii : super.getItems()) {
|
||||
if (ii instanceof CommentsInfoItem) {
|
||||
siiList.add((CommentsInfoItem) ii);
|
||||
}
|
||||
}
|
||||
return siiList;
|
||||
return new ArrayList<>(super.getItems());
|
||||
}
|
||||
}
|
||||
|
@ -140,10 +140,13 @@ public class YoutubeCommentsExtractor extends CommentsExtractor {
|
||||
return null;
|
||||
}
|
||||
|
||||
final JsonObject continuationItemRenderer = jsonArray.getObject(jsonArray.size() - 1).getObject("continuationItemRenderer");
|
||||
|
||||
final String jsonPath = continuationItemRenderer.has("button") ? "button.buttonRenderer.command.continuationCommand.token" : "continuationEndpoint.continuationCommand.token";
|
||||
|
||||
final String continuation;
|
||||
try {
|
||||
continuation = JsonUtils.getString(jsonArray.getObject(jsonArray.size() - 1),
|
||||
"continuationItemRenderer.continuationEndpoint.continuationCommand.token");
|
||||
continuation = JsonUtils.getString(continuationItemRenderer, jsonPath);
|
||||
} catch (final Exception e) {
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user