minify again

This commit is contained in:
himanshu8443
2025-07-13 11:25:52 +05:30
parent 4d450e5be5
commit bd060abce3
139 changed files with 139 additions and 10578 deletions

View File

@@ -1,104 +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 = void 0;
function extractKmhdLink(katlink, providerContext) {
return __awaiter(this, void 0, void 0, function* () {
const { axios } = providerContext;
const res = yield axios.get(katlink);
const data = res.data;
const hubDriveRes = data.match(/hubdrive_res:\s*"([^"]+)"/)[1];
const hubDriveLink = data.match(/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/)[1];
return hubDriveLink + hubDriveRes;
});
}
const getStream = function (_a) {
return __awaiter(this, arguments, void 0, function* ({ link, signal, providerContext, }) {
const { axios, cheerio, extractors } = providerContext;
const { hubcloudExtracter, gdFlixExtracter } = extractors;
const streamLinks = [];
console.log("katGetStream", link);
try {
if (link.includes("gdflix")) {
return yield gdFlixExtracter(link, signal);
}
if (link.includes("kmhd")) {
const hubcloudLink = yield extractKmhdLink(link, providerContext);
return yield hubcloudExtracter(hubcloudLink, signal);
}
if (link.includes("gdflix")) {
// resume link
try {
const resumeDrive = link.replace("/file", "/zfile");
// console.log('resumeDrive', resumeDrive);
const resumeDriveRes = yield axios.get(resumeDrive);
const resumeDriveHtml = resumeDriveRes.data;
const $resumeDrive = cheerio.load(resumeDriveHtml);
const resumeLink = $resumeDrive(".btn-success").attr("href");
console.log("resumeLink", resumeLink);
if (resumeLink) {
streamLinks.push({
server: "ResumeCloud",
link: resumeLink,
type: "mkv",
});
}
}
catch (err) {
console.log("Resume link not found");
}
//instant link
try {
const driveres = yield axios.get(link, { timeout: 10000 });
const $drive = cheerio.load(driveres.data);
const seed = $drive(".btn-danger").attr("href") || "";
const instantToken = seed.split("=")[1];
// console.log('InstantToken', instantToken);
const InstantFromData = new FormData();
InstantFromData.append("keys", instantToken);
const videoSeedUrl = seed.split("/").slice(0, 3).join("/") + "/api";
// console.log('videoSeedUrl', videoSeedUrl);
const instantLinkRes = yield fetch(videoSeedUrl, {
method: "POST",
body: InstantFromData,
headers: {
"x-token": videoSeedUrl,
},
});
const instantLinkData = yield instantLinkRes.json();
console.log("instantLinkData", instantLinkData);
if (instantLinkData.error === false) {
const instantLink = instantLinkData.url;
streamLinks.push({
server: "Gdrive-Instant",
link: instantLink,
type: "mkv",
});
}
else {
console.log("Instant link not found", instantLinkData);
}
}
catch (err) {
console.log("Instant link not found", err);
}
return streamLinks;
}
const stereams = yield hubcloudExtracter(link, signal);
return stereams;
}
catch (error) {
console.log("katgetStream error: ", error);
return [];
}
});
};
exports.getStream = getStream;
"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 extractKmhdLink(katlink,providerContext){return __awaiter(this,void 0,void 0,function*(){const{axios:axios}=providerContext,data=(yield axios.get(katlink)).data,hubDriveRes=data.match(/hubdrive_res:\s*"([^"]+)"/)[1];return data.match(/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/)[1]+hubDriveRes})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStream=void 0;const getStream=function(_a){return __awaiter(this,arguments,void 0,function*({link:link,signal:signal,providerContext:providerContext}){const{axios:axios,cheerio:cheerio,extractors:extractors}=providerContext,{hubcloudExtracter:hubcloudExtracter,gdFlixExtracter:gdFlixExtracter}=extractors,streamLinks=[];try{if(link.includes("gdflix"))return yield gdFlixExtracter(link,signal);if(link.includes("kmhd")){const hubcloudLink=yield extractKmhdLink(link,providerContext);return yield hubcloudExtracter(hubcloudLink,signal)}if(link.includes("gdflix")){try{const resumeDrive=link.replace("/file","/zfile"),resumeDriveHtml=(yield axios.get(resumeDrive)).data,resumeLink=cheerio.load(resumeDriveHtml)(".btn-success").attr("href");resumeLink&&streamLinks.push({server:"ResumeCloud",link:resumeLink,type:"mkv"})}catch(err){}try{const driveres=yield axios.get(link,{timeout:1e4}),seed=cheerio.load(driveres.data)(".btn-danger").attr("href")||"",instantToken=seed.split("=")[1],InstantFromData=new FormData;InstantFromData.append("keys",instantToken);const videoSeedUrl=seed.split("/").slice(0,3).join("/")+"/api",instantLinkRes=yield fetch(videoSeedUrl,{method:"POST",body:InstantFromData,headers:{"x-token":videoSeedUrl}}),instantLinkData=yield instantLinkRes.json();if(!1===instantLinkData.error){const instantLink=instantLinkData.url;streamLinks.push({server:"Gdrive-Instant",link:instantLink,type:"mkv"})}}catch(err){}return streamLinks}return yield hubcloudExtracter(link,signal)}catch(error){return[]}})};exports.getStream=getStream;