From dc07e4f3e91daefc6e3142842b361b135008e714 Mon Sep 17 00:00:00 2001 From: dteviot Date: Sat, 16 Sep 2023 16:30:39 +1200 Subject: [PATCH] Add site https://octopii.co/ See: https://github.com/dteviot/WebToEpub/issues/1011 --- plugin/js/parsers/OctopiiParser.js | 35 ++++++++++++++++++++++++++++++ plugin/popup.html | 1 + 2 files changed, 36 insertions(+) create mode 100644 plugin/js/parsers/OctopiiParser.js diff --git a/plugin/js/parsers/OctopiiParser.js b/plugin/js/parsers/OctopiiParser.js new file mode 100644 index 00000000..63e59e3c --- /dev/null +++ b/plugin/js/parsers/OctopiiParser.js @@ -0,0 +1,35 @@ +"use strict"; + +parserFactory.register("octopii.co", () => new OctopiiParser()); + +class OctopiiParser extends Parser{ + constructor() { + super(); + } + + async getChapterUrls(dom) { + let menu = dom.querySelector("div.chapter-list"); + return util.hyperlinksToChapterList(menu); + } + + findContent(dom) { + return dom.querySelector(".content"); + } + + extractTitleImpl(dom) { + return dom.querySelector("main h3"); + } + + findCoverImageUrl(dom) { + return util.getFirstImgSrc(dom, ".page-cover"); + } + + getInformationEpubItemChildNodes(dom) { + return [...dom.querySelectorAll("div.description")]; + } + + cleanInformationNode(node) { + util.removeChildElementsMatchingCss(node, ".btn-show-more"); + return node; + } +} diff --git a/plugin/popup.html b/plugin/popup.html index f4a85720..4692f6d9 100644 --- a/plugin/popup.html +++ b/plugin/popup.html @@ -670,6 +670,7 @@

Instructions

+