From 5cf145e516179839aa531e0fe56aa8245327ea19 Mon Sep 17 00:00:00 2001 From: aka paul <80717571+50n50@users.noreply.github.com> Date: Fri, 29 May 2026 17:06:32 +0200 Subject: [PATCH] add --- otaku-streamers/otaku-streamers.js | 98 ++++++++++++++++++++++++++++ otaku-streamers/otaku-streamers.json | 27 ++++++++ 2 files changed, 125 insertions(+) create mode 100644 otaku-streamers/otaku-streamers.js create mode 100644 otaku-streamers/otaku-streamers.json diff --git a/otaku-streamers/otaku-streamers.js b/otaku-streamers/otaku-streamers.js new file mode 100644 index 0000000..7520220 --- /dev/null +++ b/otaku-streamers/otaku-streamers.js @@ -0,0 +1,98 @@ +async function searchResults(keyword) { + const postData = `op=title_search&q=${encodeURIComponent(keyword)}`; + const headers = await getDefaultHeaders(); + const results = []; + try { + const response = await fetchv2("https://beta.otaku-streamers.com/a.php", headers, "POST", postData); + const data = await response.json(); + + if (data && data.content) { + data.content.forEach(item => { + results.push({ + title: item.title, + image: item.cover, + href: item.url + }); + }); + } + + return JSON.stringify(results); + } catch (err) { + return JSON.stringify([{ + title: "Error", + image: "Error", + href: "Error" + }]); + } +} + +async function extractDetails(url) { + const headers = await getDefaultHeaders(); + try { + const response = await fetchv2(url, headers); + const html = await response.text(); + + const descriptionMatch = html.match(/
([\s\S]*?)<\/p>/i);
+ const description = descriptionMatch ? descriptionMatch[1].replace(/
/gi, "\n").replace(/<\/?[^>]+(>|$)/g, "").trim() : "N/A";
+
+ 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 headers = await getDefaultHeaders();
+ const results = [];
+ try {
+ const response = await fetchv2(url, headers);
+ const html = await response.text();
+
+ const regex = //g;
+ let match;
+ while ((match = regex.exec(html)) !== null) {
+ results.push({
+ href: match[1].trim(),
+ number: parseInt(match[2], 10)
+ });
+ }
+
+ return JSON.stringify(results);
+ } catch (err) {
+ return JSON.stringify([{
+ href: "Error",
+ number: "Error"
+ }]);
+ }
+}
+
+async function extractStreamUrl(url) {
+ const headers = await getDefaultHeaders();
+ try {
+ const response = await fetchv2(url, headers);
+ const html = await response.text();
+
+ const streamMatch = html.match(/