mirror of
https://git.luna-app.eu/50n50/sources
synced 2026-01-12 01:18:11 +01:00
Update animepahe/animepahe.js
This commit is contained in:
parent
e003f58b44
commit
0b00de663c
1 changed files with 10 additions and 8 deletions
|
|
@ -129,15 +129,13 @@ async function extractStreamUrl(url) {
|
|||
return JSON.stringify({ streams: [], subtitle: "" });
|
||||
}
|
||||
|
||||
const streams = [];
|
||||
|
||||
for (const buttonHtml of buttonMatches) {
|
||||
const streamPromises = buttonMatches.map(async (buttonHtml) => {
|
||||
const srcMatch = buttonHtml.match(/data-src="([^"]*)"/);
|
||||
const resMatch = buttonHtml.match(/data-resolution="([^"]*)"/);
|
||||
const audioMatch = buttonHtml.match(/data-audio="([^"]*)"/);
|
||||
const fansubMatch = buttonHtml.match(/data-fansub="([^"]*)"/);
|
||||
|
||||
if (!srcMatch || !srcMatch[1].includes('kwik.cx')) continue;
|
||||
if (!srcMatch || !srcMatch[1].includes('kwik.cx')) return null;
|
||||
|
||||
const kwikUrl = srcMatch[1];
|
||||
const resolution = resMatch ? resMatch[1] : "Unknown";
|
||||
|
|
@ -171,21 +169,25 @@ async function extractStreamUrl(url) {
|
|||
const audioType = audio === "eng" ? "Dub" : "Hardsub";
|
||||
const title = `${resolution}p • ${audioType}`;
|
||||
|
||||
streams.push({
|
||||
return {
|
||||
title: title,
|
||||
streamUrl: hlsUrl,
|
||||
headers: {
|
||||
"Referer": "https://kwik.cx/",
|
||||
"Origin": "https://kwik.cx"
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
continue;
|
||||
// Continue to next
|
||||
}
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
const streamResults = await Promise.all(streamPromises);
|
||||
const streams = streamResults.filter(s => s !== null);
|
||||
|
||||
return JSON.stringify({
|
||||
streams: streams,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue