Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
See: #1187
  • Loading branch information
dteviot committed Jan 27, 2024
1 parent 50dc874 commit 0756aa3
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
39 changes: 39 additions & 0 deletions plugin/js/parsers/CzbooksParser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"use strict";

parserFactory.register("czbooks.net", () => new CzbooksParser());

class CzbooksParser extends Parser{
constructor() {
super();
}

async getChapterUrls(dom) {
let menu = dom.querySelector("ul.chapter-list");
return util.hyperlinksToChapterList(menu);
}

findContent(dom) {
return dom.querySelector(".content");
}

extractTitleImpl(dom) {
return dom.querySelector(".novel-detail .title");
}

extractAuthor(dom) {
let authorLabel = dom.querySelector(".novel-detail span.author a");
return authorLabel?.textContent ?? super.extractAuthor(dom);
}

findChapterTitle(dom) {
return dom.querySelector(".name");
}

findCoverImageUrl(dom) {
return util.getFirstImgSrc(dom, ".novel-detail");
}

getInformationEpubItemChildNodes(dom) {
return [...dom.querySelectorAll(".description")];
}
}
1 change: 1 addition & 0 deletions plugin/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ <h3>Instructions</h3>
<script src="js/parsers/ComrademaoParser.js"></script>
<script src="js/parsers/CoronatranslationParser.js"></script>
<script src="js/parsers/CreativeNovelsParser.js"></script>
<script src="js/parsers/CzbooksParser.js"></script>
<script src="js/parsers/DarkNovelsParser.js"></script>
<script src="js/parsers/DefaultParser.js"></script>
<script src="js/parsers/DeviantArtParser.js"></script>
Expand Down

0 comments on commit 0756aa3

Please sign in to comment.