([^<]+)<\/h3>/g;
let match;
while ((match = regex.exec(html)) !== null) {
const href = match[1].trim();
const image = "https://www.topstreamfilm.live" + match[2].trim();
let title = (match[3].trim()).trim();
title = title
.replace(/–/g, "–")
.replace(/’/g, "'")
.replace(/&/g, "&")
.replace(/"/g, '"')
.replace(/'/g, "'")
.replace(" – Der Film", "");
results.push({
title,
image,
href
});
}
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 = /
([\s\S]*?)<\/div>/i;
const match = regex.exec(html);
let description = "N/A";
if (match) {
description = match[1]
.replace(/<[^>]+>/g, " ")
.replace(/&/g, "&")
.replace(/–/g, "–")
.replace(/’/g, "’")
.replace(/"/g, '"')
.replace(/'/g, "'")
.replace(/\s+/g, " ")
.trim();
}
return JSON.stringify([{
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 regex = /id="serie-(\d+)_(\d+)"[\s\S]*?data-m="supervideo"[^>]+data-link="([^"]+)"/g;
let match;
while ((match = regex.exec(html)) !== null) {
const season = parseInt(match[1], 10);
const episode = parseInt(match[2], 10);
const href = match[3].trim();
results.push({
season,
number: episode,
href
});
}
if (results.length === 0) {
const scriptRegex = /