async function searchResults(keyword) { const searchUrl = `https://hds.turkish123.com/?s=${encodeURIComponent(keyword)}`; try { const response = await fetch(searchUrl); const html = await response; const results = []; const itemRegex = /
([\s\S]*?)<\/p>/); let description = descriptionMatch ? descriptionMatch[1].trim() : 'Weirdly the website doesn\'t provide any description, either that or I\'m blind.'; description = description.replace(/–/g, '–').replace(/’/g, '’'); const yearMatch = html.match(/<\/i>Year:<\/strong>[\s\S]*?(\d{4})<\/a>/); const airdate = yearMatch ? yearMatch[1] : 'N/A'; details.push({ description, alias: 'N/A', airdate }); //console.log(details); console.log(JSON.stringify(details)); return JSON.stringify(details); } catch (error) { console.error('Error extracting details:', error); return JSON.stringify([]); } } async function extractEpisodes(url) { const response = await fetch(url); const html = await response; const episodes = []; const episodeMatches = html.match(/[^<]*Episode (\d+)[^<]*(?:]*>[^<]*<\/span>)?[^<]*<\/a>/g); if (episodeMatches) { episodeMatches.forEach((match) => { const hrefMatch = match.match(/href="([^"]+)"/); const episodeNumberMatch = match.match(/Episode (\d+)/); if (hrefMatch && episodeNumberMatch) { episodes.push({ href: hrefMatch[1].trim(), number: parseInt(episodeNumberMatch[1], 10) }); } }); } //console.log(episodes); console.log(JSON.stringify(episodes)); return JSON.stringify(episodes); } async function extractStreamUrl(url) { const response = await fetch(url); const data = await response; const iframeMatch = data.match(/var copyTexti= \['