mirror of
https://git.luna-app.eu/50n50/sources
synced 2025-12-21 21:26:19 +01:00
Update ashi/ashi.js
This commit is contained in:
parent
4bdd7bbd2b
commit
9db4f3815c
1 changed files with 16 additions and 6 deletions
22
ashi/ashi.js
22
ashi/ashi.js
|
|
@ -621,15 +621,25 @@ async function extractStreamUrl(url) {
|
||||||
JSON.stringify(decryptRequestData)
|
JSON.stringify(decryptRequestData)
|
||||||
);
|
);
|
||||||
const decryptedResponse = await decryptBatchResponse.json();
|
const decryptedResponse = await decryptBatchResponse.json();
|
||||||
|
console.log("Decrypted response:" + JSON.stringify(decryptedResponse));
|
||||||
const decryptedUrl = decryptedResponse[0]?.data.url;
|
const decryptedUrl = decryptedResponse[0]?.data.url;
|
||||||
|
|
||||||
const subListEncoded = decryptedUrl.split("sub.list=")[1]?.split("&")[0];
|
const subListEncoded = decryptedUrl.split("sub.list=")[1]?.split("&")[0];
|
||||||
const subListUrl = decodeURIComponent(subListEncoded);
|
let subtitles = "N/A";
|
||||||
|
|
||||||
const subResponse = await fetchv2(subListUrl);
|
if (subListEncoded) {
|
||||||
const subtitles = await subResponse.json();
|
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) {
|
if (!decryptedUrl) {
|
||||||
console.log("Decryption failed");
|
console.log("Decryption failed");
|
||||||
|
|
@ -664,7 +674,7 @@ async function extractStreamUrl(url) {
|
||||||
stream: m3u8Link,
|
stream: m3u8Link,
|
||||||
subtitles: englishSubUrl
|
subtitles: englishSubUrl
|
||||||
};
|
};
|
||||||
|
console.log("RETURN: " + JSON.stringify(returnValue));
|
||||||
return JSON.stringify(returnValue);
|
return JSON.stringify(returnValue);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("1Movies fetch error:" + error);
|
console.log("1Movies fetch error:" + error);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue