mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
minify again
This commit is contained in:
64
dist/hdhub4u/catalog.js
vendored
64
dist/hdhub4u/catalog.js
vendored
@@ -1,63 +1 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalog = void 0;
|
||||
exports.catalog = [
|
||||
{
|
||||
title: "Latest",
|
||||
filter: "",
|
||||
},
|
||||
{
|
||||
title: "Web Series",
|
||||
filter: "/category/web-series",
|
||||
},
|
||||
{
|
||||
title: "Hollywood ",
|
||||
filter: "/category/hollywood-movies",
|
||||
},
|
||||
{
|
||||
title: "South Movies",
|
||||
filter: "/category/south-hindi-movies",
|
||||
},
|
||||
];
|
||||
exports.genres = [
|
||||
{
|
||||
title: "Action",
|
||||
filter: "/category/action",
|
||||
},
|
||||
{
|
||||
title: "Crime",
|
||||
filter: "/category/crime",
|
||||
},
|
||||
{
|
||||
title: "Comedy",
|
||||
filter: "/category/comedy",
|
||||
},
|
||||
{
|
||||
title: "Drama",
|
||||
filter: "/category/drama",
|
||||
},
|
||||
{
|
||||
title: "Horror",
|
||||
filter: "/category/horror",
|
||||
},
|
||||
{
|
||||
title: "Family",
|
||||
filter: "/category/family",
|
||||
},
|
||||
{
|
||||
title: "Sci-Fi",
|
||||
filter: "/category/sifi",
|
||||
},
|
||||
{
|
||||
title: "Thriller",
|
||||
filter: "/category/triller",
|
||||
},
|
||||
{
|
||||
title: "Romance",
|
||||
filter: "/category/romance",
|
||||
},
|
||||
{
|
||||
title: "Fight",
|
||||
filter: "/category/fight",
|
||||
},
|
||||
];
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.genres=exports.catalog=void 0,exports.catalog=[{title:"Latest",filter:""},{title:"Web Series",filter:"/category/web-series"},{title:"Hollywood ",filter:"/category/hollywood-movies"},{title:"South Movies",filter:"/category/south-hindi-movies"}],exports.genres=[{title:"Action",filter:"/category/action"},{title:"Crime",filter:"/category/crime"},{title:"Comedy",filter:"/category/comedy"},{title:"Drama",filter:"/category/drama"},{title:"Horror",filter:"/category/horror"},{title:"Family",filter:"/category/family"},{title:"Sci-Fi",filter:"/category/sifi"},{title:"Thriller",filter:"/category/triller"},{title:"Romance",filter:"/category/romance"},{title:"Fight",filter:"/category/fight"}];
|
||||
128
dist/hdhub4u/meta.js
vendored
128
dist/hdhub4u/meta.js
vendored
@@ -1,127 +1 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const hdbHeaders = {
|
||||
Cookie: "xla=s4t",
|
||||
Referer: "https://google.com",
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0",
|
||||
};
|
||||
const getMeta = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) {
|
||||
var _b;
|
||||
try {
|
||||
const { axios, cheerio } = providerContext;
|
||||
const url = link;
|
||||
const res = yield axios.get(url, { headers: hdbHeaders });
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const container = $(".page-body");
|
||||
const imdbId = ((_b = container
|
||||
.find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])')
|
||||
.attr("href")) === null || _b === void 0 ? void 0 : _b.split("/")[4]) || "";
|
||||
const title = container
|
||||
.find('h2[data-ved="2ahUKEwjL0NrBk4vnAhWlH7cAHRCeAlwQ3B0oATAfegQIFBAM"],h2[data-ved="2ahUKEwiP0pGdlermAhUFYVAKHV8tAmgQ3B0oATAZegQIDhAM"]')
|
||||
.text();
|
||||
const type = title.toLocaleLowerCase().includes("season")
|
||||
? "series"
|
||||
: "movie";
|
||||
const synopsis = container
|
||||
.find('strong:contains("DESCRIPTION")')
|
||||
.parent()
|
||||
.text()
|
||||
.replace("DESCRIPTION:", "");
|
||||
const image = container.find('img[decoding="async"]').attr("src") || "";
|
||||
// Links
|
||||
const links = [];
|
||||
const directLink = [];
|
||||
// direct link type
|
||||
$('strong:contains("EPiSODE")').map((i, element) => {
|
||||
const epTitle = $(element).parent().parent().text();
|
||||
const episodesLink = $(element)
|
||||
.parent()
|
||||
.parent()
|
||||
.parent()
|
||||
.next()
|
||||
.next()
|
||||
.find("a")
|
||||
.attr("href") ||
|
||||
$(element).parent().parent().parent().next().find("a").attr("href");
|
||||
if (episodesLink && episodesLink) {
|
||||
directLink.push({
|
||||
title: epTitle,
|
||||
link: episodesLink,
|
||||
});
|
||||
}
|
||||
});
|
||||
if (directLink.length === 0) {
|
||||
container.find('a:contains("EPiSODE")').map((i, element) => {
|
||||
const epTitle = $(element).text();
|
||||
const episodesLink = $(element).attr("href");
|
||||
if (episodesLink) {
|
||||
directLink.push({
|
||||
title: epTitle.toLocaleUpperCase(),
|
||||
link: episodesLink,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
if (directLink.length > 0) {
|
||||
links.push({
|
||||
title: title,
|
||||
directLinks: directLink,
|
||||
});
|
||||
}
|
||||
if (directLink.length === 0) {
|
||||
container
|
||||
.find('a:contains("480"),a:contains("720"),a:contains("1080"),a:contains("2160"),a:contains("4K")')
|
||||
.map((i, element) => {
|
||||
var _a;
|
||||
const quality = ((_a = $(element)
|
||||
.text()
|
||||
.match(/\b(480p|720p|1080p|2160p)\b/i)) === null || _a === void 0 ? void 0 : _a[0]) || "";
|
||||
const movieLinks = $(element).attr("href");
|
||||
const title = $(element).text();
|
||||
if (movieLinks) {
|
||||
links.push({
|
||||
directLinks: [
|
||||
{ link: movieLinks, title: "Movie", type: "movie" },
|
||||
],
|
||||
quality: quality,
|
||||
title: title,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// console.log('drive meta', title, synopsis, image, imdbId, type, links);
|
||||
return {
|
||||
title,
|
||||
synopsis,
|
||||
image,
|
||||
imdbId,
|
||||
type,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const hdbHeaders={Cookie:"xla=s4t",Referer:"https://google.com","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0"},getMeta=function(_a){return __awaiter(this,arguments,void 0,function*({link:link,providerContext:providerContext}){var _b;try{const{axios:axios,cheerio:cheerio}=providerContext,url=link,data=(yield axios.get(url,{headers:hdbHeaders})).data,$=cheerio.load(data),container=$(".page-body"),imdbId=(null===(_b=container.find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])').attr("href"))||void 0===_b?void 0:_b.split("/")[4])||"",title=container.find('h2[data-ved="2ahUKEwjL0NrBk4vnAhWlH7cAHRCeAlwQ3B0oATAfegQIFBAM"],h2[data-ved="2ahUKEwiP0pGdlermAhUFYVAKHV8tAmgQ3B0oATAZegQIDhAM"]').text(),type=title.toLocaleLowerCase().includes("season")?"series":"movie",synopsis=container.find('strong:contains("DESCRIPTION")').parent().text().replace("DESCRIPTION:",""),image=container.find('img[decoding="async"]').attr("src")||"",links=[],directLink=[];return $('strong:contains("EPiSODE")').map((i,element)=>{const epTitle=$(element).parent().parent().text(),episodesLink=$(element).parent().parent().parent().next().next().find("a").attr("href")||$(element).parent().parent().parent().next().find("a").attr("href");episodesLink&&episodesLink&&directLink.push({title:epTitle,link:episodesLink})}),0===directLink.length&&container.find('a:contains("EPiSODE")').map((i,element)=>{const epTitle=$(element).text(),episodesLink=$(element).attr("href");episodesLink&&directLink.push({title:epTitle.toLocaleUpperCase(),link:episodesLink})}),directLink.length>0&&links.push({title:title,directLinks:directLink}),0===directLink.length&&container.find('a:contains("480"),a:contains("720"),a:contains("1080"),a:contains("2160"),a:contains("4K")').map((i,element)=>{var _a;const quality=(null===(_a=$(element).text().match(/\b(480p|720p|1080p|2160p)\b/i))||void 0===_a?void 0:_a[0])||"",movieLinks=$(element).attr("href"),title=$(element).text();movieLinks&&links.push({directLinks:[{link:movieLinks,title:"Movie",type:"movie"}],quality:quality,title:title})}),{title:title,synopsis:synopsis,image:image,imdbId:imdbId,type:type,linkList:links}}catch(err){return{title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]}}})};exports.getMeta=getMeta;
|
||||
69
dist/hdhub4u/posts.js
vendored
69
dist/hdhub4u/posts.js
vendored
@@ -1,68 +1 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const hdbHeaders = {
|
||||
Cookie: "xla=s4t",
|
||||
Referer: "https://google.com",
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0",
|
||||
};
|
||||
const getPosts = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ filter, page, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const baseUrl = yield getBaseUrl("hdhub");
|
||||
const url = `${baseUrl + filter}/page/${page}/`;
|
||||
return posts({ url, signal, providerContext });
|
||||
});
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const baseUrl = yield getBaseUrl("hdhub");
|
||||
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
|
||||
return posts({ url, signal, providerContext });
|
||||
});
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
function posts(_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ url, signal, providerContext, }) {
|
||||
const { cheerio } = providerContext;
|
||||
try {
|
||||
const res = yield fetch(url, {
|
||||
headers: hdbHeaders,
|
||||
signal,
|
||||
});
|
||||
const data = yield res.text();
|
||||
const $ = cheerio.load(data);
|
||||
const catalog = [];
|
||||
$(".recent-movies")
|
||||
.children()
|
||||
.map((i, element) => {
|
||||
const title = $(element).find("figure").find("img").attr("alt");
|
||||
const link = $(element).find("a").attr("href");
|
||||
const image = $(element).find("figure").find("img").attr("src");
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title.replace("Download", "").trim(),
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("hdhubGetPosts error ", err);
|
||||
return [];
|
||||
}
|
||||
});
|
||||
}
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSearchPosts=exports.getPosts=void 0;const hdbHeaders={Cookie:"xla=s4t",Referer:"https://google.com","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0"},getPosts=function(_a){return __awaiter(this,arguments,void 0,function*({filter:filter,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl}=providerContext;return posts({url:`${(yield getBaseUrl("hdhub"))+filter}/page/${page}/`,signal:signal,providerContext:providerContext})})};exports.getPosts=getPosts;const getSearchPosts=function(_a){return __awaiter(this,arguments,void 0,function*({searchQuery:searchQuery,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl}=providerContext;return posts({url:`${yield getBaseUrl("hdhub")}/page/${page}/?s=${searchQuery}`,signal:signal,providerContext:providerContext})})};function posts(_a){return __awaiter(this,arguments,void 0,function*({url:url,signal:signal,providerContext:providerContext}){const{cheerio:cheerio}=providerContext;try{const res=yield fetch(url,{headers:hdbHeaders,signal:signal}),data=yield res.text(),$=cheerio.load(data),catalog=[];return $(".recent-movies").children().map((i,element)=>{const title=$(element).find("figure").find("img").attr("alt"),link=$(element).find("a").attr("href"),image=$(element).find("figure").find("img").attr("src");title&&link&&image&&catalog.push({title:title.replace("Download","").trim(),link:link,image:image})}),catalog}catch(err){return[]}})}exports.getSearchPosts=getSearchPosts;
|
||||
165
dist/hdhub4u/stream.js
vendored
165
dist/hdhub4u/stream.js
vendored
@@ -1,164 +1 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = getStream;
|
||||
exports.getRedirectLinks = getRedirectLinks;
|
||||
exports.decodeString = decodeString;
|
||||
function getStream(_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ link, signal, providerContext, }) {
|
||||
var _b, _c, _d, _e;
|
||||
const { axios, cheerio, extractors, commonHeaders: headers, } = providerContext;
|
||||
const { hubcloudExtracter } = extractors;
|
||||
let hubdriveLink = "";
|
||||
if (link.includes("hubdrive")) {
|
||||
const hubdriveRes = yield axios.get(link, { headers, signal });
|
||||
const hubdriveText = hubdriveRes.data;
|
||||
const $ = cheerio.load(hubdriveText);
|
||||
hubdriveLink =
|
||||
$(".btn.btn-primary.btn-user.btn-success1.m-1").attr("href") || link;
|
||||
}
|
||||
else {
|
||||
const res = yield axios.get(link, { headers, signal });
|
||||
const text = res.data;
|
||||
const encryptedString = (_d = (_c = (_b = text.split("s('o','")) === null || _b === void 0 ? void 0 : _b[1]) === null || _c === void 0 ? void 0 : _c.split("',180")) === null || _d === void 0 ? void 0 : _d[0];
|
||||
const decodedString = decodeString(encryptedString);
|
||||
link = atob(decodedString === null || decodedString === void 0 ? void 0 : decodedString.o);
|
||||
const redirectLink = yield getRedirectLinks(link, signal, headers);
|
||||
const redirectLinkRes = yield axios.get(redirectLink, { headers, signal });
|
||||
const redirectLinkText = redirectLinkRes.data;
|
||||
const $ = cheerio.load(redirectLinkText);
|
||||
hubdriveLink =
|
||||
$('h3:contains("1080p")').find("a").attr("href") ||
|
||||
redirectLinkText.match(/href="(https:\/\/hubcloud\.[^\/]+\/drive\/[^"]+)"/)[1];
|
||||
if (hubdriveLink.includes("hubdrive")) {
|
||||
const hubdriveRes = yield axios.get(hubdriveLink, { headers, signal });
|
||||
const hubdriveText = hubdriveRes.data;
|
||||
const $$ = cheerio.load(hubdriveText);
|
||||
hubdriveLink =
|
||||
$$(".btn.btn-primary.btn-user.btn-success1.m-1").attr("href") ||
|
||||
hubdriveLink;
|
||||
}
|
||||
}
|
||||
const hubdriveLinkRes = yield axios.get(hubdriveLink, { headers, signal });
|
||||
const hubcloudText = hubdriveLinkRes.data;
|
||||
const hubcloudLink = ((_e = hubcloudText.match(/<META HTTP-EQUIV="refresh" content="0; url=([^"]+)">/i)) === null || _e === void 0 ? void 0 : _e[1]) || hubdriveLink;
|
||||
try {
|
||||
return yield hubcloudExtracter(hubcloudLink, signal);
|
||||
}
|
||||
catch (error) {
|
||||
console.log("hd hub 4 getStream error: ", error);
|
||||
return [];
|
||||
}
|
||||
});
|
||||
}
|
||||
const encode = function (value) {
|
||||
return btoa(value.toString());
|
||||
};
|
||||
const decode = function (value) {
|
||||
if (value === undefined) {
|
||||
return "";
|
||||
}
|
||||
return atob(value.toString());
|
||||
};
|
||||
const pen = function (value) {
|
||||
return value.replace(/[a-zA-Z]/g, function (_0x1a470e) {
|
||||
return String.fromCharCode((_0x1a470e <= "Z" ? 90 : 122) >=
|
||||
(_0x1a470e = _0x1a470e.charCodeAt(0) + 13)
|
||||
? _0x1a470e
|
||||
: _0x1a470e - 26);
|
||||
});
|
||||
};
|
||||
const abortableTimeout = (ms, { signal } = {}) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (signal && signal.aborted) {
|
||||
return reject(new Error("Aborted"));
|
||||
}
|
||||
const timer = setTimeout(resolve, ms);
|
||||
if (signal) {
|
||||
signal.addEventListener("abort", () => {
|
||||
clearTimeout(timer);
|
||||
reject(new Error("Aborted"));
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
function getRedirectLinks(link, signal, headers) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
const res = yield fetch(link, { headers, signal });
|
||||
const resText = yield res.text();
|
||||
var regex = /ck\('_wp_http_\d+','([^']+)'/g;
|
||||
var combinedString = "";
|
||||
var match;
|
||||
while ((match = regex.exec(resText)) !== null) {
|
||||
// console.log(match[1]);
|
||||
combinedString += match[1];
|
||||
}
|
||||
// console.log(decode(combinedString));
|
||||
const decodedString = decode(pen(decode(decode(combinedString))));
|
||||
// console.log(decodedString);
|
||||
const data = JSON.parse(decodedString);
|
||||
console.log(data);
|
||||
const token = encode(data === null || data === void 0 ? void 0 : data.data);
|
||||
const blogLink = (data === null || data === void 0 ? void 0 : data.wp_http1) + "?re=" + token;
|
||||
// abort timeout on signal
|
||||
let wait = abortableTimeout((Number(data === null || data === void 0 ? void 0 : data.total_time) + 3) * 1000, {
|
||||
signal,
|
||||
});
|
||||
yield wait;
|
||||
console.log("blogLink", blogLink);
|
||||
let vcloudLink = "Invalid Request";
|
||||
while (vcloudLink.includes("Invalid Request")) {
|
||||
const blogRes = yield fetch(blogLink, { headers, signal });
|
||||
const blogResText = (yield blogRes.text());
|
||||
if (blogResText.includes("Invalid Request")) {
|
||||
console.log(blogResText);
|
||||
}
|
||||
else {
|
||||
vcloudLink = blogResText.match(/var reurl = "([^"]+)"/) || "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
// console.log('vcloudLink', vcloudLink?.[1]);
|
||||
return blogLink || link;
|
||||
}
|
||||
catch (err) {
|
||||
console.log("Error in getRedirectLinks", err);
|
||||
return link;
|
||||
}
|
||||
});
|
||||
}
|
||||
function rot13(str) {
|
||||
return str.replace(/[a-zA-Z]/g, function (char) {
|
||||
const charCode = char.charCodeAt(0);
|
||||
const isUpperCase = char <= "Z";
|
||||
const baseCharCode = isUpperCase ? 65 : 97;
|
||||
return String.fromCharCode(((charCode - baseCharCode + 13) % 26) + baseCharCode);
|
||||
});
|
||||
}
|
||||
function decodeString(encryptedString) {
|
||||
try {
|
||||
// First base64 decode
|
||||
let decoded = atob(encryptedString);
|
||||
// Second base64 decode
|
||||
decoded = atob(decoded);
|
||||
// ROT13 decode
|
||||
decoded = rot13(decoded);
|
||||
// Third base64 decode
|
||||
decoded = atob(decoded);
|
||||
// Parse JSON
|
||||
return JSON.parse(decoded);
|
||||
}
|
||||
catch (error) {
|
||||
console.error("Error decoding string:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};function getStream(_a){return __awaiter(this,arguments,void 0,function*({link:link,signal:signal,providerContext:providerContext}){var _b,_c,_d,_e;const{axios:axios,cheerio:cheerio,extractors:extractors,commonHeaders:headers}=providerContext,{hubcloudExtracter:hubcloudExtracter}=extractors;let hubdriveLink="";if(link.includes("hubdrive")){const hubdriveText=(yield axios.get(link,{headers:headers,signal:signal})).data;hubdriveLink=cheerio.load(hubdriveText)(".btn.btn-primary.btn-user.btn-success1.m-1").attr("href")||link}else{const decodedString=decodeString(null===(_d=null===(_c=null===(_b=(yield axios.get(link,{headers:headers,signal:signal})).data.split("s('o','"))||void 0===_b?void 0:_b[1])||void 0===_c?void 0:_c.split("',180"))||void 0===_d?void 0:_d[0]);link=atob(null==decodedString?void 0:decodedString.o);const redirectLink=yield getRedirectLinks(link,signal,headers),redirectLinkText=(yield axios.get(redirectLink,{headers:headers,signal:signal})).data;if(hubdriveLink=cheerio.load(redirectLinkText)('h3:contains("1080p")').find("a").attr("href")||redirectLinkText.match(/href="(https:\/\/hubcloud\.[^\/]+\/drive\/[^"]+)"/)[1],hubdriveLink.includes("hubdrive")){const hubdriveText=(yield axios.get(hubdriveLink,{headers:headers,signal:signal})).data;hubdriveLink=cheerio.load(hubdriveText)(".btn.btn-primary.btn-user.btn-success1.m-1").attr("href")||hubdriveLink}}const hubcloudLink=(null===(_e=(yield axios.get(hubdriveLink,{headers:headers,signal:signal})).data.match(/<META HTTP-EQUIV="refresh" content="0; url=([^"]+)">/i))||void 0===_e?void 0:_e[1])||hubdriveLink;try{return yield hubcloudExtracter(hubcloudLink,signal)}catch(error){return[]}})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStream=getStream,exports.getRedirectLinks=getRedirectLinks,exports.decodeString=decodeString;const encode=function(value){return btoa(value.toString())},decode=function(value){return void 0===value?"":atob(value.toString())},pen=function(value){return value.replace(/[a-zA-Z]/g,function(_0x1a470e){return String.fromCharCode((_0x1a470e<="Z"?90:122)>=(_0x1a470e=_0x1a470e.charCodeAt(0)+13)?_0x1a470e:_0x1a470e-26)})},abortableTimeout=(ms,{signal:signal}={})=>new Promise((resolve,reject)=>{if(signal&&signal.aborted)return reject(new Error("Aborted"));const timer=setTimeout(resolve,ms);signal&&signal.addEventListener("abort",()=>{clearTimeout(timer),reject(new Error("Aborted"))})});function getRedirectLinks(link,signal,headers){return __awaiter(this,void 0,void 0,function*(){try{const res=yield fetch(link,{headers:headers,signal:signal}),resText=yield res.text();for(var match,regex=/ck\('_wp_http_\d+','([^']+)'/g,combinedString="";null!==(match=regex.exec(resText));)combinedString+=match[1];const decodedString=decode(pen(decode(decode(combinedString)))),data=JSON.parse(decodedString),token=encode(null==data?void 0:data.data),blogLink=(null==data?void 0:data.wp_http1)+"?re="+token;let wait=abortableTimeout(1e3*(Number(null==data?void 0:data.total_time)+3),{signal:signal});yield wait;let vcloudLink="Invalid Request";for(;vcloudLink.includes("Invalid Request");){const blogRes=yield fetch(blogLink,{headers:headers,signal:signal}),blogResText=yield blogRes.text();if(!blogResText.includes("Invalid Request")){vcloudLink=blogResText.match(/var reurl = "([^"]+)"/)||"";break}}return blogLink||link}catch(err){return link}})}function rot13(str){return str.replace(/[a-zA-Z]/g,function(char){const charCode=char.charCodeAt(0),baseCharCode=char<="Z"?65:97;return String.fromCharCode((charCode-baseCharCode+13)%26+baseCharCode)})}function decodeString(encryptedString){try{let decoded=atob(encryptedString);return decoded=atob(decoded),decoded=rot13(decoded),decoded=atob(decoded),JSON.parse(decoded)}catch(error){return null}}
|
||||
Reference in New Issue
Block a user