fix: update getMeta and getStream functions to improve link handling and extraction logic

This commit is contained in:
himanshu8443
2025-06-23 18:26:47 +05:30
parent dbd4cddfc9
commit 0dcab5e4f7
4 changed files with 137 additions and 9 deletions

View File

@@ -14,8 +14,40 @@ const getStream = (_a) => __awaiter(void 0, [_a], void 0, function* ({ link, sig
var _b;
try {
let newLink = link;
console.log("getStream 1", link);
if (link.includes("linkstore")) {
console.log("linkstore detected");
const res = yield fetch(link, {
signal,
headers: {
accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"accept-language": "en-US,en;q=0.9,en-IN;q=0.8",
"cache-control": "no-cache",
pragma: "no-cache",
priority: "u=0, i",
"sec-ch-ua": '"Microsoft Edge";v="137", "Chromium";v="137", "Not/A)Brand";v="24"',
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": '"Windows"',
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "none",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1",
cookie: "PHPSESSID=9o57cff841dqtv8djtn1rp1712; ext_name=ojplmecpdpgccookcobabopnaifgidhf",
},
});
const html = yield res.text();
const refreshMetaMatch = html.match(/<meta\s+http-equiv="refresh"\s+content="[^"]*url=([^"]+)"/i);
if (refreshMetaMatch && refreshMetaMatch[1]) {
link = refreshMetaMatch[1];
}
}
else {
console.log("linkstore not detected");
}
console.log("getStream 2", link);
if (link.includes("luxedrive")) {
const res = yield providerContext.axios.get(link);
const res = yield providerContext.axios.get(link, { signal });
const $ = providerContext.cheerio.load(res.data);
const hubcloudLink = $("a.btn.hubcloud").attr("href");
if (hubcloudLink) {
@@ -28,7 +60,7 @@ const getStream = (_a) => __awaiter(void 0, [_a], void 0, function* ({ link, sig
}
}
}
if (newLink.includes("gdflix")) {
if (newLink.includes("flix")) {
const sreams = yield providerContext.extractors.gdFlixExtracter(newLink, signal);
return sreams;
}