diff --git a/animedefenders/animedefenders.js b/animedefenders/animedefenders.js index 067008c..8a4da44 100644 --- a/animedefenders/animedefenders.js +++ b/animedefenders/animedefenders.js @@ -84,13 +84,14 @@ async function extractStreamUrl(url) { if (!iframeUrl) return JSON.stringify({ streams: [], subtitle: "" }); const iframeHtml = await (await fetchv2(iframeUrl, { "Referer": "https://anibd.app/" })).text(); - const streamUrl = iframeHtml.match(/url:\s*['"]([^'"]+\.m3u8)['"]/)?.[1]; + let streamUrl = iframeHtml.match(/url:\s*['"]([^'"]+\.m3u8)['"]/)?.[1] || iframeHtml.match(/videoUrl:\s*["']([^"']+\.m3u8)['"]/)?.[1]; if (streamUrl) { + const fullUrl = streamUrl.startsWith("/") ? "https://playeng.animeapps.top" + streamUrl : streamUrl.startsWith("http") ? streamUrl : "https://playeng.animeapps.top/r2/" + streamUrl; return JSON.stringify({ streams: [{ title: "Server 1", - streamUrl: "https://playeng.animeapps.top/r2/" + streamUrl, + streamUrl: fullUrl, headers: { "Referer": "https://anibd.app/" } }], subtitle: ""