forked from 50n50/sources
Update ashi/ashi.js
This commit is contained in:
+23
-39
@@ -523,11 +523,11 @@ async function extractStreamUrl(url) {
|
|||||||
|
|
||||||
const postData = {
|
const postData = {
|
||||||
"text": result,
|
"text": result,
|
||||||
"Useragent": headers["User-Agent"]
|
"agent": headers["User-Agent"]
|
||||||
};
|
};
|
||||||
|
|
||||||
const finalResponse = await fetchv2(
|
const finalResponse = await fetchv2(
|
||||||
"https://ilovekai.simplepostrequest.workers.dev/ilovebush",
|
"https://enc-dec.app/api/dec-mega",
|
||||||
{},
|
{},
|
||||||
"POST",
|
"POST",
|
||||||
JSON.stringify(postData)
|
JSON.stringify(postData)
|
||||||
@@ -548,9 +548,9 @@ async function extractStreamUrl(url) {
|
|||||||
decryptedRaw ? getStream(decryptedRaw) : Promise.resolve(null)
|
decryptedRaw ? getStream(decryptedRaw) : Promise.resolve(null)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (subStream) streams.push("Hardsub English", subStream);
|
if (subStream) streams.push({ title: "Hardsub English", streamUrl: subStream });
|
||||||
if (dubStream) streams.push("Dubbed English", dubStream);
|
if (dubStream) streams.push({ title: "Dubbed English", streamUrl: dubStream });
|
||||||
if (rawStream) streams.push("Original audio", rawStream);
|
if (rawStream) streams.push({ title: "Original audio", streamUrl: rawStream });
|
||||||
|
|
||||||
const final = {
|
const final = {
|
||||||
streams,
|
streams,
|
||||||
@@ -589,16 +589,13 @@ async function extractStreamUrl(url) {
|
|||||||
|
|
||||||
const serverId = server1Match[1];
|
const serverId = server1Match[1];
|
||||||
|
|
||||||
const tokenRequestData = [{ name: "Server1", data: serverId }];
|
const tokenPromises = [
|
||||||
|
fetchv2(`https://enc-dec.app/api/enc-movies-flix?text=${encodeURIComponent(serverId)}`)
|
||||||
|
];
|
||||||
|
|
||||||
const tokenBatchResponse = await fetchv2(
|
const tokenResponses = await Promise.all(tokenPromises);
|
||||||
"https://ilovekai.simplepostrequest.workers.dev/ilovethighs",
|
const tokenData = await tokenResponses[0].json();
|
||||||
{},
|
const token = tokenData.result;
|
||||||
"POST",
|
|
||||||
JSON.stringify(tokenRequestData)
|
|
||||||
);
|
|
||||||
const tokenResults = await tokenBatchResponse.json();
|
|
||||||
const token = tokenResults[0]?.data;
|
|
||||||
|
|
||||||
if (!token) {
|
if (!token) {
|
||||||
console.log("Token not found");
|
console.log("Token not found");
|
||||||
@@ -614,17 +611,14 @@ async function extractStreamUrl(url) {
|
|||||||
return "error";
|
return "error";
|
||||||
}
|
}
|
||||||
|
|
||||||
const decryptRequestData = [{ name: "Server1", data: streamData.result }];
|
const decryptPromises = [
|
||||||
|
fetchv2("https://enc-dec.app/api/dec-movies-flix", {}, "POST", JSON.stringify({ text: streamData.result }))
|
||||||
|
];
|
||||||
|
|
||||||
const decryptBatchResponse = await fetchv2(
|
const decryptResponses = await Promise.all(decryptPromises);
|
||||||
"https://ilovekai.simplepostrequest.workers.dev/iloveboobs",
|
const decryptData = await decryptResponses[0].json();
|
||||||
{},
|
console.log("Decrypted response:" + JSON.stringify(decryptData));
|
||||||
"POST",
|
const decryptedUrl = decryptData.result.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 subListEncoded = decryptedUrl.split("sub.list=")[1]?.split("&")[0];
|
||||||
let subtitles = "N/A";
|
let subtitles = "N/A";
|
||||||
@@ -662,23 +656,13 @@ async function extractStreamUrl(url) {
|
|||||||
return "error";
|
return "error";
|
||||||
}
|
}
|
||||||
|
|
||||||
const postData = {
|
const finalResponse = await fetchv2(`https://enc-dec.app/api/dec-rapid?text=${encodeURIComponent(result)}&agent=${encodeURIComponent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36")}`);
|
||||||
"text": result,
|
const finalJsonText = await finalResponse.text();
|
||||||
"Useragent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"
|
const finalJson = JSON.parse(finalJsonText);
|
||||||
};
|
|
||||||
|
|
||||||
const [finalJson, m3u8Text] = await Promise.all([
|
|
||||||
fetchv2("https://ilovekai.simplepostrequest.workers.dev/iloveass", {}, "POST", JSON.stringify(postData)).then(r => r.json()),
|
|
||||||
(async () => {
|
|
||||||
const finalResponse = await fetchv2("https://ilovekai.simplepostrequest.workers.dev/iloveass", {}, "POST", JSON.stringify(postData));
|
|
||||||
const finalJson = await finalResponse.json();
|
|
||||||
const m3u8Link = finalJson?.result?.sources?.[0]?.file;
|
|
||||||
const m3u8Response = await fetchv2(m3u8Link);
|
|
||||||
return m3u8Response.text();
|
|
||||||
})()
|
|
||||||
]);
|
|
||||||
|
|
||||||
const m3u8Link = finalJson?.result?.sources?.[0]?.file;
|
const m3u8Link = finalJson?.result?.sources?.[0]?.file;
|
||||||
|
const m3u8Response = await fetchv2(m3u8Link);
|
||||||
|
const m3u8Text = await m3u8Response.text();
|
||||||
|
|
||||||
const baseUrl = m3u8Link.substring(0, m3u8Link.lastIndexOf('/') + 1);
|
const baseUrl = m3u8Link.substring(0, m3u8Link.lastIndexOf('/') + 1);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user