Skip to content

Commit ea7e652

Browse files
committed
Collect replies/page to CommentsInfoItem.
1 parent 4385cc1 commit ea7e652

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/comments/CommentsInfoItem.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.schabi.newpipe.extractor.comments;
22

33
import org.schabi.newpipe.extractor.InfoItem;
4+
import org.schabi.newpipe.extractor.Page;
45
import org.schabi.newpipe.extractor.localization.DateWrapper;
56

67
import javax.annotation.Nullable;
@@ -21,6 +22,8 @@ public class CommentsInfoItem extends InfoItem {
2122
private boolean heartedByUploader;
2223
private boolean pinned;
2324
private int streamPosition;
25+
@Nullable
26+
private Page replies;
2427

2528
public static final int NO_LIKE_COUNT = -1;
2629
public static final int NO_STREAM_POSITION = -1;
@@ -142,4 +145,8 @@ public void setStreamPosition(final int streamPosition) {
142145
public int getStreamPosition() {
143146
return streamPosition;
144147
}
148+
149+
public void setReplies(@Nullable Page replies) { this.replies = replies; }
150+
151+
public Page getReplies() { return this.replies; }
145152
}

extractor/src/main/java/org/schabi/newpipe/extractor/comments/CommentsInfoItemsCollector.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ public CommentsInfoItem extract(CommentsInfoItemExtractor extractor) throws Pars
9393
addError(e);
9494
}
9595

96+
try {
97+
resultItem.setReplies(extractor.getReplies());
98+
} catch (Exception e) {
99+
addError(e);
100+
}
101+
96102
return resultItem;
97103
}
98104

0 commit comments

Comments
 (0)