From ba5b2437f60e94285c8edc289c26c5f8179645ab Mon Sep 17 00:00:00 2001 From: aka paul <50n50@noreply.localhost> Date: Wed, 26 Nov 2025 22:13:53 +0000 Subject: [PATCH] Add dev/mangadev.js --- dev/mangadev.js | 77 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 dev/mangadev.js diff --git a/dev/mangadev.js b/dev/mangadev.js new file mode 100644 index 0000000..5ae4b0e --- /dev/null +++ b/dev/mangadev.js @@ -0,0 +1,77 @@ +async function searchContent(keyword, page=0) { + const results = []; + try { + const regex = /REGEX_PATTERN/g; + + let match; + while ((match = regex.exec(html)) !== null) { + results.push({ + id: match[1].trim(), + imageURL: match[2].trim(), + title: match[3].trim() + }); + } + + return results; + } catch (err) { + return []; + } +} + +async function getContentData(url) { + try { + const regex = /REGEX_PATTERN/g; + + return { + description: "", + tags: [] + }; + } catch (err) { + return { + description: "Error", + tags: [] + }; + } +} + +async function getChapters(url) { + const results = []; + try { + const regex = /REGEX_PATTERN/g; + let match; + let index = 0; + + while ((match = regex.exec(html)) !== null) { + results.push([ + String(index), + [{ + id: match[1].trim(), + title: match[2].trim(), + chapter: index, + scanlation_group: "" + }] + ]); + index++; + } + + return { en: results }; + } catch (err) { + return { en: [] }; + } +} + +async function getChapterImages(url) { + const results = []; + try { + const regex = /REGEX_PATTERN/g; + + let match; + while ((match = regex.exec(html)) !== null) { + results.push(match[1].trim()); + } + + return results; + } catch (err) { + return []; + } +}