fix: update hubcloud extractor logic and bump versions

This commit is contained in:
Himanshu
2026-06-18 10:45:48 +05:30
parent 040912facd
commit bf84ba9a6d
17 changed files with 46 additions and 33 deletions
+17 -4
View File
@@ -5,6 +5,21 @@ const hubcloudDecode = function (value: string) {
return atob(value.toString());
};
const extractUrlFromScript = (html: string): string => {
const doubleAtobMatch = html.match(
/var\s+url\s*=\s*atob\(atob\(['"]([^'"]+)['"]\)\)/,
);
if (doubleAtobMatch?.[1]) {
return atob(atob(doubleAtobMatch[1]));
}
const plainMatch = html.match(/var\s+url\s*=\s*['"]([^'"]+)['"]/);
return (
hubcloudDecode(plainMatch?.[1]?.split("r=")?.[1] ?? "") ||
plainMatch?.[1] ||
""
);
};
const getPixelDrainUrl = (html: string) => {
const match = html.match(/var\s+pxl\s*=\s*['"]([^'"]+)['"];?/i);
return match?.[1] || "";
@@ -44,10 +59,8 @@ export async function hubcloudExtractor(
const vLinkRes = await axios(`${link}`, { headers, signal });
const vLinkText = vLinkRes.data;
const $vLink = cheerio.load(vLinkText);
const vLinkRedirect = vLinkText.match(/var\s+url\s*=\s*'([^']+)';/) || [];
let vcloudLink =
hubcloudDecode(vLinkRedirect[1]?.split("r=")?.[1]) ||
vLinkRedirect[1] ||
extractUrlFromScript(vLinkText) ||
$vLink(".fa-file-download.fa-lg").parent().attr("href") ||
link;
console.log("vcloudLink", vcloudLink);
@@ -62,7 +75,7 @@ export async function hubcloudExtractor(
});
const vcloudText = await vcloudRes.text();
const $ = cheerio.load(vcloudText);
// console.log('vcloudRes', $.text());
// console.log("vcloudRes", $.text());
const linkClass = $(".btn-success.btn-lg.h6,.btn-danger,.btn-secondary");
for (const element of linkClass) {
+1 -1
View File
@@ -37,7 +37,7 @@ export async function getStream({
try {
const streamLinks: Stream[] = [];
console.log("dotlink", link);
if (type === "movie") {
if (type === "movie" && !link.includes("cloud")) {
// vlink
const dotlinkRes = await axios(`${link}`, { headers });
const dotlinkText = dotlinkRes.data;
+2 -2
View File
@@ -37,13 +37,13 @@ export async function getStream({
try {
const streamLinks: Stream[] = [];
console.log("dotlink", link);
if (type === "movie") {
if (type === "movie" && !link.includes("cloud")) {
// vlink
const dotlinkRes = await axios(`${link}`, { headers });
const dotlinkText = dotlinkRes.data;
// console.log('dotlinkText', dotlinkText);
const vlink = dotlinkText.match(/<a\s+href="([^"]*cloud\.[^"]*)"/i) || [];
// console.log('vLink', vlink[1]);
console.log("vLink", vlink[1]);
link = vlink[1];
// filepress link