From 915b9c93e853ffc94caf3a5c6a7143bbe0566697 Mon Sep 17 00:00:00 2001
From: aka paul <50n50@noreply.localhost>
Date: Tue, 6 Jan 2026 21:39:10 +0000
Subject: [PATCH] Add tokyoinsider/tokyoinsider.js
---
tokyoinsider/tokyoinsider.js | 134 +++++++++++++++++++++++++++++++++++
1 file changed, 134 insertions(+)
create mode 100644 tokyoinsider/tokyoinsider.js
diff --git a/tokyoinsider/tokyoinsider.js b/tokyoinsider/tokyoinsider.js
new file mode 100644
index 0000000..b828685
--- /dev/null
+++ b/tokyoinsider/tokyoinsider.js
@@ -0,0 +1,134 @@
+async function searchResults(keyword) {
+ const results = [];
+ try {
+ const response = await fetchv2("https://www.tokyoinsider.com/anime/search?k=" + encodeURIComponent(keyword));
+ const html = await response.text();
+
+ const regex = /]*><\/a>[\s\S]*?([^<]*(?:]*>[^<]*<\/span>[^<]*)*)<\/a>/g;
+
+ let match;
+ while ((match = regex.exec(html)) !== null) {
+ const titleText = match[3].replace(/(.*?)<\/span>/g, '$1').replace(/ /g, ' ');
+ results.push({
+ title: titleText.trim(),
+ image: match[1].trim(),
+ href: match[2].trim()
+ });
+ }
+
+ return JSON.stringify(results);
+ } catch (err) {
+ return JSON.stringify([{
+ title: "Error",
+ image: "Error",
+ href: "Error"
+ }]);
+ }
+}
+
+async function extractDetails(slug) {
+ try {
+ const response = await fetchv2("https://www.tokyoinsider.com" + slug);
+ const html = await response.text();
+
+ let titles = "N/A";
+ let airdate = "N/A";
+ let description = "N/A";
+
+ const titlesMatch = html.match(/