-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1587 from ImLJS/dev
Add Site readernovel.net
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
"use strict"; | ||
|
||
parserFactory.register("readernovel.net", () => new ReaderNovelParser()); | ||
|
||
class ReaderNovelParser extends Parser { | ||
constructor() { | ||
super(); | ||
} | ||
|
||
async getChapterUrls(dom) { | ||
return [...dom.querySelectorAll(".chapter-list-wrapper a")] | ||
.map(link => this.linkToChapter(link)) | ||
.reverse(); | ||
} | ||
|
||
linkToChapter(link) { | ||
let title = link.getAttribute("title"); | ||
return ({ | ||
sourceUrl: link.href, | ||
title: title, | ||
}); | ||
} | ||
|
||
findContent(dom) { | ||
return ( | ||
dom.querySelector("div#chapter-container") || dom.querySelector("#chapter-content") | ||
); | ||
} | ||
|
||
extractTitleImpl(dom) { | ||
return dom.querySelector(".page-title"); | ||
} | ||
|
||
extractAuthor(dom) { | ||
let authorLabel = dom.querySelector("li.list-group-item a"); | ||
return authorLabel?.textContent ?? super.extractAuthor(dom); | ||
} | ||
|
||
findChapterTitle(dom) { | ||
return dom.querySelector("span.chapter-title"); | ||
} | ||
|
||
findCoverImageUrl(dom) { | ||
return util.getFirstImgSrc(dom, ".manga-image"); | ||
} | ||
|
||
getInformationEpubItemChildNodes(dom) { | ||
return [...dom.querySelectorAll("div#collapseSummary")]; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters