4
3
Fork
You've already forked PipePipeExtractor
3

BiliBili: Fix only first page of comment replies loaded #16

Merged
NullPointerException merged 2 commits from chr_56/PipePipeExtractor:bilibili-comment into main 2025年10月04日 02:10:41 +02:00
Contributor
Copy link

In commit 03d09239, the COMMENT_REPLIES_URL was changed: ps=20 -> ps=10

@@ -90,7 +69,7 @@ public class BilibiliService extends StreamingService {
- public static String COMMENT_REPLIES_URL = "https://api.bilibili.com/x/v2/reply/reply?type=1&ps=10&pn=1&web_location=333.788&oid=";
+ public static String COMMENT_REPLIES_URL = "https://api.bilibili.com/x/v2/reply/reply?type=1&pn=1&ps=20&oid=";

But there are other two relative places keeping unmodified:

  • First one is checking next page from BilibiliCommentExtractor:
 } else { //replies
 // results are replies, but at most 10 now
 if (19 > results.size() && pageUrl.contains("pn=1")) {
 return new InfoItemsPage<>(collector, null);
 }
 return new InfoItemsPage<>(collector, new Page(utils.getNextPageFromCurrentUrl(pageUrl, "pn", 1), getDefaultCookies()));
 }
  • The other one is in getUrl() from BilibiliCommentsLinkHandlerFactory:
 if(id.contains("&root")){
 // I don't know why but pn must be placed in the end or nothing will be fetched
 return "https://api.bilibili.com/x/v2/reply/reply?type=1&ps=20&oid=" + id + "&pn=1";
 // `ps` still remains 20 here
 }
In commit 03d09239, the `COMMENT_REPLIES_URL` was changed: `ps=20` -> `ps=10` ```diff @@ -90,7 +69,7 @@ public class BilibiliService extends StreamingService { - public static String COMMENT_REPLIES_URL = "https://api.bilibili.com/x/v2/reply/reply?type=1&ps=10&pn=1&web_location=333.788&oid="; + public static String COMMENT_REPLIES_URL = "https://api.bilibili.com/x/v2/reply/reply?type=1&pn=1&ps=20&oid="; ``` But there are other two relative places keeping unmodified: - First one is checking next page from `BilibiliCommentExtractor`: ```kotlin } else { //replies // results are replies, but at most 10 now if (19 > results.size() && pageUrl.contains("pn=1")) { return new InfoItemsPage<>(collector, null); } return new InfoItemsPage<>(collector, new Page(utils.getNextPageFromCurrentUrl(pageUrl, "pn", 1), getDefaultCookies())); } ``` - The other one is in `getUrl()` from `BilibiliCommentsLinkHandlerFactory`: ```kotlin if(id.contains("&root")){ // I don't know why but pn must be placed in the end or nothing will be fetched return "https://api.bilibili.com/x/v2/reply/reply?type=1&ps=20&oid=" + id + "&pn=1"; // `ps` still remains 20 here } ```
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
NullPointerException/PipePipeExtractor!16
Reference in a new issue
NullPointerException/PipePipeExtractor
No description provided.
Delete branch "chr_56/PipePipeExtractor:bilibili-comment"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?