([^<]+)<\/div>/);
if (imageMatch && hrefMatch && titleMatch) {
results.push({
title: titleMatch[1].trim(),
image: imageMatch[1].trim(),
href: hrefMatch[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 descMatch = html.match(/([^<]+)<\/p>/);
const description = descMatch ? descMatch[1].trim() : "N/A";
return JSON.stringify([{
description
}]);
} catch (err) {
return JSON.stringify([{
description: "Error"
}]);
}
}
async function extractEpisodes(url) {
const results = [];
try {
const response = await fetchv2(url);
const html = await response.text();
const seasonRegex = /