Collect replies/page to CommentsInfoItem.

This commit is contained in:
FireMasterK 2021-08-04 18:09:42 +05:30
parent 4385cc1b7c
commit ea7e6526fd
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD
2 changed files with 13 additions and 0 deletions

View file

@ -1,6 +1,7 @@
package org.schabi.newpipe.extractor.comments; package org.schabi.newpipe.extractor.comments;
import org.schabi.newpipe.extractor.InfoItem; import org.schabi.newpipe.extractor.InfoItem;
import org.schabi.newpipe.extractor.Page;
import org.schabi.newpipe.extractor.localization.DateWrapper; import org.schabi.newpipe.extractor.localization.DateWrapper;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -21,6 +22,8 @@ public class CommentsInfoItem extends InfoItem {
private boolean heartedByUploader; private boolean heartedByUploader;
private boolean pinned; private boolean pinned;
private int streamPosition; private int streamPosition;
@Nullable
private Page replies;
public static final int NO_LIKE_COUNT = -1; public static final int NO_LIKE_COUNT = -1;
public static final int NO_STREAM_POSITION = -1; public static final int NO_STREAM_POSITION = -1;
@ -142,4 +145,8 @@ public class CommentsInfoItem extends InfoItem {
public int getStreamPosition() { public int getStreamPosition() {
return streamPosition; return streamPosition;
} }
public void setReplies(@Nullable Page replies) { this.replies = replies; }
public Page getReplies() { return this.replies; }
} }

View file

@ -93,6 +93,12 @@ public class CommentsInfoItemsCollector extends InfoItemsCollector<CommentsInfoI
addError(e); addError(e);
} }
try {
resultItem.setReplies(extractor.getReplies());
} catch (Exception e) {
addError(e);
}
return resultItem; return resultItem;
} }