-
Notifications
You must be signed in to change notification settings - Fork 151
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 #1658 from ImLJS/delta
Add Site novelsonline.net
- Loading branch information
Showing
2 changed files
with
44 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,43 @@ | ||
"use strict"; | ||
|
||
parserFactory.register("novelsonline.net", () => new NovelsOnlineParser()); | ||
|
||
class NovelsOnlineParser extends Parser { | ||
constructor() { | ||
super(); | ||
} | ||
|
||
async getChapterUrls(dom) { | ||
return [...dom.querySelectorAll(".chapter-chs a")] | ||
.map(link => this.linkToChapter(link)); | ||
} | ||
|
||
linkToChapter(link) { | ||
return ({ | ||
sourceUrl: link.href, | ||
title: link.textContent, | ||
}); | ||
} | ||
|
||
findContent(dom) { | ||
return ( | ||
dom.querySelector("div#contentall") | ||
); | ||
} | ||
|
||
extractTitleImpl(dom) { | ||
return dom.querySelector("h1"); | ||
} | ||
|
||
findChapterTitle(dom) { | ||
return dom.querySelector("h1"); | ||
} | ||
|
||
findCoverImageUrl(dom) { | ||
return util.getFirstImgSrc(dom, "div.novel-cover"); | ||
} | ||
|
||
getInformationEpubItemChildNodes(dom) { | ||
return [dom.querySelector(".novel-right .novel-detail-body")]; | ||
} | ||
} |
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