diff --git a/plugin/js/parsers/69shuParser.js b/plugin/js/parsers/69shuParser.js index a692fd98..15b0ab58 100644 --- a/plugin/js/parsers/69shuParser.js +++ b/plugin/js/parsers/69shuParser.js @@ -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() { @@ -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"); + }; +}