]*>([^<]+)<\/a>/i
);
if (itemMatch) {
results.push({
href: itemMatch[1].trim(),
image: itemMatch[2].trim(),
title: itemMatch[3].replace(/\[.*?\]/g, '').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 descMatch = html.match(/([\s\S]*?)<\/div>/i);
const description = descMatch
? descMatch[1].replace(/<[^>]+>/g, '').replace(/\s+/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 results = [];
try {
const initialResponse = await fetchv2(url);
const initialHtml = await initialResponse.text();
const filemoonButtonRegex = /
[\s\S]*?