async function searchResults(keyword) { const searchUrl = `https://kimcartoon.com.co/?s=${encodeURIComponent(keyword)}`; try { const response = await fetchv2(searchUrl); const html = await response;text(); const results = []; const articleRegex = /]*class="bs styletwo"[\s\S]*?<\/article>/g; const items = html.match(articleRegex) || []; function cleanTitle(title) { return title .replace(/’/g, "'") .replace(/–/g, "-") .replace(/&#[0-9]+;/g, ""); } items.forEach((itemHtml) => { const titleMatch = itemHtml.match(/]*href="([^"]+)"[^>]*title="([^"]+)"/); const imgMatch = itemHtml.match(/]*src="([^"]+)"/); if (!titleMatch || !imgMatch) return; const href = `${titleMatch[1].trim()}?video_index=2`; const title = cleanTitle(titleMatch[2].trim()); const imageUrl = imgMatch[1].trim(); results.push({ title, image: imageUrl, href }); }); console.log(JSON.stringify(results)); return JSON.stringify(results); } catch (error) { throw error; } } async function extractDetails(url) { const response = await fetchv2(url); const html = await response.text(); const details = []; const descriptionMatch = html.match(/
\s*

(.*?)<\/p>/); const description = descriptionMatch ? descriptionMatch[1].trim() : `N/A`; details.push({ description, alias: 'N/A', airdate: 'N/A' }); console.log(JSON.stringify(details)); return JSON.stringify(details); } async function extractEpisodes(url) { const response = await fetchv2(url); const html = await response.text(); const episodes = []; const allMatches = [...html.matchAll(/]*>\s*\s*