Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
See: #1104
  • Loading branch information
dteviot committed Dec 8, 2023
1 parent bd79630 commit 7974414
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/BoyloveParser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"use strict";

parserFactory.register("boylove.cc", () => new BoyloveParser());

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

async getChapterUrls(dom) {
return [...dom.querySelectorAll("ul#playlist__item_title_1_url li:not(.chapterOff) a")]
.map(a => util.hyperLinkToChapter(a));
}

findContent(dom) {
return dom.querySelector("section.reader-cartoon-chapter");
}

extractTitleImpl(dom) {
return dom.querySelector("div.stui-content div.title");
}

findChapterTitle(dom) {
return dom.querySelector("div.title");
}

findCoverImageUrl(dom) {
let div = dom.querySelector("div.stui-content__thumb [style*=background-image]");
return "https://boylove.cc" + util.extractUrlFromBackgroundImage(div);
}

preprocessRawDom(webPageDom) {
util.resolveLazyLoadedImages(webPageDom, "article img.lazy", "data-original");
}

getInformationEpubItemChildNodes(dom) {
return [...dom.querySelectorAll("p.desc")];
}
}
1 change: 1 addition & 0 deletions plugin/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ <h3>Instructions</h3>
<script src="js/parsers/BookswithqianyaParser.js"></script>
<script src="js/parsers/Booktoki152Parser.js"></script>
<script src="js/parsers/BoxnovelOrgParser.js"></script>
<script src="js/parsers/BoyloveParser.js"></script>
<script src="js/parsers/Bqg225Parser.js"></script>
<script src="js/parsers/BnatranslationsParser.js"></script>
<script src="js/parsers/CangjiParser.js"></script>
Expand Down

0 comments on commit 7974414

Please sign in to comment.