async function searchResults(keyword) { const results = []; try { const response = await fetchv2("https://tv3.egydead.live/?s=" + encodeURIComponent(keyword)); const html = await response.text(); const regex = /
([\s\S]*?)<\/p>/);
const description = match ? match[1].trim() : "N/A";
return JSON.stringify([{
description: description,
aliases: "N/A",
airdate: "N/A"
}]);
} catch (err) {
return JSON.stringify([{
description: "Error",
aliases: "Error",
airdate: "Error"
}]);
}
}
async function extractEpisodes(url) {
const results = [];
try {
const response = await fetchv2(url);
const html = await response.text();
const regex = /]*>\s*حلقه\s*(\d+)\s*<\/a>/g;
let match;
while ((match = regex.exec(html)) !== null) {
results.push({
href: match[1].trim(),
number: parseInt(match[2], 10)
});
}
if (results.length === 0) {
results.push({
href: url,
number: 1
});
}
return JSON.stringify(results.reverse());
} catch (err) {
return JSON.stringify([{
href: "Error",
number: "Error"
}]);
}
}
async function extractStreamUrl(url) {
try {
const header = {
"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 response = await fetchv2(url, header, "POST", postData);
const html = await response.text();
const earnvidsMatch = html.match(/ \s*EarnVids\s*<\/p>/i);
const embedResponse = await fetchv2(earnvidsMatch[1], header);
const embedHtml = await embedResponse.text();
if (earnvidsMatch) {
const stream = await earnvidsExtractor(embedHtml, url);
return stream;
}
return null;
} catch (err) {
console.error("Error in extractStreamUrl:", err);
return "https://files.catbox.moe/avolvc.mp4";
}
}
/* SCHEME START */
/* {REQUIRED PLUGINS: unbaser} */
/**
* @name earnvidsExtractor
* @author 50/50
*/
async function earnvidsExtractor(html, url = null) {
try {
const obfuscatedScript = html.match(/