From caee19ed0507c369499e040a99c9c973b6cd1112 Mon Sep 17 00:00:00 2001 From: aka paul <50n50@noreply.localhost> Date: Sun, 28 Dec 2025 13:55:39 +0000 Subject: [PATCH] Update animekai/dub/animekai.js --- animekai/dub/animekai.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/animekai/dub/animekai.js b/animekai/dub/animekai.js index 6ceb52c..2856043 100644 --- a/animekai/dub/animekai.js +++ b/animekai/dub/animekai.js @@ -1,7 +1,7 @@ async function searchResults(query) { const encodeQuery = keyword => encodeURIComponent(keyword); - const searchBaseUrl = "https://animekai.to/browser?keyword="; - const baseUrl = "https://animekai.to"; + const searchBaseUrl = "https://anikai.to/browser?keyword="; + const baseUrl = "https://anikai.to"; const posterHrefRegex = /href="[^"]*" class="poster"/g; const titleRegex = /class="title"[^>]*title="[^"]*"/g; @@ -13,7 +13,7 @@ async function searchResults(query) { try { const encodedQuery = encodeQuery(query); const searchUrl = searchBaseUrl + encodedQuery; - const response = await fetchv2(searchUrl); + const response = await fetchv2("https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(searchUrl)); const htmlText = await response.text(); const results = []; @@ -58,7 +58,7 @@ async function searchResults(query) { async function extractDetails(url) { try { - const response = await fetchv2(url); + const response = await fetchv2("https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(url)); const htmlText = await response.text(); console.log(htmlText); @@ -83,7 +83,7 @@ async function extractDetails(url) { async function extractEpisodes(url) { try { const actualUrl = url.replace("Animekai:", "").trim(); - const htmlText = await (await fetchv2(actualUrl)).text(); + const htmlText = await (await fetchv2("https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(actualUrl))).text(); const animeIdMatch = (htmlText.match(/
]*data-id="([^"]+)"/) || [])[1]; if (!animeIdMatch) return JSON.stringify([{ error: "AniID not found" }]); @@ -91,8 +91,8 @@ async function extractEpisodes(url) { const tokenData = await tokenResponse.json(); const token = tokenData.result; - const episodeListUrl = `https://animekai.to/ajax/episodes/list?ani_id=${animeIdMatch}&_=${token}`; - const episodeListData = await (await fetchv2(episodeListUrl)).json(); + const episodeListUrl = `https://anikai.to/ajax/episodes/list?ani_id=${animeIdMatch}&_=${token}`; + const episodeListData = await (await fetchv2("https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(episodeListUrl))).json(); const cleanedHtml = cleanJsonHtml(episodeListData.result); const episodeRegex = /]+num="([^"]+)"[^>]+token="([^"]+)"[^>]*>/g; @@ -100,7 +100,7 @@ async function extractEpisodes(url) { const episodes = episodeMatches.map(([_, episodeNum, episodeToken]) => ({ number: parseInt(episodeNum, 10), - href: `https://animekai.to/ajax/links/list?token=${episodeToken}&_=ENCRYPT_ME` + href: `https://anikai.to/ajax/links/list?token=${episodeToken}&_=ENCRYPT_ME` })); return JSON.stringify(episodes); @@ -125,7 +125,7 @@ async function extractStreamUrl(url) { } const fetchUrl = `${url}`; - const response = await fetchv2(fetchUrl); + const response = await fetchv2("https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(fetchUrl)); const text = await response.text(); const cleanedHtml = cleanJsonHtml(text); const subRegex = /
]*>([\s\S]*?)<\/div>/; @@ -164,7 +164,7 @@ async function extractStreamUrl(url) { }; return { type: result.name, - url: `https://animekai.to/ajax/links/view?id=${serverIdMap[result.name]}&_=${result.data}` + url: `https://anikai.to/ajax/links/view?id=${serverIdMap[result.name]}&_=${result.data}` }; }); @@ -172,7 +172,7 @@ async function extractStreamUrl(url) { const streamResponses = await Promise.all( streamUrls.map(async ({ type, url }) => { try { - const res = await fetchv2(url); + const res = await fetchv2("https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(url)); const json = await res.json(); return { type: type, @@ -227,14 +227,13 @@ async function extractStreamUrl(url) { console.log(decryptedDub); const headers = { - "Referer": "https://animekai.to/", + "Referer": "https://anikai.to/", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36" }; if (decryptedDub) { const response = await fetchv2(decryptedDub.replace("/e/", "/media/"), headers); const responseJson = await response.json(); - const result = responseJson?.result; const postData = {