Skip to content

Commit

Permalink
Fix: changes in pawread.com ToC
Browse files Browse the repository at this point in the history
See: #1049
  • Loading branch information
dteviot committed Aug 22, 2023
1 parent 1ccbbb6 commit b3cb903
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugin/js/parsers/PawreadParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ class PawreadParser extends Parser{
}

async getChapterUrls(dom) {
let rootUrl = dom.baseURI;
let items = [...dom.querySelectorAll("div.filtr-item .item-box")];
return items.map(this.itemToChapter);
return items.map(i => this.itemToChapter(i, rootUrl));
}

itemToChapter(item) {
let path = item.getAttribute("onclick").split("'")[1];
itemToChapter(item, rootUrl) {
let pathTip = item.getAttribute("onclick").split("'")[1];
return ({
sourceUrl: "https://www.pawread.com" + path,
sourceUrl: rootUrl + pathTip + ".html",
title: item.querySelector(".c_title").textContent,
});
}
Expand Down

0 comments on commit b3cb903

Please sign in to comment.