fix
Sync Versions to index.json / sync-versions (push) Failing after 23s
Fetch and Save Remote Content / fetch (push) Failing after 13m19s

This commit is contained in:
aka paul
2026-06-04 17:31:03 +02:00
parent 6259f42863
commit eb493f2835
2 changed files with 34 additions and 29 deletions
+18 -13
View File
@@ -2,7 +2,7 @@ async function searchResults(keyword) {
try { try {
const encodedKeyword = encodeURIComponent(keyword); const encodedKeyword = encodeURIComponent(keyword);
const ddosInterceptor = new DdosGuardInterceptor(); const ddosInterceptor = new DdosGuardInterceptor();
const responseText = await ddosInterceptor.fetchWithBypass(`https://animepahe.com/api?m=search&q=${encodedKeyword}`); const responseText = await ddosInterceptor.fetchWithBypass(`https://animepahe.pw/api?m=search&q=${encodedKeyword}`);
const dataText = await responseText.text(); const dataText = await responseText.text();
console.log(dataText); console.log(dataText);
const data = JSON.parse(dataText); const data = JSON.parse(dataText);
@@ -10,14 +10,14 @@ async function searchResults(keyword) {
return { return {
title: result.title, title: result.title,
image: result.poster, image: result.poster,
href: `https://animepahe.com/anime/${result.session}` href: `https://animepahe.pw/anime/${result.session}`
}; };
}); });
return JSON.stringify(transformedResults); return JSON.stringify(transformedResults);
} catch (error) { } catch (error) {
console.log("Fetch error in searchResults: " + error); console.log("Fetch error in searchResults: " + error);
return JSON.stringify([{ title: "Error", image: "", href: "" }]); return JSON.stringify([{ title: "Please wait a bit then try again!", image: "", href: "" }]);
} }
} }
@@ -60,14 +60,14 @@ async function extractEpisodes(url) {
const ddosInterceptor = new DdosGuardInterceptor(); const ddosInterceptor = new DdosGuardInterceptor();
let page = 1; let page = 1;
const apiUrl1 = `https://animepahe.com/api?m=release&id=${id}&sort=episode_asc&page=${page}`; const apiUrl1 = `https://animepahe.pw/api?m=release&id=${id}&sort=episode_asc&page=${page}`;
const response1 = await ddosInterceptor.fetchWithBypass(apiUrl1); const response1 = await ddosInterceptor.fetchWithBypass(apiUrl1);
const dataText1 = await response1.text(); const dataText1 = await response1.text();
const data1 = JSON.parse(dataText1); const data1 = JSON.parse(dataText1);
for (const item of data1.data) { for (const item of data1.data) {
results.push({ results.push({
href: `https://animepahe.com/play/${id}/${item.session}`, href: `https://animepahe.pw/play/${id}/${item.session}`,
number: item.episode number: item.episode
}); });
} }
@@ -81,7 +81,7 @@ async function extractEpisodes(url) {
let retries = 0; let retries = 0;
while (!pageData && retries < 3) { while (!pageData && retries < 3) {
try { try {
const apiUrl = `https://animepahe.com/api?m=release&id=${id}&sort=episode_asc&page=${pageNum}`; const apiUrl = `https://animepahe.pw/api?m=release&id=${id}&sort=episode_asc&page=${pageNum}`;
const response = await ddosInterceptor.fetchWithBypass(apiUrl); const response = await ddosInterceptor.fetchWithBypass(apiUrl);
const dataText = await response.text(); const dataText = await response.text();
pageData = JSON.parse(dataText); pageData = JSON.parse(dataText);
@@ -101,7 +101,7 @@ async function extractEpisodes(url) {
if (pageData && pageData.data) { if (pageData && pageData.data) {
for (const item of pageData.data) { for (const item of pageData.data) {
results.push({ results.push({
href: `https://animepahe.com/play/${id}/${item.session}`, href: `https://animepahe.pw/play/${id}/${item.session}`,
number: item.episode number: item.episode
}); });
} }
@@ -185,14 +185,14 @@ async function extractStreamUrl(url) {
const parts = scriptContent.split('));eval('); const parts = scriptContent.split('));eval(');
if (parts.length === 2) { if (parts.length === 2) {
const layer2Packed = parts[1].substring(0, parts[1].length - 1); const layer2Packed = parts[1].substring(0, parts[1].length - 1);
try { unpacked = unpack(layer2Packed); } catch(e) {} try { unpacked = unpack(layer2Packed); } catch (e) { }
} }
} else { } else {
try { unpacked = unpack(scriptContent); } catch(e) {} try { unpacked = unpack(scriptContent); } catch (e) { }
} }
if (unpacked) { if (unpacked) {
const urlMatch = unpacked.match(/const source=\\?['"]([^'"]+)['"]/) || const urlMatch = unpacked.match(/const source=\\?['"]([^'"]+)['"]/) ||
unpacked.match(/https:\/\/[^\s'";]+\.m3u8/); unpacked.match(/https:\/\/[^\s'";]+\.m3u8/);
if (urlMatch) { if (urlMatch) {
let hlsUrl = (urlMatch[1] || urlMatch[0]).replace(/\\+$/, ''); let hlsUrl = (urlMatch[1] || urlMatch[0]).replace(/\\+$/, '');
hlsUrl = hlsUrl.replace("/stream/", "/hls/").replace("uwu.m3u8", "owo.m3u8"); hlsUrl = hlsUrl.replace("/stream/", "/hls/").replace("uwu.m3u8", "owo.m3u8");
@@ -265,7 +265,7 @@ async function extractStreamUrl(url) {
} }
} }
// Fixed DDOS Bypass // Fixed Bypass
class DdosGuardInterceptor { class DdosGuardInterceptor {
constructor() { constructor() {
this.errorCodes = [403]; this.errorCodes = [403];
@@ -274,6 +274,11 @@ class DdosGuardInterceptor {
} }
async fetchWithBypass(url, options = {}) { async fetchWithBypass(url, options = {}) {
const solverUrl = `https://tmdbproxy22.simplepostrequest.workers.dev/solver?url=${encodeURIComponent(url)}&cache=1h`;
return fetchv2(solverUrl, options.headers || {});
}
async fetchWithBypassDdos(url, options = {}) {
let response = await this.fetchWithCookies(url, options); let response = await this.fetchWithCookies(url, options);
let responseText = null; let responseText = null;
@@ -292,8 +297,8 @@ class DdosGuardInterceptor {
} }
const isBlocked = responseText.includes('ddos-guard/js-challenge') || const isBlocked = responseText.includes('ddos-guard/js-challenge') ||
responseText.includes('DDoS-Guard') || responseText.includes('DDoS-Guard') ||
responseText.includes('data-ddg-origin'); responseText.includes('data-ddg-origin');
if (!isBlocked) { if (!isBlocked) {
response.text = async () => responseText; response.text = async () => responseText;
+1 -1
View File
@@ -5,7 +5,7 @@
"name": "50/50", "name": "50/50",
"icon": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ3122kQwublLkZ6rf1fEpUP79BxZOFmH9BSA&s" "icon": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ3122kQwublLkZ6rf1fEpUP79BxZOFmH9BSA&s"
}, },
"version": "1.0.4", "version": "1.2.0",
"language": "English", "language": "English",
"streamType": "HLS", "streamType": "HLS",
"quality": "1080p", "quality": "1080p",