From 741129674b63454fc0aae3fbbbe274c1a9a87efd Mon Sep 17 00:00:00 2001 From: aka paul <50n50@noreply.localhost> Date: Mon, 3 Nov 2025 17:59:13 +0000 Subject: [PATCH] Add animeweek/animeweek.js --- animeweek/animeweek.js | 107 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 animeweek/animeweek.js diff --git a/animeweek/animeweek.js b/animeweek/animeweek.js new file mode 100644 index 0000000..d4954da --- /dev/null +++ b/animeweek/animeweek.js @@ -0,0 +1,107 @@ + +async function searchResults(keyword) { + const results = []; + try { + const response = await fetchv2("https://aniweek.com/bbs/search.php?srows=240&gr_id=&sfl=wr_subject&stx=" + encodeURIComponent(keyword)); + const html = await response.text(); + const regex = /
[\s\S]*?
([\s\S]*?)<\/div><\/div>/; + + let description = "N/A"; + const match = regex.exec(html); + if (match) { + description = match[1].replace(/
/g, "\n").replace(/ /g, " ").replace(/<[^>]*>/g, "").replace(/\n\n+/g, "\n").trim(); + } + + return JSON.stringify([{ + description: description, + aliases: "N/A", + airdate: "N/A" + }]); + } catch (err) { + return JSON.stringify([{ + description: "Error", + aliases: "Error", + airdate: "Error" + }]); + } +} + +async function extractEpisodes(url) { + const results = []; + try { + const response = await fetchv2(url); + const html = await response.text(); + const regex = /
  • [\s\S]*?