This commit is contained in:
himanshu8443
2025-06-18 11:42:29 +05:30
parent 490a4bd71d
commit 9621597865
100 changed files with 6898 additions and 5740 deletions

View File

@@ -1,7 +1,17 @@
"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;
const getStream = async ({ link: data, providerContext, }) => {
const getStream = (_a) => __awaiter(void 0, [_a], void 0, function* ({ link: data, providerContext, }) {
var _b, _c;
try {
const { cheerio, commonHeaders: headers, axios } = providerContext;
const streamData = JSON.parse(data);
@@ -15,18 +25,15 @@ const getStream = async ({ link: data, providerContext, }) => {
// const res = await axios.get(url, {headers});
// const postId = res.data.split('\\"postid\\":\\"')[1].split('\\"')[0];
// console.log('rido post id', postId);
const url = streamData?.baseUrl + "/api/" + streamData?.slug;
const url = (streamData === null || streamData === void 0 ? void 0 : streamData.baseUrl) + "/api/" + (streamData === null || streamData === void 0 ? void 0 : streamData.slug);
console.log("rido url", url);
const res = await axios.get(url, { headers });
const iframe = res.data.data?.[0]?.url;
const res = yield axios.get(url, { headers });
const iframe = (_c = (_b = res.data.data) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.url;
console.log("rido data", iframe);
const iframeUrl = iframe.split('src="')[1].split('"')[0];
console.log("rido iframeUrl", iframeUrl);
const iframeRes = await axios.get(iframeUrl, {
headers: {
...headers,
Referer: streamData?.baseUrl,
},
const iframeRes = yield axios.get(iframeUrl, {
headers: Object.assign(Object.assign({}, headers), { Referer: streamData === null || streamData === void 0 ? void 0 : streamData.baseUrl }),
});
const $ = cheerio.load(iframeRes.data);
const script = $('script:contains("eval")').html();
@@ -50,7 +57,7 @@ const getStream = async ({ link: data, providerContext, }) => {
console.log("rido get stream err", e);
return [];
}
};
});
exports.getStream = getStream;
function unpackJavaScript(packedCode) {
const encodedString = packedCode.split("|aHR")[1].split("|")[0];