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 = {
|
||||
"text": result,
|
||||
"Useragent": headers["User-Agent"]
|
||||
"agent": headers["User-Agent"]
|
||||
};
|
||||
|
||||
const finalResponse = await fetchv2(
|
||||
"https://ilovekai.simplepostrequest.workers.dev/ilovebush",
|
||||
"https://enc-dec.app/api/dec-mega",
|
||||
{},
|
||||
"POST",
|
||||
JSON.stringify(postData)
|
||||
@@ -548,9 +548,9 @@ async function extractStreamUrl(url) {
|
||||
decryptedRaw ? getStream(decryptedRaw) : Promise.resolve(null)
|
||||
]);
|
||||
|
||||
if (subStream) streams.push("Hardsub English", subStream);
|
||||
if (dubStream) streams.push("Dubbed English", dubStream);
|
||||
if (rawStream) streams.push("Original audio", rawStream);
|
||||
if (subStream) streams.push({ title: "Hardsub English", streamUrl: subStream });
|
||||
if (dubStream) streams.push({ title: "Dubbed English", streamUrl: dubStream });
|
||||
if (rawStream) streams.push({ title: "Original audio", streamUrl: rawStream });
|
||||
|
||||
const final = {
|
||||
streams,
|
||||
@@ -589,16 +589,13 @@ async function extractStreamUrl(url) {
|
||||
|
||||
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(
|
||||
"https://ilovekai.simplepostrequest.workers.dev/ilovethighs",
|
||||
{},
|
||||
"POST",
|
||||
JSON.stringify(tokenRequestData)
|
||||
);
|
||||
const tokenResults = await tokenBatchResponse.json();
|
||||
const token = tokenResults[0]?.data;
|
||||
const tokenResponses = await Promise.all(tokenPromises);
|
||||
const tokenData = await tokenResponses[0].json();
|
||||
const token = tokenData.result;
|
||||
|
||||
if (!token) {
|
||||
console.log("Token not found");
|
||||
@@ -614,17 +611,14 @@ async function extractStreamUrl(url) {
|
||||
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(
|
||||
"https://ilovekai.simplepostrequest.workers.dev/iloveboobs",
|
||||
{},
|
||||
"POST",
|
||||
JSON.stringify(decryptRequestData)
|
||||
);
|
||||
const decryptedResponse = await decryptBatchResponse.json();
|
||||
console.log("Decrypted response:" + JSON.stringify(decryptedResponse));
|
||||
const decryptedUrl = decryptedResponse[0]?.data.url;
|
||||
const decryptResponses = await Promise.all(decryptPromises);
|
||||
const decryptData = await decryptResponses[0].json();
|
||||
console.log("Decrypted response:" + JSON.stringify(decryptData));
|
||||
const decryptedUrl = decryptData.result.url;
|
||||
|
||||
const subListEncoded = decryptedUrl.split("sub.list=")[1]?.split("&")[0];
|
||||
let subtitles = "N/A";
|
||||
@@ -662,23 +656,13 @@ async function extractStreamUrl(url) {
|
||||
return "error";
|
||||
}
|
||||
|
||||
const postData = {
|
||||
"text": result,
|
||||
"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 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")}`);
|
||||
const finalJsonText = await finalResponse.text();
|
||||
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 m3u8Response = await fetchv2(m3u8Link);
|
||||
const m3u8Text = await m3u8Response.text();
|
||||
|
||||
const baseUrl = m3u8Link.substring(0, m3u8Link.lastIndexOf('/') + 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user