Update ashi/ashi.js

This commit is contained in:
aka paul 2025-10-11 17:15:01 +00:00
parent 4bdd7bbd2b
commit 9db4f3815c

View file

@ -621,15 +621,25 @@ async function extractStreamUrl(url) {
JSON.stringify(decryptRequestData)
);
const decryptedResponse = await decryptBatchResponse.json();
console.log("Decrypted response:" + JSON.stringify(decryptedResponse));
const decryptedUrl = decryptedResponse[0]?.data.url;
const subListEncoded = decryptedUrl.split("sub.list=")[1]?.split("&")[0];
const subListUrl = decodeURIComponent(subListEncoded);
const subListEncoded = decryptedUrl.split("sub.list=")[1]?.split("&")[0];
let subtitles = "N/A";
const subResponse = await fetchv2(subListUrl);
const subtitles = await subResponse.json();
if (subListEncoded) {
try {
const subListUrl = decodeURIComponent(subListEncoded);
const subResponse = await fetchv2(subListUrl);
subtitles = await subResponse.json();
} catch {
subtitles = "N/A";
}
}
const englishSubUrl = subtitles.find(sub => sub.label === "English")?.file.replace(/\\\//g, "/");
const englishSubUrl = Array.isArray(subtitles)
? subtitles.find(sub => sub.label === "English")?.file.replace(/\\\//g, "/")
: "N/A";
if (!decryptedUrl) {
console.log("Decryption failed");
@ -664,7 +674,7 @@ async function extractStreamUrl(url) {
stream: m3u8Link,
subtitles: englishSubUrl
};
console.log("RETURN: " + JSON.stringify(returnValue));
return JSON.stringify(returnValue);
} catch (error) {
console.log("1Movies fetch error:" + error);