Skip to content

Commit

Permalink
Merge pull request #1176 from ImLJS/Zeta
Browse files Browse the repository at this point in the history
  • Loading branch information
dteviot authored Jan 24, 2024
2 parents 6b4934e + dfca832 commit ac2cbc9
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
49 changes: 49 additions & 0 deletions plugin/js/parsers/CyborgParser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
"use strict";

parserFactory.register("cyborg-tl.com", function () {return new CyborgParser();});

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

async getChapterUrls(dom) {
return ([...dom.querySelectorAll("div.lightnovel-episode a")]
.map(link => ({
sourceUrl: link.href,
title: link.title,
}))).reverse();
}

findContent(dom) {
return (
dom.querySelector(".entry-content") || dom.querySelector("#chapter-content")
);
}

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

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

findCoverImageUrl(dom) {
return util.getFirstImgSrc(dom, "div.lightnovel-thumb");
}

getInformationEpubItemChildNodes(dom) {
return [...dom.querySelectorAll("div.lightnovel-synopsis")];
}

removeUnwantedElementsFromContentElement(element) {
let mark = [...element.querySelectorAll("#hpk")];
mark[0].nextElementSibling.remove();
mark[0].remove()
super.removeUnwantedElementsFromContentElement(element);
}
}



1 change: 1 addition & 0 deletions plugin/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ <h3>Instructions</h3>
<script src="js/parsers/Bqg225Parser.js"></script>
<script src="js/parsers/BnatranslationsParser.js"></script>
<script src="js/parsers/CangjiParser.js"></script>
<script src="js/parsers/CyborgParser.js"></script>
<script src="js/parsers/CClawTranslationsParser.js"></script>
<script src="js/parsers/ChaleuriaParser.js"></script>
<script src="js/parsers/ChichipephParser.js"></script>
Expand Down

0 comments on commit ac2cbc9

Please sign in to comment.