diff --git a/animekai/animekai.js b/animekai/animekai.js index 7550ae4..03b4ec8 100644 --- a/animekai/animekai.js +++ b/animekai/animekai.js @@ -13,7 +13,7 @@ async function searchResults(query) { try { const encodedQuery = encodeQuery(query); const searchUrl = searchBaseUrl + encodedQuery; - const response = await fetchv2("https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(searchUrl)); + const response = await fetchv2(searchUrl); const htmlText = await response.text(); const results = []; @@ -30,7 +30,9 @@ async function searchResults(query) { null; const imageMatch = imageMatches[index].match(extractImageRegex); - const imageSrc = imageMatch ? imageMatch[1] : null; + const imageSrc = imageMatch + ? (imageMatch[1].startsWith("http") ? imageMatch[1] : baseUrl + imageMatch[1]) + : null; const titleMatch = titleMatches[index].match(extractTitleRegex); const cleanTitle = titleMatch ? @@ -40,7 +42,7 @@ async function searchResults(query) { if (fullHref && imageSrc && cleanTitle) { results.push({ href: fullHref, - image: "https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(imageSrc), + image: imageSrc, title: cleanTitle }); } @@ -58,9 +60,8 @@ async function searchResults(query) { async function extractDetails(url) { try { - const response = await fetchv2("https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(url)); + const response = await fetchv2(url); const htmlText = await response.text(); - console.log(htmlText); const descriptionMatch = (/