Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
See: #1604
  • Loading branch information
dteviot committed Dec 17, 2024
1 parent d743834 commit 7c9822c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions plugin/js/parsers/69shuParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parserFactory.registerUrlRule(
url => (util.extractHostName(url).includes("69shu")),
() => new ShuParser()
);
parserFactory.register("69yuedu.net", () => new _69yueduParser());

class ShuParser extends Parser{
constructor() {
Expand Down Expand Up @@ -46,3 +47,30 @@ class ShuParser extends Parser{
});
}
}

class _69yueduParser extends ShuParser{
constructor() {
super();
}

async getChapterUrls(dom) {
let tocUrl = dom.querySelector("a.btn").href;
let toc = (await HttpClient.wrapFetch(tocUrl, this.makeOptions())).responseXML;
let menu = toc.querySelector("#chapters ul");
return util.hyperlinksToChapterList(menu);
}

makeOptions() {
return ({
makeTextDecoder: () => new TextDecoder("gbk")
});
}

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

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

0 comments on commit 7c9822c

Please sign in to comment.