This commit is contained in:
himanshu8443
2025-07-11 19:17:23 +05:30
parent 6ca69cf93b
commit 13f71510d5
139 changed files with 139 additions and 10578 deletions

104
dist/vega/stream.js vendored
View File

@@ -1,103 +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;
const 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",
"Cache-Control": "no-store",
"Accept-Language": "en-US,en;q=0.9",
DNT: "1",
"sec-ch-ua": '"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',
"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",
Cookie: "_lscache_vary=62abf8b96599676eb8ec211cffaeb8ff; ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=n4Y1XTKZ5TfIMBNQuAXzerwKpx0U35KoOm3imfT0GpU-1732097818-1.2.1.1-ZeAnEu.8D9TSZHYDoj7vwo1A1rpdKl304ZpaBn_QbAQOr211JFAb7.JRQU3EL2eIy1Dfl8HhYvH7_259.22lUz8gbchHcQ8hvfuQXMtFMCbqDBLzjNUZa9stuk.39l28IcPhH9Z2szsf3SGtNI1sAfo66Djt7sOReLK3lHw9UkJp7BdGqt6a2X9qAc8EsAI3lE480Tmt0fkHv14Oc30LSbPB_WwFmiqAki2W.Gv9hV7TN_QBFESleTDlXd.6KGflfd4.KwWF7rpSRo_cgoc9ALLLIafpxHVbe7_g5r7zvpml_Pj8fEL75fw.1GBuy16bciHBuB8s_kahuJYUnhtQFFgfTQl8_Gn6KeovBWx.PJ7nFv5sklHUfAyBVq3t30xKe8ZDydsQ_G.yipfj_In5GmmWcXGb6E4.bioDOwW_sKLtxwdTQt7Nu.RkILX_mKvXNpyLqflIVj8G7X5E8I.unw",
"Upgrade-Insecure-Requests": "1",
"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",
};
function getStream(_a) {
return __awaiter(this, arguments, void 0, function* ({ link, type, signal, providerContext, }) {
var _b, _c, _d, _e;
const { axios, cheerio, extractors } = providerContext;
const { hubcloudExtracter } = extractors;
try {
const streamLinks = [];
console.log("dotlink", link);
if (type === "movie") {
// vlink
const dotlinkRes = yield 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]);
link = vlink[1];
// filepress link
try {
const $ = cheerio.load(dotlinkText);
const filepressLink = $('.btn.btn-sm.btn-outline[style="background:linear-gradient(135deg,rgb(252,185,0) 0%,rgb(0,0,0)); color: #fdf8f2;"]')
.parent()
.attr("href");
// console.log('filepressLink', filepressLink);
const filepressID = filepressLink === null || filepressLink === void 0 ? void 0 : filepressLink.split("/").pop();
const filepressBaseUrl = filepressLink === null || filepressLink === void 0 ? void 0 : filepressLink.split("/").slice(0, -2).join("/");
// console.log('filepressID', filepressID);
// console.log('filepressBaseUrl', filepressBaseUrl);
const filepressTokenRes = yield axios.post(filepressBaseUrl + "/api/file/downlaod/", {
id: filepressID,
method: "indexDownlaod",
captchaValue: null,
}, {
headers: {
"Content-Type": "application/json",
Referer: filepressBaseUrl,
},
});
// console.log('filepressTokenRes', filepressTokenRes.data);
if ((_b = filepressTokenRes.data) === null || _b === void 0 ? void 0 : _b.status) {
const filepressToken = (_c = filepressTokenRes.data) === null || _c === void 0 ? void 0 : _c.data;
const filepressStreamLink = yield axios.post(filepressBaseUrl + "/api/file/downlaod2/", {
id: filepressToken,
method: "indexDownlaod",
captchaValue: null,
}, {
headers: {
"Content-Type": "application/json",
Referer: filepressBaseUrl,
},
});
// console.log('filepressStreamLink', filepressStreamLink.data);
streamLinks.push({
server: "filepress",
link: (_e = (_d = filepressStreamLink.data) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e[0],
type: "mkv",
});
}
}
catch (error) {
console.log("filepress error: ");
// console.error(error);
}
}
return yield hubcloudExtracter(link, signal);
}
catch (error) {
console.log("getStream error: ", error);
if (error.message.includes("Aborted")) {
}
else {
}
return [];
}
});
}
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))(function(o,i){function c(e){try{r(n.next(e))}catch(e){i(e)}}function l(e){try{r(n.throw(e))}catch(e){i(e)}}function r(e){var t;e.done?o(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(c,l)}r((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStream=getStream;const 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","Cache-Control":"no-store","Accept-Language":"en-US,en;q=0.9",DNT:"1","sec-ch-ua":'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',"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",Cookie:"_lscache_vary=62abf8b96599676eb8ec211cffaeb8ff; ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=n4Y1XTKZ5TfIMBNQuAXzerwKpx0U35KoOm3imfT0GpU-1732097818-1.2.1.1-ZeAnEu.8D9TSZHYDoj7vwo1A1rpdKl304ZpaBn_QbAQOr211JFAb7.JRQU3EL2eIy1Dfl8HhYvH7_259.22lUz8gbchHcQ8hvfuQXMtFMCbqDBLzjNUZa9stuk.39l28IcPhH9Z2szsf3SGtNI1sAfo66Djt7sOReLK3lHw9UkJp7BdGqt6a2X9qAc8EsAI3lE480Tmt0fkHv14Oc30LSbPB_WwFmiqAki2W.Gv9hV7TN_QBFESleTDlXd.6KGflfd4.KwWF7rpSRo_cgoc9ALLLIafpxHVbe7_g5r7zvpml_Pj8fEL75fw.1GBuy16bciHBuB8s_kahuJYUnhtQFFgfTQl8_Gn6KeovBWx.PJ7nFv5sklHUfAyBVq3t30xKe8ZDydsQ_G.yipfj_In5GmmWcXGb6E4.bioDOwW_sKLtxwdTQt7Nu.RkILX_mKvXNpyLqflIVj8G7X5E8I.unw","Upgrade-Insecure-Requests":"1","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"};function getStream(e){return __awaiter(this,arguments,void 0,function*({link:e,type:t,signal:a,providerContext:n}){var o,i,c,l;const{axios:r,cheerio:d,extractors:s}=n,{hubcloudExtracter:p}=s;try{const n=[];if("movie"===t){const t=(yield r(`${e}`,{headers:headers})).data;e=(t.match(/<a\s+href="([^"]*cloud\.[^"]*)"/i)||[])[1];try{const e=d.load(t)('.btn.btn-sm.btn-outline[style="background:linear-gradient(135deg,rgb(252,185,0) 0%,rgb(0,0,0)); color: #fdf8f2;"]').parent().attr("href"),a=null==e?void 0:e.split("/").pop(),s=null==e?void 0:e.split("/").slice(0,-2).join("/"),p=yield r.post(s+"/api/file/downlaod/",{id:a,method:"indexDownlaod",captchaValue:null},{headers:{"Content-Type":"application/json",Referer:s}});if(null===(o=p.data)||void 0===o?void 0:o.status){const e=null===(i=p.data)||void 0===i?void 0:i.data,t=yield r.post(s+"/api/file/downlaod2/",{id:e,method:"indexDownlaod",captchaValue:null},{headers:{"Content-Type":"application/json",Referer:s}});n.push({server:"filepress",link:null===(l=null===(c=t.data)||void 0===c?void 0:c.data)||void 0===l?void 0:l[0],type:"mkv"})}}catch(e){}}return yield p(e,a)}catch(e){return e.message.includes("Aborted"),[]}})}