From 4a15a1c1d015f09e9962aca95111cf29532e73e3 Mon Sep 17 00:00:00 2001 From: aka paul <50n50@noreply.localhost> Date: Sun, 30 Nov 2025 20:43:03 +0000 Subject: [PATCH] Add mangafreak/mangafreak.js --- mangafreak/mangafreak.js | 86 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 mangafreak/mangafreak.js diff --git a/mangafreak/mangafreak.js b/mangafreak/mangafreak.js new file mode 100644 index 0000000..65864d4 --- /dev/null +++ b/mangafreak/mangafreak.js @@ -0,0 +1,86 @@ +async function searchContent(keyword, page=0) { + const results = []; + try { + const response = await fetch("https://ww2.mangafreak.me/Find/" + encodeURIComponent(keyword)); + const html = await response.text(); + const regex = /
\s*
\d+\.<\/h6>\s*\s*<\/a>\s*<\/span>\s*\s*

\s*([^<]+)<\/a>\s*<\/h3>/g; + + let match; + while ((match = regex.exec(html)) !== null) { + results.push({ + id: "https://ww2.mangafreak.me" + match[1].trim(), + imageURL: match[2].trim(), + title: match[3].trim() + }); + } + + return results; + } catch (err) { + return []; + } +} + +async function getContentData(url) { + try { + const response = await fetch(url); + const html = await response.text(); + const descRegex = /