From aaa587dbec323b8e1f3ef7413d0b15a7fed86828 Mon Sep 17 00:00:00 2001 From: aka paul <50n50@noreply.localhost> Date: Thu, 6 Nov 2025 17:27:14 +0000 Subject: [PATCH] Add xiaoxintv/xiaoxintv.js --- xiaoxintv/xiaoxintv.js | 139 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 xiaoxintv/xiaoxintv.js diff --git a/xiaoxintv/xiaoxintv.js b/xiaoxintv/xiaoxintv.js new file mode 100644 index 0000000..35d2574 --- /dev/null +++ b/xiaoxintv/xiaoxintv.js @@ -0,0 +1,139 @@ +async function searchResults(keyword) { + const results = []; + try { + const response = await fetchv2("https://xiaoxintv.cc/index.php/vod/search.html?wd=" + encodeURIComponent(keyword) + "&submit="); + const html = await response.text(); + + const regex = /class="myui-vodlist__thumb[^"]*" href="([^"]*)"[^>]*title="([^"]*)"[^>]*data-original="([^"]*)"/g; + let match; + while ((match = regex.exec(html)) !== null) { + results.push({ + title: match[2].trim(), + image: "https://xiaoxintv.cc" + match[3].trim(), + href: "https://xiaoxintv.cc" + match[1].trim() + }); + } + + return JSON.stringify(results); + } catch (err) { + return JSON.stringify([{ + title: "Error", + image: "Error", + href: "Error" + }]); + } +} + +async function extractDetails(url) { + try { + const response = await fetchv2(url); + const html = await response.text(); + + const regex = /]*>

(.*?)<\/p><\/span>/s; + const match = regex.exec(html); + const description = match ? match[1].trim() : "No description available"; + + 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 ulRegex = /