async function searchResults(query) { const encodeQuery = keyword => encodeURIComponent(keyword); const searchBaseUrl = "https://anikai.to/browser?keyword="; const baseUrl = "https://anikai.to"; const posterHrefRegex = /href="[^"]*" class="poster"/g; const titleRegex = /class="title"[^>]*title="[^"]*"/g; const imageRegex = /data-src="[^"]*"/g; const extractHrefRegex = /href="([^"]*)"/; const extractImageRegex = /data-src="([^"]*)"/; const extractTitleRegex = /title="([^"]*)"/; try { const encodedQuery = encodeQuery(query); const searchUrl = searchBaseUrl + encodedQuery; const response = await fetchv2("https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(searchUrl)); const htmlText = await response.text(); const results = []; const posterMatches = htmlText.match(posterHrefRegex) || []; const titleMatches = htmlText.match(titleRegex) || []; const imageMatches = htmlText.match(imageRegex) || []; const minLength = Math.min(posterMatches.length, titleMatches.length, imageMatches.length); for (let index = 0; index < minLength; index++) { const hrefMatch = posterMatches[index].match(extractHrefRegex); const fullHref = hrefMatch ? (hrefMatch[1].startsWith("http") ? hrefMatch[1] : baseUrl + hrefMatch[1]) : null; const imageMatch = imageMatches[index].match(extractImageRegex); const imageSrc = imageMatch ? imageMatch[1] : null; const titleMatch = titleMatches[index].match(extractTitleRegex); const cleanTitle = titleMatch ? decodeHtmlEntities(titleMatch[1]) : null; if (fullHref && imageSrc && cleanTitle) { results.push({ href: fullHref, image: "https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(imageSrc), title: cleanTitle }); } } return JSON.stringify(results); } catch (error) { return JSON.stringify([{ href: "", image: "", title: "Search failed: " + error.message }]); } } async function extractDetails(url) { try { const response = await fetchv2("https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(url)); const htmlText = await response.text(); console.log(htmlText); const descriptionMatch = (/