From 100fe7af7c459c7403b0518dfda16442437161f7 Mon Sep 17 00:00:00 2001 From: Ueslei Paim Date: Thu, 5 Sep 2024 22:31:51 -0300 Subject: [PATCH] Update route.js --- .../anroll/[slug]/[episodio]/media.m3u8/route.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/app/api/streaming/anroll/[slug]/[episodio]/media.m3u8/route.js b/src/app/api/streaming/anroll/[slug]/[episodio]/media.m3u8/route.js index 337fb34..b7e5035 100644 --- a/src/app/api/streaming/anroll/[slug]/[episodio]/media.m3u8/route.js +++ b/src/app/api/streaming/anroll/[slug]/[episodio]/media.m3u8/route.js @@ -10,13 +10,11 @@ export async function GET(request) { if (!slug || !episodio || pathParts[pathParts.length - 1] !== "media.m3u8") return new Response(JSON.stringify({ error: "Invalid URL structure or missing slug/episodio." }), { status: 400 }); - const res = await fetch(`https://${config.anroll.cdn}/cf/hls/animes/${slug}/${episodio}.mp4/media-1/stream.m3u8`, { + const url = `https://${config.anroll.cdn}/cf/hls/animes/${slug}/${episodio}.mp4/media-1/stream.m3u8`; + const apikey = "ed59bacd6da711d678cf8baa6966aba6350d364a"; + const res = await fetch(`https://api.zenrows.com/v1?apikey=${apikey}&original_status=true&custom_headers=true&url=${url}`, { headers: { - "Origin": "https://www.anroll.net", - "Referer": "https://www.anroll.net/", - "Host": "localhost:3000", - "X-Real-IP": "127.0.0.1", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" + "Referer": "https://www.anroll.net/" }, cache: "no-store" });