mirror of
https://git.luna-app.eu/50n50/sources
synced 2025-12-22 05:36:32 +01:00
Update egydead/egydead.js
This commit is contained in:
parent
44c4ac4723
commit
acde2500b5
1 changed files with 41 additions and 60 deletions
|
|
@ -80,72 +80,21 @@ async function extractEpisodes(url) {
|
||||||
async function extractStreamUrl(url) {
|
async function extractStreamUrl(url) {
|
||||||
try {
|
try {
|
||||||
const header = {
|
const header = {
|
||||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/"
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/",
|
||||||
|
"Referer": url
|
||||||
};
|
};
|
||||||
const postData = "View=1";
|
const postData = "View=1";
|
||||||
const response = await fetchv2(url, header, "POST", postData);
|
const response = await fetchv2(url, header, "POST", postData);
|
||||||
const html = await response.text();
|
const html = await response.text();
|
||||||
const match = html.match(/<li data-link="(https:\/\/mivalyo\.com\/v\/[^"]+)"/);
|
|
||||||
const streamUrl = match ? match[1] : "https://files.catbox.moe/avolvc.mp4";
|
|
||||||
console.log("Stream URL:", streamUrl);
|
|
||||||
|
|
||||||
const responseTwo = await fetchv2(streamUrl);
|
const earnvidsMatch = html.match(/<li[^>]*data-link=["']([^"']+)["'][^>]*>\s*<span>\s*<p>\s*EarnVids\s*<\/p>/i);
|
||||||
const htmlTwo = await responseTwo.text();
|
const embedResponse = await fetchv2(earnvidsMatch[1], header);
|
||||||
const obfuscatedScript = htmlTwo.match(/<script[^>]*>\s*(eval\(function\(p,a,c,k,e,d.*?\)[\s\S]*?)<\/script>/);
|
const embedHtml = await embedResponse.text();
|
||||||
|
if (earnvidsMatch) {
|
||||||
if (!obfuscatedScript) {
|
const stream = await earnvidsExtractor(embedHtml, url);
|
||||||
console.log("No obfuscated script found, using fallback");
|
return stream;
|
||||||
return "https://files.catbox.moe/avolvc.mp4";
|
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
const unpackedScript = unpack(obfuscatedScript[1]);
|
|
||||||
console.log("Unpacked script:", unpackedScript.substring(0, 200) + "...");
|
|
||||||
|
|
||||||
let hlsLink = null;
|
|
||||||
const baseUrl = url.match(/^(https?:\/\/[^/]+)/)[1];
|
|
||||||
|
|
||||||
const streamMatch = unpackedScript.match(/["'](\/stream\/[^"']+)["']/);
|
|
||||||
if (streamMatch) {
|
|
||||||
hlsLink = streamMatch[1];
|
|
||||||
console.log("Found stream path:", hlsLink);
|
|
||||||
return baseUrl + hlsLink;
|
|
||||||
}
|
|
||||||
|
|
||||||
const hlsObjectMatch = unpackedScript.match(/["']hls\d?["']\s*:\s*["'](https?:\/\/[^"']+\.m3u8[^"']*)["']/);
|
|
||||||
if (hlsObjectMatch) {
|
|
||||||
hlsLink = hlsObjectMatch[1];
|
|
||||||
console.log("Found HLS object link:", hlsLink);
|
|
||||||
return hlsLink;
|
|
||||||
}
|
|
||||||
|
|
||||||
const m3u8Match = unpackedScript.match(/["'](https?:\/\/[^"']+\.m3u8[^"']*)["']/);
|
|
||||||
if (m3u8Match) {
|
|
||||||
hlsLink = m3u8Match[1];
|
|
||||||
console.log("Found m3u8 link:", hlsLink);
|
|
||||||
return hlsLink;
|
|
||||||
}
|
|
||||||
|
|
||||||
const cdnMatch = unpackedScript.match(/["'](https?:\/\/[^"']*(?:cdn|stream)[^"']*\.m3u8[^"']*)["']/i);
|
|
||||||
if (cdnMatch) {
|
|
||||||
hlsLink = cdnMatch[1];
|
|
||||||
console.log("Found CDN link:", hlsLink);
|
|
||||||
return hlsLink;
|
|
||||||
}
|
|
||||||
|
|
||||||
const linksMatch = unpackedScript.match(/links\s*[=:]\s*({[^}]+}|\[[^\]]+\])/);
|
|
||||||
if (linksMatch) {
|
|
||||||
const linksStr = linksMatch[1];
|
|
||||||
const urlInLinks = linksStr.match(/["'](https?:\/\/[^"']+\.m3u8[^"']*)["']/);
|
|
||||||
if (urlInLinks) {
|
|
||||||
hlsLink = urlInLinks[1];
|
|
||||||
console.log("Found link in links object:", hlsLink);
|
|
||||||
return hlsLink;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log("No HLS link found in unpacked script, using fallback");
|
|
||||||
return "https://files.catbox.moe/avolvc.mp4";
|
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Error in extractStreamUrl:", err);
|
console.error("Error in extractStreamUrl:", err);
|
||||||
return "https://files.catbox.moe/avolvc.mp4";
|
return "https://files.catbox.moe/avolvc.mp4";
|
||||||
|
|
@ -153,6 +102,34 @@ async function extractStreamUrl(url) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* SCHEME START */
|
||||||
|
/* {REQUIRED PLUGINS: unbaser} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name earnvidsExtractor
|
||||||
|
* @author 50/50
|
||||||
|
*/
|
||||||
|
async function earnvidsExtractor(html, url = null) {
|
||||||
|
try {
|
||||||
|
const obfuscatedScript = html.match(/<script[^>]*>\s*(eval\(function\(p,a,c,k,e,d.*?\)[\s\S]*?)<\/script>/);
|
||||||
|
const unpackedScript = unpack(obfuscatedScript[1]);
|
||||||
|
|
||||||
|
const streamMatch = unpackedScript.match(/["'](\/stream\/[^"']+)["']/);
|
||||||
|
const hlsLink = streamMatch ? streamMatch[1] : null;
|
||||||
|
|
||||||
|
const baseUrl = url.match(/^(https?:\/\/[^/]+)/)[1];
|
||||||
|
|
||||||
|
console.log("HLS Link:" + baseUrl + hlsLink);
|
||||||
|
|
||||||
|
return baseUrl + hlsLink;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
return "https://files.catbox.moe/avolvc.mp4";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* REMOVE_START */
|
||||||
|
|
||||||
/***********************************************************
|
/***********************************************************
|
||||||
* UNPACKER MODULE
|
* UNPACKER MODULE
|
||||||
* Credit to GitHub user "mnsrulz" for Unpacker Node library
|
* Credit to GitHub user "mnsrulz" for Unpacker Node library
|
||||||
|
|
@ -271,3 +248,7 @@ function unpack(source) {
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* REMOVE_END */
|
||||||
|
|
||||||
|
/* SCHEME END */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue