Skip to content

Commit

Permalink
Merge pull request #1610 from ImLJS/beta
Browse files Browse the repository at this point in the history
Update Woopread
  • Loading branch information
ImLJS authored Dec 22, 2024
2 parents 9fb1e7b + 9859511 commit 4f55710
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions plugin/js/parsers/WoopreadParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,42 @@ class WoopreadParser extends Parser{
}

extractTitleImpl(dom) {
return dom.querySelector("div.post-title h1");
return dom.querySelector("h1.text-3xl");
};

getInformationEpubItemChildNodes(dom) {
return [...dom.querySelectorAll("div.description-summary")];
return [...dom.querySelectorAll("div.relative .text-text-secondary")];
};

extractAuthor(dom) {
let authorLabel = dom.querySelector("div.author-content a");
let authorLabel = dom.querySelector("div.mb-4:nth-of-type(4) a");
return (authorLabel === null) ? super.extractAuthor(dom) : authorLabel.textContent;
};

findCoverImageUrl(dom) {
return util.getFirstImgSrc(dom, "div.summary_image");
return util.getFirstImgSrc(dom, "div.relative");
};

async getChapterUrls(dom) {
let menu = dom.querySelector("ul.version-chap");
return util.hyperlinksToChapterList(menu).reverse();
};
const chapterLinks = [...dom.querySelectorAll("main.grow .notranslate .mt-8 .grid-cols-1 a")];
const chapterTitles = [...dom.querySelectorAll("div.grow .line-clamp-1")];

let chapterList = [];
for (let i = 0; i < chapterLinks.length; i++) {
chapterList.push({
sourceUrl: chapterLinks[i].href,
title: chapterTitles[i].textContent,
});
};

return chapterList.reverse();
}

findChapterTitle(dom) {
return dom.querySelector("h3");
return dom.querySelector("h2.text-2xl");
};

findContent(dom) {
return dom.querySelector("div.text-left");
return dom.querySelector("div[id^='chapter']");
};
}

0 comments on commit 4f55710

Please sign in to comment.