Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Commit

Permalink
arrumado possivelmente coiso do cloudflare
Browse files Browse the repository at this point in the history
  • Loading branch information
uesleibros committed Sep 6, 2024
1 parent 100fe7a commit ff17a70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 31 deletions.
32 changes: 4 additions & 28 deletions src/app/api/imagens/anroll/route.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import {HttpsProxyAgent} from "https-proxy-agent";

export async function GET(request) {
const query = request.nextUrl.searchParams.get("q");

Expand All @@ -10,38 +8,16 @@ export async function GET(request) {
);

try {
const proxyUrl = "http://27.64.18.8:10004"
const agent = new HttpsProxyAgent(proxyUrl);
const url = decodeURIComponent(query);
const res = await fetch(`${url}&__cf_chl_rt_tk=mkrdVHTBzhTDAR0lA4vkagRNKH2MOHkFhCo0068kn_4-1725379337-0.0.1.1-7316`, {
agent,
const apikey = "ed59bacd6da711d678cf8baa6966aba6350d364a";

const res = await fetch(`https://api.zenrows.com/v1?apikey=${apikey}&original_status=true&custom_headers=true&url=${url}`, {
headers: {
"Referer": "https://www.anroll.net/",
"Sec-Ch-Ua": '"Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"',
"Sec-Ch-Ua-Arch": '"x86"',
"Sec-Ch-Ua-Bitness": '"64"',
"Sec-Ch-Ua-Full-Version": '"128.0.6613.117"',
"Sec-Ch-Ua-Full-Version-List": '"Chromium";v="128.0.6613.117", "Not;A=Brand";v="24.0.0.0", "Google Chrome";v="128.0.6613.117"',
"Sec-Ch-Ua-Mobile": "?0",
"Sec-Ch-Ua-Model": '',
"Sec-Ch-Ua-Platform": '"Windows"',
"Sec-Ch-Ua-Platform-Version": '"10.0.0"',
"Sec-Ch-Ua-Mobile": "?0",
"Sec-Ch-Ua-Platform": "\"Windows\"",
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-Site": "same-origin",
"Sec-Fetch-User": "?1",
"Service-Worker-Navigation-Preload": "true",
"Upgrade-Insecure-Requests": '1',
"Cookie": "cf_chl_rc_i=14; cf_clearance=sn64to8rx_RtsuIE8gYRmHaSRVvdPj5IBEwDRVxK1qM-1725381127-1.2.1.1-fLBtKZNM003d3L1H6M0pqtRDTW77mRi5c8NfOYAs3sk.RMWJwqu2P1Y4GAKQ1Tbb38cXLFHQRBEdsrvTlKHMwO_4TddJt0pkvwrhSWH44fe4W2MtuV4Wh5rVzHDGM75QYgqHKI0gz558XAE69KU5b6JhGHz.zdaO9xUp7xTsh5J22iBerMXIswP0EBvHtrqqUzoek1XEEv9Btee2k2y3jWR9e7Bufx.yeBZUEt1AtCZ5igE_R60wLZew7HBAtf8fqLWBbWQWAl83fuHlw.zogKVqAhcULdJ9IQgF3BK1KjB5UvhDEwrJYPq_krzMMrcVtlPWVLRCC1Z7DWyRJyub7Ulud5QZWoUS8vahaWwUdpuwhOPLQqwJL9DoaM3Epnwhl5IlMNIe1HkOB9C9ElWOa4EiBVcUYSzqUu17SQ2EIjbDaEQ7VHYutDa1hWW9S6ji",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
"Referer": "https://www.anroll.net/"
},
cache: "no-store",
});

console.log(await res.text());

if (!res.ok) {
return new Response(
JSON.stringify({ error: "Failed to fetch the image." }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export async function GET(request) {
return new Response(JSON.stringify({ error: "Invalid URL structure or missing slug/episodio." }), { status: 400 });

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}`, {
const res = await fetch(url, {
headers: {
"Referer": "https://www.anroll.net/"
"Referer": "https://www.anroll.net/",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
},
cache: "no-store"
});
Expand Down

0 comments on commit ff17a70

Please sign in to comment.