Skip to content

Commit

Permalink
Update NovelfullParser.js
Browse files Browse the repository at this point in the history
Added secondary paging recognition for novelfulll - effectively hardcoded, consider general param array for future constructor passage.
  • Loading branch information
Kiradien committed Dec 11, 2024
1 parent df5cca1 commit 230b0d6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions plugin/js/parsers/NovelfullParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,13 @@ class NovelfullParser extends Parser{
let link = dom.querySelector("li.last a");
let urls = [];
if (link != null) {
let limit = link.getAttribute("data-page") || "-1";
limit = parseInt(limit) + 1;
let limit = link.getAttribute("data-page");
if (limit == null)
{
let url = new URL(link.href);
limit = url.searchParams.get("page_num") || null;
}
limit = parseInt(limit || "-1") + 1;
for (let i = 1; i <= limit; ++i) {
urls.push(NovelfullParser.buildUrlForTocPage(link, i));
}
Expand All @@ -91,6 +96,8 @@ class NovelfullParser extends Parser{
if (hostname === "freenovelsread.com")
{
link.pathname = link.pathname.split("/")[1] + "/" + i;
} else if (hostname === "novelfulll.com") {
link.search = `?page_num=${i}`;
} else {
link.search = `?page=${i}&per-page=50`;
}
Expand Down

0 comments on commit 230b0d6

Please sign in to comment.