([\s\S]*?)<\/div>/);
let description = descriptionMatch ? descriptionMatch[1]
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"')
.replace(/
\n/g, ' ')
.replace(/\s+/g, ' ')
.trim() : '';
const nameMatch = html.match(/
([^<]+)<\/h3>/);
const airdateMatch = html.match(/Datum:<\/span>([^<]+)/);
let airdate = airdateMatch ? airdateMatch[1].trim() : '';
let name = nameMatch ? nameMatch[1].trim() : '';
let engName = engNameMatch ? engNameMatch[1].trim() : '';
let aliases = name === engName ? 'N/A' : engName;
if (description || airdate) {
details.push({
description: description,
aliases: aliases,
airdate: airdate
});
}
console.log(details);
return JSON.stringify(details);
}
async function extractEpisodes(url) {
const episodes = [];
const response = await fetchv2(url);
const html = await response.text();
const baseUrl = 'https://www.animesrbija.com';
const episodeRegex = /\s*([^<]+)<\/span>\s*