This commit is contained in:
himanshu8443
2025-06-18 13:39:45 +05:30
parent a70757312e
commit c42d435bcc
10 changed files with 56 additions and 86 deletions

View File

@@ -1,16 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.moviesApi = void 0;
const catalog_1 = require("../autoEmbed/catalog");
const module_1 = require();
";;
const posts_1 = require("../autoEmbed/posts");
const stream_1 = require("./stream");
exports.moviesApi = {
catalog: catalog_1.allCatalog,
genres: catalog_1.allGenresList,
GetMetaData: module_1.allGetInfo,
GetHomePosts: posts_1.allGetPost,
GetStream: stream_1.mpGetStream,
GetSearchPosts: posts_1.allGetSearchPosts,
};

View File

@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.mpGetStream = void 0;
const types_1 = require("../types");
const mpGetStream = function (_a) {
return __awaiter(this, arguments, void 0, function* ({ link: id, type, providerContext, }) {
var _b, _c;
@@ -18,8 +17,8 @@ const mpGetStream = function (_a) {
const { getBaseUrl, cheerio } = providerContext;
const streams = [];
const { season, episode, tmdbId } = JSON.parse(id);
const baseUrl = yield getBaseUrl('moviesapi');
const link = type === 'movie'
const baseUrl = yield getBaseUrl("moviesapi");
const link = type === "movie"
? `${baseUrl}/movie/${tmdbId}`
: `${baseUrl}/tv/${tmdbId}-${season}-${episode}`;
const res = yield fetch(link, {
@@ -29,63 +28,61 @@ const mpGetStream = function (_a) {
});
const baseData = yield res.text();
const $ = cheerio.load(baseData);
const embededUrl = $('iframe').attr('src') || '';
const embededUrl = $("iframe").attr("src") || "";
const response = yield fetch(embededUrl, {
credentials: 'omit',
credentials: "omit",
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0',
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.5',
'Alt-Used': 'w1.moviesapi.club',
'Upgrade-Insecure-Requests': '1',
'Sec-Fetch-Dest': 'document',
'Sec-Fetch-Mode': 'navigate',
'Sec-Fetch-Site': 'none',
'Sec-Fetch-User': '?1',
Pragma: 'no-cache',
'Cache-Control': 'no-cache',
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0",
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Alt-Used": "w1.moviesapi.club",
"Upgrade-Insecure-Requests": "1",
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-Site": "none",
"Sec-Fetch-User": "?1",
Pragma: "no-cache",
"Cache-Control": "no-cache",
referer: baseUrl,
},
referrer: baseUrl,
method: 'GET',
mode: 'cors',
method: "GET",
mode: "cors",
});
const data2 = yield response.text();
// Extract the encrypted content
const contents = ((_b = data2.match(/const\s+Encrypted\s*=\s*['"]({.*})['"]/)) === null || _b === void 0 ? void 0 : _b[1]) || '';
const contents = ((_b = data2.match(/const\s+Encrypted\s*=\s*['"]({.*})['"]/)) === null || _b === void 0 ? void 0 : _b[1]) || "";
if (embededUrl) {
const res2 = yield fetch('https://ext.8man.me/api/decrypt?passphrase==JV[t}{trEV=Ilh5', {
method: 'POST',
const res2 = yield fetch("https://ext.8man.me/api/decrypt?passphrase==JV[t}{trEV=Ilh5", {
method: "POST",
body: contents,
});
const finalData = yield res2.json();
const subtitle = (_c = finalData === null || finalData === void 0 ? void 0 : finalData.subtitles) === null || _c === void 0 ? void 0 : _c.map((sub) => {
var _a;
return ({
title: (sub === null || sub === void 0 ? void 0 : sub.label) || 'Unknown',
title: (sub === null || sub === void 0 ? void 0 : sub.label) || "Unknown",
language: sub === null || sub === void 0 ? void 0 : sub.label,
type: ((_a = sub === null || sub === void 0 ? void 0 : sub.file) === null || _a === void 0 ? void 0 : _a.includes('.vtt'))
? types_1.TextTrackType.VTT
: types_1.TextTrackType.SUBRIP,
type: ((_a = sub === null || sub === void 0 ? void 0 : sub.file) === null || _a === void 0 ? void 0 : _a.includes(".vtt")) ? "text/vtt" : "application/x-subrip",
uri: sub === null || sub === void 0 ? void 0 : sub.file,
});
});
streams.push({
server: 'vidstreaming ',
type: 'm3u8',
server: "vidstreaming ",
type: "m3u8",
subtitles: subtitle,
link: finalData === null || finalData === void 0 ? void 0 : finalData.videoUrl,
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0',
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0",
Referer: baseUrl,
Origin: baseUrl,
Accept: '*/*',
'Accept-Language': 'en-US,en;q=0.5',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'cross-site',
Pragma: 'no-cache',
'Cache-Control': 'no-cache',
Accept: "*/*",
"Accept-Language": "en-US,en;q=0.5",
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "cross-site",
Pragma: "no-cache",
"Cache-Control": "no-cache",
},
});
}