Update 1movies/1movies.js
This commit is contained in:
+14
-5
@@ -197,13 +197,22 @@ async function extractStreamUrl(url) {
|
|||||||
const decryptedResponse = await decryptBatchResponse.json();
|
const decryptedResponse = await decryptBatchResponse.json();
|
||||||
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");
|
||||||
|
|||||||
Reference in New Issue
Block a user