Add Po18csParser - #2854
Merged
gamebeaker merged 4 commits intoAug 2, 2026
Merged
Conversation
Collaborator
Author
|
It should also be possible to pass the chapter as an array of 1 into async getChapterUrls(dom, chapterUrlsUI) {
let menu = [...dom.querySelectorAll("dd.col-md-3")];
let chapters = [];
let prevChapUrl = null;
for (let el of menu) {
let anchor = el.querySelector("a");
let chapter = null;
if (anchor) {
prevChapUrl = anchor.href;
chapter = {
sourceUrl: anchor.href,
title: el.textContent.trim(),
isIncludeable: true,
};
chapters.push(chapter);
chapter = [chapter];
chapterUrlsUI.showTocProgress(chapter);
continue;
}
//Handle missing chapter link in toc
await this.rateLimitDelay();
let options = { parser: this };
let prevChapDom = (await HttpClient.wrapFetch(prevChapUrl, options)).responseXML;
let nextChapAnchor = prevChapDom.querySelector("#linkNext");
prevChapUrl = nextChapAnchor.href;
chapter = {
sourceUrl: nextChapAnchor.href,
title: el.textContent.trim(),
isIncludeable: true,
};
chapters.push(chapter);
chapter = [chapter];
chapterUrlsUI.showTocProgress(chapter);
}
return chapters;
}
``` |
Removed the monoShowTocProgress method from ChapterUrlsUI.
Collaborator
|
@Yomafil i removed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add new parser for site https://www.po18cs.com #1644
We get the missing chapter links from the next chapter button present in the previous chapter.
Short book: https://www.po18cs.com/book/126352/
Also added a new function in ChapterUrlsUI
monoShowTocProgressto show the ToC Progress for individual chapter instead of multiple at once, as we are only getting one chapter at a time andshowTocProgressonly takes in a list of chapters.Useful to track the progress for large books: https://www.po18cs.com/book/6/