mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
fix: update getMeta and getStream functions to improve link handling and extraction logic
This commit is contained in:
@@ -12,8 +12,45 @@ export const getStream = async ({
|
||||
}): Promise<Stream[]> => {
|
||||
try {
|
||||
let newLink = link;
|
||||
console.log("getStream 1", link);
|
||||
if (link.includes("linkstore")) {
|
||||
console.log("linkstore detected");
|
||||
const res = await 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 = await 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 = await providerContext.axios.get(link);
|
||||
const res = await providerContext.axios.get(link, { signal });
|
||||
const $ = providerContext.cheerio.load(res.data);
|
||||
const hubcloudLink = $("a.btn.hubcloud").attr("href");
|
||||
if (hubcloudLink) {
|
||||
@@ -25,7 +62,7 @@ export const getStream = async ({
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newLink.includes("gdflix")) {
|
||||
if (newLink.includes("flix")) {
|
||||
const sreams = await providerContext.extractors.gdFlixExtracter(
|
||||
newLink,
|
||||
signal
|
||||
|
||||
Reference in New Issue
Block a user