Skip to content

Commit

Permalink
Extract author for Novelbin
Browse files Browse the repository at this point in the history
See: #974
  • Loading branch information
dteviot committed May 21, 2023
1 parent da98ca7 commit c4f0201
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugin/js/parsers/NovelbinParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ class NovelbinParser extends Parser{
return dom.querySelector("h3.title");
}

extractAuthor(dom) {
let items = [...dom.querySelectorAll("ul.info-meta li")]
.filter(u => u.querySelector("h3")?.textContent === "Author:")
.map(u => u.querySelector("a")?.textContent)
return 0 < items.length
? items[0]
: super.extractAuthor(dom);
}

findChapterTitle(dom) {
return dom.querySelector("h2");
}
Expand Down

0 comments on commit c4f0201

Please sign in to comment.