diff --git a/dist/autoEmbed/meta.js b/dist/autoEmbed/meta.js index a78d2a1..6349003 100644 --- a/dist/autoEmbed/meta.js +++ b/dist/autoEmbed/meta.js @@ -1,89 +1,99 @@ "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 getMeta = async function ({ link, providerContext, }) { - const axios = providerContext.axios; - try { - console.log("all", link); - const res = await axios.get(link); - const data = res.data; - const meta = { - title: "", - synopsis: "", - image: "", - imdbId: data?.meta?.imdb_id || "", - type: data?.meta?.type || "movie", - }; - const links = []; - let directLinks = []; - let season = new Map(); - if (meta.type === "series") { - data?.meta?.videos?.map((video) => { - if (video?.season <= 0) - return; - if (!season.has(video?.season)) { - season.set(video?.season, []); - } - season.get(video?.season).push({ - title: "Episode " + video?.episode, - type: "series", - link: JSON.stringify({ - title: data?.meta?.name, - imdbId: data?.meta?.imdb_id, - season: video?.id?.split(":")[1], - episode: video?.id?.split(":")[2], - type: data?.meta?.type, - tmdbId: data?.meta?.moviedb_id?.toString() || "", - year: data?.meta?.year, - }), - }); - }); - const keys = Array.from(season.keys()); - keys.sort(); - keys.map((key) => { - directLinks = season.get(key); - links.push({ - title: `Season ${key}`, - directLinks: directLinks, - }); - }); - } - else { - console.log("all meta Mv🔥🔥", meta); - links.push({ - title: data?.meta?.name, - directLinks: [ - { - title: "Movie", - type: "movie", +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { + var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; + const axios = providerContext.axios; + try { + console.log("all", link); + const res = yield axios.get(link); + const data = res.data; + const meta = { + title: "", + synopsis: "", + image: "", + imdbId: ((_b = data === null || data === void 0 ? void 0 : data.meta) === null || _b === void 0 ? void 0 : _b.imdb_id) || "", + type: ((_c = data === null || data === void 0 ? void 0 : data.meta) === null || _c === void 0 ? void 0 : _c.type) || "movie", + }; + const links = []; + let directLinks = []; + let season = new Map(); + if (meta.type === "series") { + (_e = (_d = data === null || data === void 0 ? void 0 : data.meta) === null || _d === void 0 ? void 0 : _d.videos) === null || _e === void 0 ? void 0 : _e.map((video) => { + var _a, _b, _c, _d, _e, _f, _g, _h; + if ((video === null || video === void 0 ? void 0 : video.season) <= 0) + return; + if (!season.has(video === null || video === void 0 ? void 0 : video.season)) { + season.set(video === null || video === void 0 ? void 0 : video.season, []); + } + season.get(video === null || video === void 0 ? void 0 : video.season).push({ + title: "Episode " + (video === null || video === void 0 ? void 0 : video.episode), + type: "series", link: JSON.stringify({ - title: data?.meta?.name, - imdbId: data?.meta?.imdb_id, - season: "", - episode: "", - type: data?.meta?.type, - tmdbId: data?.meta?.moviedb_id?.toString() || "", - year: data?.meta?.year, + title: (_a = data === null || data === void 0 ? void 0 : data.meta) === null || _a === void 0 ? void 0 : _a.name, + imdbId: (_b = data === null || data === void 0 ? void 0 : data.meta) === null || _b === void 0 ? void 0 : _b.imdb_id, + season: (_c = video === null || video === void 0 ? void 0 : video.id) === null || _c === void 0 ? void 0 : _c.split(":")[1], + episode: (_d = video === null || video === void 0 ? void 0 : video.id) === null || _d === void 0 ? void 0 : _d.split(":")[2], + type: (_e = data === null || data === void 0 ? void 0 : data.meta) === null || _e === void 0 ? void 0 : _e.type, + tmdbId: ((_g = (_f = data === null || data === void 0 ? void 0 : data.meta) === null || _f === void 0 ? void 0 : _f.moviedb_id) === null || _g === void 0 ? void 0 : _g.toString()) || "", + year: (_h = data === null || data === void 0 ? void 0 : data.meta) === null || _h === void 0 ? void 0 : _h.year, }), - }, - ], - }); + }); + }); + const keys = Array.from(season.keys()); + keys.sort(); + keys.map((key) => { + directLinks = season.get(key); + links.push({ + title: `Season ${key}`, + directLinks: directLinks, + }); + }); + } + else { + console.log("all meta Mv🔥🔥", meta); + links.push({ + title: (_f = data === null || data === void 0 ? void 0 : data.meta) === null || _f === void 0 ? void 0 : _f.name, + directLinks: [ + { + title: "Movie", + type: "movie", + link: JSON.stringify({ + title: (_g = data === null || data === void 0 ? void 0 : data.meta) === null || _g === void 0 ? void 0 : _g.name, + imdbId: (_h = data === null || data === void 0 ? void 0 : data.meta) === null || _h === void 0 ? void 0 : _h.imdb_id, + season: "", + episode: "", + type: (_j = data === null || data === void 0 ? void 0 : data.meta) === null || _j === void 0 ? void 0 : _j.type, + tmdbId: ((_l = (_k = data === null || data === void 0 ? void 0 : data.meta) === null || _k === void 0 ? void 0 : _k.moviedb_id) === null || _l === void 0 ? void 0 : _l.toString()) || "", + year: (_m = data === null || data === void 0 ? void 0 : data.meta) === null || _m === void 0 ? void 0 : _m.year, + }), + }, + ], + }); + } + return Object.assign(Object.assign({}, meta), { linkList: links }); } - return { - ...meta, - linkList: links, - }; - } - catch (err) { - console.error(err); - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "movie", - linkList: [], - }; - } + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/autoEmbed/posts.js b/dist/autoEmbed/posts.js index 39fa808..ead2e6d 100644 --- a/dist/autoEmbed/posts.js +++ b/dist/autoEmbed/posts.js @@ -1,89 +1,102 @@ "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 getPosts = async function ({ filter, signal, providerContext, }) { - try { - const catalog = []; - const url = "https://cinemeta-catalogs.strem.io" + filter; - console.log("allGetPostUrl", url); - const res = await providerContext.axios.get(url, { - headers: providerContext.commonHeaders, - signal, - }); - const data = res.data; - data?.metas.map((result) => { - const title = result?.name; - const id = result?.imdb_id || result?.id; - const type = result?.type; - const image = result?.poster; - if (id) { - catalog.push({ - title: title, - link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`, - image: image, - }); - } - }); - console.log("catalog", catalog.length); - return catalog; - } - catch (err) { - console.error("AutoEmbed error ", err); - return []; - } -}; -exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, -// providerValue, -signal, providerContext, }) { - try { - if (page > 1) { +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, signal, providerContext, }) { + try { + const catalog = []; + const url = "https://cinemeta-catalogs.strem.io" + filter; + console.log("allGetPostUrl", url); + const res = yield providerContext.axios.get(url, { + headers: providerContext.commonHeaders, + signal, + }); + const data = res.data; + data === null || data === void 0 ? void 0 : data.metas.map((result) => { + const title = result === null || result === void 0 ? void 0 : result.name; + const id = (result === null || result === void 0 ? void 0 : result.imdb_id) || (result === null || result === void 0 ? void 0 : result.id); + const type = result === null || result === void 0 ? void 0 : result.type; + const image = result === null || result === void 0 ? void 0 : result.poster; + if (id) { + catalog.push({ + title: title, + link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`, + image: image, + }); + } + }); + console.log("catalog", catalog.length); + return catalog; + } + catch (err) { + console.error("AutoEmbed error ", err); return []; } - const catalog = []; - const url1 = `https://v3-cinemeta.strem.io/catalog/series/top/search=${encodeURI(searchQuery)}.json`; - const url2 = `https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(searchQuery)}.json`; - const res = await providerContext.axios.get(url1, { - headers: providerContext.commonHeaders, - signal, - }); - const data = res.data; - data?.metas.map((result) => { - const title = result.name || ""; - const id = result?.imdb_id || result?.id; - const image = result?.poster; - const type = result?.type; - if (id) { - catalog.push({ - title: title, - link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`, - image: image, - }); + }); +}; +exports.getPosts = getPosts; +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, + // providerValue, + signal, providerContext, }) { + try { + if (page > 1) { + return []; } - }); - const res2 = await providerContext.axios.get(url2, { - headers: providerContext.commonHeaders, - signal, - }); - const data2 = res2.data; - data2?.metas.map((result) => { - const title = result?.name || ""; - const id = result?.imdb_id || result?.id; - const image = result?.poster; - const type = result?.type; - if (id) { - catalog.push({ - title: title, - link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`, - image: image, - }); - } - }); - return catalog; - } - catch (err) { - console.error("AutoEmbed error ", err); - return []; - } + const catalog = []; + const url1 = `https://v3-cinemeta.strem.io/catalog/series/top/search=${encodeURI(searchQuery)}.json`; + const url2 = `https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(searchQuery)}.json`; + const res = yield providerContext.axios.get(url1, { + headers: providerContext.commonHeaders, + signal, + }); + const data = res.data; + data === null || data === void 0 ? void 0 : data.metas.map((result) => { + const title = result.name || ""; + const id = (result === null || result === void 0 ? void 0 : result.imdb_id) || (result === null || result === void 0 ? void 0 : result.id); + const image = result === null || result === void 0 ? void 0 : result.poster; + const type = result === null || result === void 0 ? void 0 : result.type; + if (id) { + catalog.push({ + title: title, + link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`, + image: image, + }); + } + }); + const res2 = yield providerContext.axios.get(url2, { + headers: providerContext.commonHeaders, + signal, + }); + const data2 = res2.data; + data2 === null || data2 === void 0 ? void 0 : data2.metas.map((result) => { + const title = (result === null || result === void 0 ? void 0 : result.name) || ""; + const id = (result === null || result === void 0 ? void 0 : result.imdb_id) || (result === null || result === void 0 ? void 0 : result.id); + const image = result === null || result === void 0 ? void 0 : result.poster; + const type = result === null || result === void 0 ? void 0 : result.type; + if (id) { + catalog.push({ + title: title, + link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + console.error("AutoEmbed error ", err); + return []; + } + }); }; exports.getSearchPosts = getSearchPosts; diff --git a/dist/autoEmbed/stream.js b/dist/autoEmbed/stream.js index 6a6ea91..9a75bb6 100644 --- a/dist/autoEmbed/stream.js +++ b/dist/autoEmbed/stream.js @@ -1,91 +1,104 @@ "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; exports.getRiveStream = getRiveStream; const types_1 = require("../types"); -const getStream = async ({ link: id, type, providerContext, }) => { +const getStream = (_a) => __awaiter(void 0, [_a], void 0, function* ({ link: id, type, providerContext, }) { try { const streams = []; const { imdbId, season, episode, title, tmdbId, year } = JSON.parse(id); - await getRiveStream(tmdbId, episode, season, type, streams, providerContext); + yield getRiveStream(tmdbId, episode, season, type, streams, providerContext); return streams; } catch (err) { console.error(err); return []; } -}; +}); exports.getStream = getStream; -async function getRiveStream(tmdId, episode, season, type, Streams, providerContext) { - const secret = generateSecretKey(Number(tmdId)); - const servers = [ - "flowcast", - "shadow", - "asiacloud", - "hindicast", - "anime", - "animez", - "guard", - "curve", - "hq", - "ninja", - "alpha", - "kaze", - "zenesis", - "genesis", - "zenith", - "ghost", - "halo", - "kinoecho", - "ee3", - "volt", - "putafilme", - "ophim", - "kage", - ]; - const baseUrl = await providerContext.getBaseUrl("rive"); - const cors = process.env.CORS_PRXY ? process.env.CORS_PRXY + "?url=" : ""; - console.log("CORS: " + cors); - const route = type === "series" - ? `/api/backendfetch?requestID=tvVideoProvider&id=${tmdId}&season=${season}&episode=${episode}&secretKey=${secret}&service=` - : `/api/backendfetch?requestID=movieVideoProvider&id=${tmdId}&secretKey=${secret}&service=`; - const url = cors - ? cors + encodeURIComponent(baseUrl + route) - : baseUrl + route; - await Promise.all(servers.map(async (server) => { - console.log("Rive: " + url + server); - try { - const res = await providerContext.axios.get(url + server, { - timeout: 4000, - headers: providerContext.commonHeaders, - }); - const subtitles = []; - if (res.data?.data?.captions) { - res.data?.data?.captions.forEach((sub) => { - subtitles.push({ - language: sub?.label?.slice(0, 2) || "Und", - uri: sub?.file, - title: sub?.label || "Undefined", - type: sub?.file?.endsWith(".vtt") - ? types_1.TextTrackType.VTT - : types_1.TextTrackType.SUBRIP, +function getRiveStream(tmdId, episode, season, type, Streams, providerContext) { + return __awaiter(this, void 0, void 0, function* () { + const secret = generateSecretKey(Number(tmdId)); + const servers = [ + "flowcast", + "shadow", + "asiacloud", + "hindicast", + "anime", + "animez", + "guard", + "curve", + "hq", + "ninja", + "alpha", + "kaze", + "zenesis", + "genesis", + "zenith", + "ghost", + "halo", + "kinoecho", + "ee3", + "volt", + "putafilme", + "ophim", + "kage", + ]; + const baseUrl = yield providerContext.getBaseUrl("rive"); + const cors = process.env.CORS_PRXY ? process.env.CORS_PRXY + "?url=" : ""; + console.log("CORS: " + cors); + const route = type === "series" + ? `/api/backendfetch?requestID=tvVideoProvider&id=${tmdId}&season=${season}&episode=${episode}&secretKey=${secret}&service=` + : `/api/backendfetch?requestID=movieVideoProvider&id=${tmdId}&secretKey=${secret}&service=`; + const url = cors + ? cors + encodeURIComponent(baseUrl + route) + : baseUrl + route; + yield Promise.all(servers.map((server) => __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c, _d, _e, _f; + console.log("Rive: " + url + server); + try { + const res = yield providerContext.axios.get(url + server, { + timeout: 4000, + headers: providerContext.commonHeaders, + }); + const subtitles = []; + if ((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.captions) { + (_d = (_c = res.data) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.captions.forEach((sub) => { + var _a, _b; + subtitles.push({ + language: ((_a = sub === null || sub === void 0 ? void 0 : sub.label) === null || _a === void 0 ? void 0 : _a.slice(0, 2)) || "Und", + uri: sub === null || sub === void 0 ? void 0 : sub.file, + title: (sub === null || sub === void 0 ? void 0 : sub.label) || "Undefined", + type: ((_b = sub === null || sub === void 0 ? void 0 : sub.file) === null || _b === void 0 ? void 0 : _b.endsWith(".vtt")) + ? types_1.TextTrackType.VTT + : types_1.TextTrackType.SUBRIP, + }); + }); + } + (_f = (_e = res.data) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.sources.forEach((source) => { + Streams.push({ + server: (source === null || source === void 0 ? void 0 : source.source) + "-" + (source === null || source === void 0 ? void 0 : source.quality), + link: source === null || source === void 0 ? void 0 : source.url, + type: (source === null || source === void 0 ? void 0 : source.format) === "hls" ? "m3u8" : "mp4", + quality: source === null || source === void 0 ? void 0 : source.quality, + subtitles: subtitles, }); }); } - res.data?.data?.sources.forEach((source) => { - Streams.push({ - server: source?.source + "-" + source?.quality, - link: source?.url, - type: source?.format === "hls" ? "m3u8" : "mp4", - quality: source?.quality, - subtitles: subtitles, - }); - }); - } - catch (e) { - console.log(e); - } - })); + catch (e) { + console.log(e); + } + }))); + }); } function generateSecretKey(id) { // Array of secret key fragments - updated array from the new implementation diff --git a/dist/cinemaLuxe/episodes.js b/dist/cinemaLuxe/episodes.js index 3371a4d..1216d3e 100644 --- a/dist/cinemaLuxe/episodes.js +++ b/dist/cinemaLuxe/episodes.js @@ -1,64 +1,77 @@ "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.getEpisodes = void 0; -const getEpisodes = async function ({ url, providerContext, }) { - try { - if (!url.includes("luxelinks") || url.includes("luxecinema")) { - const res = await providerContext.axios.get(url, { +const getEpisodes = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) { + var _b; + try { + if (!url.includes("luxelinks") || url.includes("luxecinema")) { + const res = yield providerContext.axios.get(url, { + headers: providerContext.commonHeaders, + }); + const data = res.data; + const encodedLink = (_b = data.match(/"link":"([^"]+)"/)) === null || _b === void 0 ? void 0 : _b[1]; + if (encodedLink) { + url = encodedLink ? atob(encodedLink) : url; + } + else { + const redirectUrlRes = yield fetch("https://ext.8man.me/api/cinemaluxe", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ url }), + }); + const redirectUrl = yield redirectUrlRes.json(); + url = (redirectUrl === null || redirectUrl === void 0 ? void 0 : redirectUrl.redirectUrl) || url; + } + } + const res = yield providerContext.axios.get(url, { headers: providerContext.commonHeaders, }); - const data = res.data; - const encodedLink = data.match(/"link":"([^"]+)"/)?.[1]; - if (encodedLink) { - url = encodedLink ? atob(encodedLink) : url; - } - else { - const redirectUrlRes = await fetch("https://ext.8man.me/api/cinemaluxe", { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ url }), + const html = res.data; + let $ = providerContext.cheerio.load(html); + const episodeLinks = []; + if (url.includes("luxedrive")) { + episodeLinks.push({ + title: "Movie", + link: url, }); - const redirectUrl = await redirectUrlRes.json(); - url = redirectUrl?.redirectUrl || url; + return episodeLinks; } - } - const res = await providerContext.axios.get(url, { - headers: providerContext.commonHeaders, - }); - const html = res.data; - let $ = providerContext.cheerio.load(html); - const episodeLinks = []; - if (url.includes("luxedrive")) { - episodeLinks.push({ - title: "Movie", - link: url, + $("a.maxbutton-4,a.maxbutton,.maxbutton-hubcloud,.ep-simple-button").map((i, element) => { + var _a; + const title = (_a = $(element).text()) === null || _a === void 0 ? void 0 : _a.trim(); + const link = $(element).attr("href"); + if (title && + link && + !title.includes("Batch") && + !title.toLowerCase().includes("zip")) { + episodeLinks.push({ + title: title + .replace(/\(\d{4}\)/, "") + .replace("Download", "Movie") + .replace("⚡", "") + .trim(), + link, + }); + } }); return episodeLinks; } - $("a.maxbutton-4,a.maxbutton,.maxbutton-hubcloud,.ep-simple-button").map((i, element) => { - const title = $(element).text()?.trim(); - const link = $(element).attr("href"); - if (title && - link && - !title.includes("Batch") && - !title.toLowerCase().includes("zip")) { - episodeLinks.push({ - title: title - .replace(/\(\d{4}\)/, "") - .replace("Download", "Movie") - .replace("⚡", "") - .trim(), - link, - }); - } - }); - return episodeLinks; - } - catch (err) { - console.error("cl episode links", err); - return []; - } + catch (err) { + console.error("cl episode links", err); + return []; + } + }); }; exports.getEpisodes = getEpisodes; diff --git a/dist/cinemaLuxe/meta.js b/dist/cinemaLuxe/meta.js index 791e42d..b021b2a 100644 --- a/dist/cinemaLuxe/meta.js +++ b/dist/cinemaLuxe/meta.js @@ -1,64 +1,76 @@ "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 getMeta = async function ({ link, providerContext, }) { - try { - const url = link; - const res = await providerContext.axios.get(url, { - headers: providerContext.commonHeaders, - }); - const data = res.data; - const $ = providerContext.cheerio.load(data); - const type = url.includes("tvshows") ? "series" : "movie"; - const imdbId = ""; - const title = url.split("/")[4].replace(/-/g, " "); - const image = $(".g-item").find("a").attr("href") || ""; - const synopsis = $(".wp-content").text().trim(); - const tags = $(".sgeneros") - .children() - .map((i, element) => $(element).text()) - .get() - .slice(3); - const rating = Number($("#repimdb").find("strong").text()) - .toFixed(1) - .toString(); - const links = []; - $(".mb-center.maxbutton-5-center,.ep-button-container").map((i, element) => { - const title = $(element) - .text() - .replace("\u2b07Download", "") - .replace("\u2b07 Download", "") - .trim(); - const link = $(element).find("a").attr("href"); - if (title && link) { - links.push({ - title, - episodesLink: link, - quality: title?.match(/\d+P\b/)?.[0].replace("P", "p") || "", - }); - } - }); - return { - title, - tags, - rating, - synopsis, - image, - imdbId, - type, - linkList: links, - }; - } - catch (err) { - console.error(err); - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "movie", - linkList: [], - }; - } +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { + try { + const url = link; + const res = yield providerContext.axios.get(url, { + headers: providerContext.commonHeaders, + }); + const data = res.data; + const $ = providerContext.cheerio.load(data); + const type = url.includes("tvshows") ? "series" : "movie"; + const imdbId = ""; + const title = url.split("/")[4].replace(/-/g, " "); + const image = $(".g-item").find("a").attr("href") || ""; + const synopsis = $(".wp-content").text().trim(); + const tags = $(".sgeneros") + .children() + .map((i, element) => $(element).text()) + .get() + .slice(3); + const rating = Number($("#repimdb").find("strong").text()) + .toFixed(1) + .toString(); + const links = []; + $(".mb-center.maxbutton-5-center,.ep-button-container").map((i, element) => { + var _a; + const title = $(element) + .text() + .replace("\u2b07Download", "") + .replace("\u2b07 Download", "") + .trim(); + const link = $(element).find("a").attr("href"); + if (title && link) { + links.push({ + title, + episodesLink: link, + quality: ((_a = title === null || title === void 0 ? void 0 : title.match(/\d+P\b/)) === null || _a === void 0 ? void 0 : _a[0].replace("P", "p")) || "", + }); + } + }); + return { + title, + tags, + rating, + synopsis, + image, + imdbId, + type, + linkList: links, + }; + } + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/cinemaLuxe/posts.js b/dist/cinemaLuxe/posts.js index 85e8491..15fc613 100644 --- a/dist/cinemaLuxe/posts.js +++ b/dist/cinemaLuxe/posts.js @@ -1,55 +1,70 @@ "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 getPosts = async function ({ filter, page, signal, providerContext, }) { - const baseUrl = await providerContext.getBaseUrl("cinemaLuxe"); - const url = `${baseUrl + filter}page/${page}/`; - return posts({ url, signal, providerContext }); +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, signal, providerContext, }) { + const baseUrl = yield providerContext.getBaseUrl("cinemaLuxe"); + const url = `${baseUrl + filter}page/${page}/`; + return posts({ url, signal, providerContext }); + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) { - const baseUrl = await providerContext.getBaseUrl("cinemaLuxe"); - const url = `${baseUrl}/page/${page}/?s=${searchQuery}`; - return posts({ url, signal, providerContext }); +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) { + const baseUrl = yield providerContext.getBaseUrl("cinemaLuxe"); + const url = `${baseUrl}/page/${page}/?s=${searchQuery}`; + return posts({ url, signal, providerContext }); + }); }; exports.getSearchPosts = getSearchPosts; -async function posts({ url, signal, providerContext, }) { - try { - const res = await fetch(url, { - headers: providerContext.commonHeaders, - signal, - }); - const data = await res.text(); - const $ = providerContext.cheerio.load(data); - const catalog = []; - $(".item.tvshows,.item.movies").map((i, element) => { - const title = $(element).find(".poster").find("img").attr("alt"); - const link = $(element).find(".poster").find("a").attr("href"); - const image = $(element).find(".poster").find("img").attr("data-src"); - if (title && link && image) { - catalog.push({ - title: title, - link: link, - image: image, - }); - } - }); - $(".result-item").map((i, element) => { - const title = $(element).find(".thumbnail").find("img").attr("alt"); - const link = $(element).find(".thumbnail").find("a").attr("href"); - const image = $(element).find(".thumbnail").find("img").attr("data-src"); - if (title && link && image) { - catalog.push({ - title: title, - link: link, - image: image, - }); - } - }); - return catalog; - } - catch (err) { - console.error("cinemaluxe error ", err); - return []; - } +function posts(_a) { + return __awaiter(this, arguments, void 0, function* ({ url, signal, providerContext, }) { + try { + const res = yield fetch(url, { + headers: providerContext.commonHeaders, + signal, + }); + const data = yield res.text(); + const $ = providerContext.cheerio.load(data); + const catalog = []; + $(".item.tvshows,.item.movies").map((i, element) => { + const title = $(element).find(".poster").find("img").attr("alt"); + const link = $(element).find(".poster").find("a").attr("href"); + const image = $(element).find(".poster").find("img").attr("data-src"); + if (title && link && image) { + catalog.push({ + title: title, + link: link, + image: image, + }); + } + }); + $(".result-item").map((i, element) => { + const title = $(element).find(".thumbnail").find("img").attr("alt"); + const link = $(element).find(".thumbnail").find("a").attr("href"); + const image = $(element).find(".thumbnail").find("img").attr("data-src"); + if (title && link && image) { + catalog.push({ + title: title, + link: link, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + console.error("cinemaluxe error ", err); + return []; + } + }); } diff --git a/dist/cinemaLuxe/stream.js b/dist/cinemaLuxe/stream.js index fb11a63..7802b78 100644 --- a/dist/cinemaLuxe/stream.js +++ b/dist/cinemaLuxe/stream.js @@ -1,11 +1,21 @@ "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, signal, providerContext, }) => { +const getStream = (_a) => __awaiter(void 0, [_a], void 0, function* ({ link, signal, providerContext, }) { + var _b; try { let newLink = link; if (link.includes("luxedrive")) { - const res = await providerContext.axios.get(link); + const res = yield providerContext.axios.get(link); const $ = providerContext.cheerio.load(res.data); const hubcloudLink = $("a.btn.hubcloud").attr("href"); if (hubcloudLink) { @@ -19,18 +29,18 @@ const getStream = async ({ link, signal, providerContext, }) => { } } if (newLink.includes("gdflix")) { - const sreams = await providerContext.extractors.gdFlixExtracter(newLink, signal); + const sreams = yield providerContext.extractors.gdFlixExtracter(newLink, signal); return sreams; } - const res2 = await providerContext.axios.get(newLink, { signal }); + const res2 = yield providerContext.axios.get(newLink, { signal }); const data2 = res2.data; - const hcLink = data2.match(/location\.replace\('([^']+)'/)?.[1] || newLink; - const hubCloudLinks = await providerContext.extractors.hubcloudExtracter(hcLink.includes("https://hubcloud") ? hcLink : newLink, signal); + const hcLink = ((_b = data2.match(/location\.replace\('([^']+)'/)) === null || _b === void 0 ? void 0 : _b[1]) || newLink; + const hubCloudLinks = yield providerContext.extractors.hubcloudExtracter(hcLink.includes("https://hubcloud") ? hcLink : newLink, signal); return hubCloudLinks; } catch (err) { console.error(err); return []; } -}; +}); exports.getStream = getStream; diff --git a/dist/dooflix/meta.js b/dist/dooflix/meta.js index 6bc216d..4df1f38 100644 --- a/dist/dooflix/meta.js +++ b/dist/dooflix/meta.js @@ -1,4 +1,13 @@ "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 headers = { @@ -8,72 +17,76 @@ const headers = { "If-Modified-Since": "Wed, 14 Aug 2024 13:00:04 GMT", "User-Agent": "okhttp/3.14.9", }; -const getMeta = async function ({ link, providerContext, }) { - try { - const { axios } = providerContext; - const res = await axios.get(link, { headers }); - const resData = res.data; - const jsonStart = resData?.indexOf("{"); - const jsonEnd = resData?.lastIndexOf("}") + 1; - const data = JSON?.parse(resData?.substring(jsonStart, jsonEnd))?.title - ? JSON?.parse(resData?.substring(jsonStart, jsonEnd)) - : resData; - const title = data?.title || ""; - const synopsis = data?.description || ""; - const image = data?.poster_url || ""; - const cast = data?.cast || []; - const rating = data?.imdb_rating || ""; - const type = Number(data?.is_tvseries) ? "series" : "movie"; - const tags = data?.genre?.map((genre) => genre?.name) || []; - const links = []; - if (type === "series") { - data?.season?.map((season) => { - const title = season?.seasons_name || ""; - const directLinks = season?.episodes?.map((episode) => ({ - title: episode?.episodes_name, - link: episode?.file_url, - })) || []; - links.push({ - title: title, - directLinks: directLinks, +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { + var _b, _c, _d, _e; + try { + const { axios } = providerContext; + const res = yield axios.get(link, { headers }); + const resData = res.data; + const jsonStart = resData === null || resData === void 0 ? void 0 : resData.indexOf("{"); + const jsonEnd = (resData === null || resData === void 0 ? void 0 : resData.lastIndexOf("}")) + 1; + const data = ((_b = JSON === null || JSON === void 0 ? void 0 : JSON.parse(resData === null || resData === void 0 ? void 0 : resData.substring(jsonStart, jsonEnd))) === null || _b === void 0 ? void 0 : _b.title) + ? JSON === null || JSON === void 0 ? void 0 : JSON.parse(resData === null || resData === void 0 ? void 0 : resData.substring(jsonStart, jsonEnd)) + : resData; + const title = (data === null || data === void 0 ? void 0 : data.title) || ""; + const synopsis = (data === null || data === void 0 ? void 0 : data.description) || ""; + const image = (data === null || data === void 0 ? void 0 : data.poster_url) || ""; + const cast = (data === null || data === void 0 ? void 0 : data.cast) || []; + const rating = (data === null || data === void 0 ? void 0 : data.imdb_rating) || ""; + const type = Number(data === null || data === void 0 ? void 0 : data.is_tvseries) ? "series" : "movie"; + const tags = ((_c = data === null || data === void 0 ? void 0 : data.genre) === null || _c === void 0 ? void 0 : _c.map((genre) => genre === null || genre === void 0 ? void 0 : genre.name)) || []; + const links = []; + if (type === "series") { + (_d = data === null || data === void 0 ? void 0 : data.season) === null || _d === void 0 ? void 0 : _d.map((season) => { + var _a; + const title = (season === null || season === void 0 ? void 0 : season.seasons_name) || ""; + const directLinks = ((_a = season === null || season === void 0 ? void 0 : season.episodes) === null || _a === void 0 ? void 0 : _a.map((episode) => ({ + title: episode === null || episode === void 0 ? void 0 : episode.episodes_name, + link: episode === null || episode === void 0 ? void 0 : episode.file_url, + }))) || []; + links.push({ + title: title, + directLinks: directLinks, + }); }); - }); - } - else { - data?.videos?.map((video) => { - links.push({ - title: title + " " + video?.label, - directLinks: [ - { - title: "Play", - link: video?.file_url, - }, - ], + } + else { + (_e = data === null || data === void 0 ? void 0 : data.videos) === null || _e === void 0 ? void 0 : _e.map((video) => { + links.push({ + title: title + " " + (video === null || video === void 0 ? void 0 : video.label), + directLinks: [ + { + title: "Play", + link: video === null || video === void 0 ? void 0 : video.file_url, + }, + ], + }); }); - }); + } + return { + image: (image === null || image === void 0 ? void 0 : image.includes("https")) ? image : image === null || image === void 0 ? void 0 : image.replace("http", "https"), + synopsis: synopsis, + title: title, + rating: rating, + imdbId: "", + cast: cast, + tags: tags, + type: type, + linkList: links, + }; } - return { - image: image?.includes("https") ? image : image?.replace("http", "https"), - synopsis: synopsis, - title: title, - rating: rating, - imdbId: "", - cast: cast, - tags: tags, - type: type, - linkList: links, - }; - } - catch (err) { - console.error(err); - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "movie", - linkList: [], - }; - } + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/dooflix/posts.js b/dist/dooflix/posts.js index bcc6c1a..8662c08 100644 --- a/dist/dooflix/posts.js +++ b/dist/dooflix/posts.js @@ -1,4 +1,13 @@ "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 headers = { @@ -8,133 +17,138 @@ const headers = { "If-Modified-Since": "Wed, 14 Aug 2024 13:00:04 GMT", "User-Agent": "okhttp/3.14.9", }; -const getPosts = async function ({ filter, page, signal, providerContext, }) { - try { - const { axios, getBaseUrl } = providerContext; - const baseUrl = await getBaseUrl("dooflix"); - const catalog = []; - const url = `${baseUrl + filter + `?page=${page}`}`; - const res = await axios.get(url, { headers, signal }); - const resData = res.data; - if (!resData || typeof resData !== "string") { - console.warn("Unexpected response format from dooflix API"); - return []; - } - let data; +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, signal, providerContext, }) { try { - const jsonStart = resData.indexOf("["); - const jsonEnd = resData.lastIndexOf("]") + 1; - if (jsonStart === -1 || jsonEnd <= jsonStart) { - // If we can't find valid JSON array markers, try parsing the entire response - data = JSON.parse(resData); + const { axios, getBaseUrl } = providerContext; + const baseUrl = yield getBaseUrl("dooflix"); + const catalog = []; + const url = `${baseUrl + filter + `?page=${page}`}`; + const res = yield axios.get(url, { headers, signal }); + const resData = res.data; + if (!resData || typeof resData !== "string") { + console.warn("Unexpected response format from dooflix API"); + return []; } - else { - const jsonSubstring = resData.substring(jsonStart, jsonEnd); - const parsedArray = JSON.parse(jsonSubstring); - data = parsedArray.length > 0 ? parsedArray : resData; + let data; + try { + const jsonStart = resData.indexOf("["); + const jsonEnd = resData.lastIndexOf("]") + 1; + if (jsonStart === -1 || jsonEnd <= jsonStart) { + // If we can't find valid JSON array markers, try parsing the entire response + data = JSON.parse(resData); + } + else { + const jsonSubstring = resData.substring(jsonStart, jsonEnd); + const parsedArray = JSON.parse(jsonSubstring); + data = parsedArray.length > 0 ? parsedArray : resData; + } } - } - catch (parseError) { - console.error("Error parsing dooflix response:", parseError); - return []; - } - if (!Array.isArray(data)) { - console.warn("Unexpected data format from dooflix API"); - return []; - } - data.forEach((result) => { - const id = result?.videos_id; - if (!id) - return; - const type = !result?.is_tvseries ? "tvseries" : "movie"; - const link = `${baseUrl}/rest-api//v130/single_details?type=${type}&id=${id}`; - const thumbnailUrl = result?.thumbnail_url; - const image = thumbnailUrl?.includes("https") - ? thumbnailUrl - : thumbnailUrl?.replace("http", "https"); - catalog.push({ - title: result?.title || "", - link, - image, + catch (parseError) { + console.error("Error parsing dooflix response:", parseError); + return []; + } + if (!Array.isArray(data)) { + console.warn("Unexpected data format from dooflix API"); + return []; + } + data.forEach((result) => { + const id = result === null || result === void 0 ? void 0 : result.videos_id; + if (!id) + return; + const type = !(result === null || result === void 0 ? void 0 : result.is_tvseries) ? "tvseries" : "movie"; + const link = `${baseUrl}/rest-api//v130/single_details?type=${type}&id=${id}`; + const thumbnailUrl = result === null || result === void 0 ? void 0 : result.thumbnail_url; + const image = (thumbnailUrl === null || thumbnailUrl === void 0 ? void 0 : thumbnailUrl.includes("https")) + ? thumbnailUrl + : thumbnailUrl === null || thumbnailUrl === void 0 ? void 0 : thumbnailUrl.replace("http", "https"); + catalog.push({ + title: (result === null || result === void 0 ? void 0 : result.title) || "", + link, + image, + }); }); - }); - return catalog; - } - catch (err) { - console.error("dooflix error:", err); - return []; - } + return catalog; + } + catch (err) { + console.error("dooflix error:", err); + return []; + } + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, providerContext, signal, }) { - try { - if (page > 1) { - return []; - } - const { axios, getBaseUrl } = providerContext; - const catalog = []; - const baseUrl = await getBaseUrl("dooflix"); - const url = `${baseUrl}/rest-api//v130/search?q=${searchQuery}&type=movietvserieslive&range_to=0&range_from=0&tv_category_id=0&genre_id=0&country_id=0`; - const res = await axios.get(url, { headers, signal }); - const resData = res.data; - if (!resData || typeof resData !== "string") { - console.warn("Unexpected search response format from dooflix API"); - return []; - } - let data; +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, providerContext, signal, }) { + var _b, _c; try { - const jsonStart = resData.indexOf("{"); - const jsonEnd = resData.lastIndexOf("}") + 1; - if (jsonStart === -1 || jsonEnd <= jsonStart) { - data = resData; + if (page > 1) { + return []; } - else { - const jsonSubstring = resData.substring(jsonStart, jsonEnd); - const parsedData = JSON.parse(jsonSubstring); - data = parsedData?.movie ? parsedData : resData; + const { axios, getBaseUrl } = providerContext; + const catalog = []; + const baseUrl = yield getBaseUrl("dooflix"); + const url = `${baseUrl}/rest-api//v130/search?q=${searchQuery}&type=movietvserieslive&range_to=0&range_from=0&tv_category_id=0&genre_id=0&country_id=0`; + const res = yield axios.get(url, { headers, signal }); + const resData = res.data; + if (!resData || typeof resData !== "string") { + console.warn("Unexpected search response format from dooflix API"); + return []; } + let data; + try { + const jsonStart = resData.indexOf("{"); + const jsonEnd = resData.lastIndexOf("}") + 1; + if (jsonStart === -1 || jsonEnd <= jsonStart) { + data = resData; + } + else { + const jsonSubstring = resData.substring(jsonStart, jsonEnd); + const parsedData = JSON.parse(jsonSubstring); + data = (parsedData === null || parsedData === void 0 ? void 0 : parsedData.movie) ? parsedData : resData; + } + } + catch (parseError) { + console.error("Error parsing dooflix search response:", parseError); + return []; + } + // Process movies + (_b = data === null || data === void 0 ? void 0 : data.movie) === null || _b === void 0 ? void 0 : _b.forEach((result) => { + const id = result === null || result === void 0 ? void 0 : result.videos_id; + if (!id) + return; + const link = `${baseUrl}/rest-api//v130/single_details?type=movie&id=${id}`; + const thumbnailUrl = result === null || result === void 0 ? void 0 : result.thumbnail_url; + const image = (thumbnailUrl === null || thumbnailUrl === void 0 ? void 0 : thumbnailUrl.includes("https")) + ? thumbnailUrl + : thumbnailUrl === null || thumbnailUrl === void 0 ? void 0 : thumbnailUrl.replace("http", "https"); + catalog.push({ + title: (result === null || result === void 0 ? void 0 : result.title) || "", + link, + image, + }); + }); + // Process TV series + (_c = data === null || data === void 0 ? void 0 : data.tvseries) === null || _c === void 0 ? void 0 : _c.forEach((result) => { + const id = result === null || result === void 0 ? void 0 : result.videos_id; + if (!id) + return; + const link = `${baseUrl}/rest-api//v130/single_details?type=tvseries&id=${id}`; + const thumbnailUrl = result === null || result === void 0 ? void 0 : result.thumbnail_url; + const image = (thumbnailUrl === null || thumbnailUrl === void 0 ? void 0 : thumbnailUrl.includes("https")) + ? thumbnailUrl + : thumbnailUrl === null || thumbnailUrl === void 0 ? void 0 : thumbnailUrl.replace("http", "https"); + catalog.push({ + title: (result === null || result === void 0 ? void 0 : result.title) || "", + link, + image, + }); + }); + return catalog; } - catch (parseError) { - console.error("Error parsing dooflix search response:", parseError); + catch (error) { + console.error("dooflix search error:", error); return []; } - // Process movies - data?.movie?.forEach((result) => { - const id = result?.videos_id; - if (!id) - return; - const link = `${baseUrl}/rest-api//v130/single_details?type=movie&id=${id}`; - const thumbnailUrl = result?.thumbnail_url; - const image = thumbnailUrl?.includes("https") - ? thumbnailUrl - : thumbnailUrl?.replace("http", "https"); - catalog.push({ - title: result?.title || "", - link, - image, - }); - }); - // Process TV series - data?.tvseries?.forEach((result) => { - const id = result?.videos_id; - if (!id) - return; - const link = `${baseUrl}/rest-api//v130/single_details?type=tvseries&id=${id}`; - const thumbnailUrl = result?.thumbnail_url; - const image = thumbnailUrl?.includes("https") - ? thumbnailUrl - : thumbnailUrl?.replace("http", "https"); - catalog.push({ - title: result?.title || "", - link, - image, - }); - }); - return catalog; - } - catch (error) { - console.error("dooflix search error:", error); - return []; - } + }); }; exports.getSearchPosts = getSearchPosts; diff --git a/dist/dooflix/stream.js b/dist/dooflix/stream.js index 2162e0e..8cb2ff1 100644 --- a/dist/dooflix/stream.js +++ b/dist/dooflix/stream.js @@ -1,26 +1,37 @@ "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 function ({ link, }) { - try { - const streams = []; - streams.push({ - server: "Dooflix", - link: link, - type: "m3u8", - headers: { - Connection: "Keep-Alive", - "User-Agent": "Mozilla/5.0 (WindowsNT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.37", - Referer: "https://molop.art/", - Cookie: "cf_clearance=M2_2Hy4lKRy_ruRX3dzOgm3iho1FHe2DUC1lq28BUtI-1737377622-1.2.1.1-6R8RaH94._H2BuNuotsjTZ3fAF6cLwPII0guemu9A5Xa46lpCJPuELycojdREwoonYS2kRTYcZ9_1c4h4epi2LtDvMM9jIoOZKE9pIdWa30peM1hRMpvffTjGUCraHsJNCJez8S_QZ6XkkdP7GeQ5iwiYaI6Grp6qSJWoq0Hj8lS7EITZ1LzyrALI6iLlYjgLmgLGa1VuhORWJBN8ZxrJIZ_ba_pqbrR9fjnyToqxZ0XQaZfk1d3rZyNWoZUjI98GoAxVjnKtcBQQG6b2jYPJuMbbYraGoa54N7E7BR__7o", - }, - }); - console.log("doo streams", streams); - return streams; - } - catch (err) { - console.error(err); - return []; - } +const getStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, }) { + try { + const streams = []; + streams.push({ + server: "Dooflix", + link: link, + type: "m3u8", + headers: { + Connection: "Keep-Alive", + "User-Agent": "Mozilla/5.0 (WindowsNT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.37", + Referer: "https://molop.art/", + Cookie: "cf_clearance=M2_2Hy4lKRy_ruRX3dzOgm3iho1FHe2DUC1lq28BUtI-1737377622-1.2.1.1-6R8RaH94._H2BuNuotsjTZ3fAF6cLwPII0guemu9A5Xa46lpCJPuELycojdREwoonYS2kRTYcZ9_1c4h4epi2LtDvMM9jIoOZKE9pIdWa30peM1hRMpvffTjGUCraHsJNCJez8S_QZ6XkkdP7GeQ5iwiYaI6Grp6qSJWoq0Hj8lS7EITZ1LzyrALI6iLlYjgLmgLGa1VuhORWJBN8ZxrJIZ_ba_pqbrR9fjnyToqxZ0XQaZfk1d3rZyNWoZUjI98GoAxVjnKtcBQQG6b2jYPJuMbbYraGoa54N7E7BR__7o", + }, + }); + console.log("doo streams", streams); + return streams; + } + catch (err) { + console.error(err); + return []; + } + }); }; exports.getStream = getStream; diff --git a/dist/drive/episodes.js b/dist/drive/episodes.js index 05dee03..f207389 100644 --- a/dist/drive/episodes.js +++ b/dist/drive/episodes.js @@ -1,34 +1,45 @@ "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.getEpisodes = void 0; -const getEpisodes = async function ({ url, providerContext, }) { - try { - const { axios, cheerio } = providerContext; - const res = await axios.get(url); - const html = res.data; - let $ = cheerio.load(html); - const episodeLinks = []; - $('a:contains("HubCloud")').map((i, element) => { - const title = $(element).parent().prev().text(); - const link = $(element).attr("href"); - if (link && (title.includes("Ep") || title.includes("Download"))) { - episodeLinks.push({ - title: title.includes("Download") ? "Play" : title, - link, - }); - } - }); - // console.log(episodeLinks); - return episodeLinks; - } - catch (err) { - console.error(err); - return [ - { - title: "Server 1", - link: url, - }, - ]; - } +const getEpisodes = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) { + try { + const { axios, cheerio } = providerContext; + const res = yield axios.get(url); + const html = res.data; + let $ = cheerio.load(html); + const episodeLinks = []; + $('a:contains("HubCloud")').map((i, element) => { + const title = $(element).parent().prev().text(); + const link = $(element).attr("href"); + if (link && (title.includes("Ep") || title.includes("Download"))) { + episodeLinks.push({ + title: title.includes("Download") ? "Play" : title, + link, + }); + } + }); + // console.log(episodeLinks); + return episodeLinks; + } + catch (err) { + console.error(err); + return [ + { + title: "Server 1", + link: url, + }, + ]; + } + }); }; exports.getEpisodes = getEpisodes; diff --git a/dist/drive/meta.js b/dist/drive/meta.js index 8c2936b..2e4bc21 100644 --- a/dist/drive/meta.js +++ b/dist/drive/meta.js @@ -1,72 +1,85 @@ "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 getMeta = async function ({ link, providerContext, }) { - try { - const { axios, cheerio } = providerContext; - const url = link; - const res = await axios.get(url); - const data = res.data; - const $ = cheerio.load(data); - const type = $(".left-wrapper") - .text() - .toLocaleLowerCase() - .includes("movie name") - ? "movie" - : "series"; - const imdbId = $('a:contains("IMDb")').attr("href")?.split("/")[4] || ""; - const title = $(".left-wrapper").find('strong:contains("Name")').next().text() || - $(".left-wrapper") - .find('strong:contains("Name"),h5:contains("Name")') - .find("span:first") - .text(); - const synopsis = $(".left-wrapper") - .find('h2:contains("Storyline"),h3:contains("Storyline"),h5:contains("Storyline"),h4:contains("Storyline"),h4:contains("STORYLINE")') - .next() - .text() || - $(".ipc-html-content-inner-div").text() || - ""; - const image = $("img.entered.lazyloaded,img.entered,img.litespeed-loaded").attr("src") || - $("img.aligncenter").attr("src") || - ""; - // Links - const links = []; - $('a:contains("1080")a:not(:contains("Zip")),a:contains("720")a:not(:contains("Zip")),a:contains("480")a:not(:contains("Zip")),a:contains("2160")a:not(:contains("Zip")),a:contains("4k")a:not(:contains("Zip"))').map((i, element) => { - const title = $(element).parent("h5").prev().text(); - const episodesLink = $(element).attr("href"); - const quality = title.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || ""; - if (episodesLink && title) { - links.push({ - title, - episodesLink: type === "series" ? episodesLink : "", - directLinks: type === "movie" - ? [{ title: "Movie", link: episodesLink, type: "movie" }] - : [], - quality: quality, - }); - } - }); - // console.log('drive meta', title, synopsis, image, imdbId, type, links); - console.log("drive meta", links, type); - return { - title, - synopsis, - image, - imdbId, - type, - linkList: links, - }; - } - catch (err) { - console.error(err); - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "movie", - linkList: [], - }; - } +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); + const data = res.data; + const $ = cheerio.load(data); + const type = $(".left-wrapper") + .text() + .toLocaleLowerCase() + .includes("movie name") + ? "movie" + : "series"; + const imdbId = ((_b = $('a:contains("IMDb")').attr("href")) === null || _b === void 0 ? void 0 : _b.split("/")[4]) || ""; + const title = $(".left-wrapper").find('strong:contains("Name")').next().text() || + $(".left-wrapper") + .find('strong:contains("Name"),h5:contains("Name")') + .find("span:first") + .text(); + const synopsis = $(".left-wrapper") + .find('h2:contains("Storyline"),h3:contains("Storyline"),h5:contains("Storyline"),h4:contains("Storyline"),h4:contains("STORYLINE")') + .next() + .text() || + $(".ipc-html-content-inner-div").text() || + ""; + const image = $("img.entered.lazyloaded,img.entered,img.litespeed-loaded").attr("src") || + $("img.aligncenter").attr("src") || + ""; + // Links + const links = []; + $('a:contains("1080")a:not(:contains("Zip")),a:contains("720")a:not(:contains("Zip")),a:contains("480")a:not(:contains("Zip")),a:contains("2160")a:not(:contains("Zip")),a:contains("4k")a:not(:contains("Zip"))').map((i, element) => { + var _a; + const title = $(element).parent("h5").prev().text(); + const episodesLink = $(element).attr("href"); + const quality = ((_a = title.match(/\b(480p|720p|1080p|2160p)\b/i)) === null || _a === void 0 ? void 0 : _a[0]) || ""; + if (episodesLink && title) { + links.push({ + title, + episodesLink: type === "series" ? episodesLink : "", + directLinks: type === "movie" + ? [{ title: "Movie", link: episodesLink, type: "movie" }] + : [], + quality: quality, + }); + } + }); + // console.log('drive meta', title, synopsis, image, imdbId, type, links); + console.log("drive meta", links, type); + return { + title, + synopsis, + image, + imdbId, + type, + linkList: links, + }; + } + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/drive/posts.js b/dist/drive/posts.js index bbddbaa..3e9091b 100644 --- a/dist/drive/posts.js +++ b/dist/drive/posts.js @@ -1,45 +1,60 @@ "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 getPosts = async function ({ filter, page, signal, providerContext, }) { - const { getBaseUrl } = providerContext; - const baseUrl = await getBaseUrl("drive"); - const url = `${baseUrl + filter}/page/${page}/`; - return posts({ url, signal, providerContext }); +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, signal, providerContext, }) { + const { getBaseUrl } = providerContext; + const baseUrl = yield getBaseUrl("drive"); + const url = `${baseUrl + filter}/page/${page}/`; + return posts({ url, signal, providerContext }); + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) { - const { getBaseUrl } = providerContext; - const baseUrl = await getBaseUrl("drive"); - const url = `${baseUrl}page/${page}/?s=${searchQuery}`; - return posts({ url, signal, providerContext }); +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) { + const { getBaseUrl } = providerContext; + const baseUrl = yield getBaseUrl("drive"); + const url = `${baseUrl}page/${page}/?s=${searchQuery}`; + return posts({ url, signal, providerContext }); + }); }; exports.getSearchPosts = getSearchPosts; -async function posts({ url, signal, providerContext, }) { - try { - const { cheerio } = providerContext; - const res = await fetch(url, { signal }); - const data = await 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("drive error ", err); - return []; - } +function posts(_a) { + return __awaiter(this, arguments, void 0, function* ({ url, signal, providerContext, }) { + try { + const { cheerio } = providerContext; + const res = yield fetch(url, { 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("drive error ", err); + return []; + } + }); } diff --git a/dist/drive/stream.js b/dist/drive/stream.js index 07934a8..4272aaa 100644 --- a/dist/drive/stream.js +++ b/dist/drive/stream.js @@ -1,33 +1,45 @@ "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 function ({ link: url, type, signal, providerContext, }) { - const headers = providerContext.commonHeaders; - try { - if (type === "movie") { - const res = await providerContext.axios.get(url, { headers }); - const html = res.data; - const $ = providerContext.cheerio.load(html); - const link = $('a:contains("HubCloud")').attr("href"); - url = link || url; +const getStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link: url, type, signal, providerContext, }) { + var _b, _c; + const headers = providerContext.commonHeaders; + try { + if (type === "movie") { + const res = yield providerContext.axios.get(url, { headers }); + const html = res.data; + const $ = providerContext.cheerio.load(html); + const link = $('a:contains("HubCloud")').attr("href"); + url = link || url; + } + const res = yield providerContext.axios.get(url, { headers }); + let redirectUrl = (_b = res.data.match(//i)) === null || _b === void 0 ? void 0 : _b[1]; + if (url.includes("/archives/")) { + redirectUrl = (_c = res.data.match(/]*href="(https:\/\/hubcloud\.[^\/]+\/[^"]+)"/i)) === null || _c === void 0 ? void 0 : _c[1]; + } + if (!redirectUrl) { + return yield providerContext.extractors.hubcloudExtracter(url, signal); + } + const res2 = yield providerContext.axios.get(redirectUrl, { headers }); + const data = res2.data; + const $ = providerContext.cheerio.load(data); + const hubcloudLink = $(".fa-file-download").parent().attr("href"); + return yield providerContext.extractors.hubcloudExtracter((hubcloudLink === null || hubcloudLink === void 0 ? void 0 : hubcloudLink.includes("https://hubcloud")) ? hubcloudLink : redirectUrl, signal); } - const res = await providerContext.axios.get(url, { headers }); - let redirectUrl = res.data.match(//i)?.[1]; - if (url.includes("/archives/")) { - redirectUrl = res.data.match(/]*href="(https:\/\/hubcloud\.[^\/]+\/[^"]+)"/i)?.[1]; + catch (err) { + console.error("Movies Drive err", err); + return []; } - if (!redirectUrl) { - return await providerContext.extractors.hubcloudExtracter(url, signal); - } - const res2 = await providerContext.axios.get(redirectUrl, { headers }); - const data = res2.data; - const $ = providerContext.cheerio.load(data); - const hubcloudLink = $(".fa-file-download").parent().attr("href"); - return await providerContext.extractors.hubcloudExtracter(hubcloudLink?.includes("https://hubcloud") ? hubcloudLink : redirectUrl, signal); - } - catch (err) { - console.error("Movies Drive err", err); - return []; - } + }); }; exports.getStream = getStream; diff --git a/dist/filmyfly/episodes.js b/dist/filmyfly/episodes.js index 536db37..7c1171c 100644 --- a/dist/filmyfly/episodes.js +++ b/dist/filmyfly/episodes.js @@ -1,33 +1,43 @@ "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.getEpisodes = void 0; -const getEpisodes = async function ({ url, providerContext, }) { - try { - const headers = providerContext.commonHeaders; - const { axios, cheerio } = providerContext; - const res = await axios.get(url, { headers }); - const data = res.data; - const $ = cheerio.load(data); - const episodeLinks = []; - $(".dlink.dl").map((i, element) => { - const title = $(element) - .find("a") - .text() - ?.replace("Download", "") - ?.trim(); - const link = $(element).find("a").attr("href"); - if (title && link) { - episodeLinks.push({ - title, - link, - }); - } - }); - return episodeLinks; - } - catch (err) { - console.error("cl episode links", err); - return []; - } +const getEpisodes = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) { + try { + const headers = providerContext.commonHeaders; + const { axios, cheerio } = providerContext; + const res = yield axios.get(url, { headers }); + const data = res.data; + const $ = cheerio.load(data); + const episodeLinks = []; + $(".dlink.dl").map((i, element) => { + var _a, _b; + const title = (_b = (_a = $(element) + .find("a") + .text()) === null || _a === void 0 ? void 0 : _a.replace("Download", "")) === null || _b === void 0 ? void 0 : _b.trim(); + const link = $(element).find("a").attr("href"); + if (title && link) { + episodeLinks.push({ + title, + link, + }); + } + }); + return episodeLinks; + } + catch (err) { + console.error("cl episode links", err); + return []; + } + }); }; exports.getEpisodes = getEpisodes; diff --git a/dist/filmyfly/meta.js b/dist/filmyfly/meta.js index ec6c793..1bb5e26 100644 --- a/dist/filmyfly/meta.js +++ b/dist/filmyfly/meta.js @@ -1,52 +1,63 @@ "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 getMeta = async function ({ link, providerContext, }) { - try { - const { axios, cheerio, commonHeaders: headers } = providerContext; - const url = link; - const res = await axios.get(url, { headers }); - const data = res.data; - const $ = cheerio.load(data); - const type = url.includes("tvshows") ? "series" : "movie"; - const imdbId = ""; - const title = $('.fname:contains("Name")').find(".colora").text().trim(); - const image = $(".ss").find("img").attr("src") || ""; - const synopsis = $('.fname:contains("Description")') - .find(".colorg") - .text() - .trim(); - const tags = $('.fname:contains("Genre")').find(".colorb").text().split(",") || []; - const rating = ""; - const links = []; - const downloadLink = $(".dlbtn").find("a").attr("href"); - if (downloadLink) { - links.push({ - title: title, - episodesLink: downloadLink, - }); +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { + try { + const { axios, cheerio, commonHeaders: headers } = providerContext; + const url = link; + const res = yield axios.get(url, { headers }); + const data = res.data; + const $ = cheerio.load(data); + const type = url.includes("tvshows") ? "series" : "movie"; + const imdbId = ""; + const title = $('.fname:contains("Name")').find(".colora").text().trim(); + const image = $(".ss").find("img").attr("src") || ""; + const synopsis = $('.fname:contains("Description")') + .find(".colorg") + .text() + .trim(); + const tags = $('.fname:contains("Genre")').find(".colorb").text().split(",") || []; + const rating = ""; + const links = []; + const downloadLink = $(".dlbtn").find("a").attr("href"); + if (downloadLink) { + links.push({ + title: title, + episodesLink: downloadLink, + }); + } + return { + title, + tags, + rating, + synopsis, + image, + imdbId, + type, + linkList: links, + }; } - return { - title, - tags, - rating, - synopsis, - image, - imdbId, - type, - linkList: links, - }; - } - catch (err) { - console.error(err); - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "movie", - linkList: [], - }; - } + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/filmyfly/posts.js b/dist/filmyfly/posts.js index 070e5f8..16469a0 100644 --- a/dist/filmyfly/posts.js +++ b/dist/filmyfly/posts.js @@ -1,46 +1,61 @@ "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 getPosts = async function ({ filter, page, signal, providerContext, }) { - const { getBaseUrl } = providerContext; - const baseUrl = await getBaseUrl("filmyfly"); - const url = `${baseUrl + filter}/${page}`; - return posts({ url, signal, baseUrl, providerContext }); +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, signal, providerContext, }) { + const { getBaseUrl } = providerContext; + const baseUrl = yield getBaseUrl("filmyfly"); + const url = `${baseUrl + filter}/${page}`; + return posts({ url, signal, baseUrl, providerContext }); + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) { - const { getBaseUrl } = providerContext; - const baseUrl = await getBaseUrl("filmyfly"); - const url = `${baseUrl}/site-1.html?to-search=${searchQuery}`; - if (page > 1) { - return []; - } - return posts({ url, signal, baseUrl, providerContext }); +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) { + const { getBaseUrl } = providerContext; + const baseUrl = yield getBaseUrl("filmyfly"); + const url = `${baseUrl}/site-1.html?to-search=${searchQuery}`; + if (page > 1) { + return []; + } + return posts({ url, signal, baseUrl, providerContext }); + }); }; exports.getSearchPosts = getSearchPosts; -async function posts({ url, signal, baseUrl, providerContext, }) { - try { - const { cheerio, commonHeaders: headers } = providerContext; - const res = await fetch(url, { headers, signal }); - const data = await res.text(); - const $ = cheerio.load(data); - const catalog = []; - $(".A2,.A10,.fl").map((i, element) => { - const title = $(element).find("a").eq(1).text() || $(element).find("b").text(); - const link = $(element).find("a").attr("href"); - const image = $(element).find("img").attr("src"); - if (title && link && image) { - catalog.push({ - title: title, - link: baseUrl + link, - image: image, - }); - } - }); - return catalog; - } - catch (err) { - console.error("ff error ", err); - return []; - } +function posts(_a) { + return __awaiter(this, arguments, void 0, function* ({ url, signal, baseUrl, providerContext, }) { + try { + const { cheerio, commonHeaders: headers } = providerContext; + const res = yield fetch(url, { headers, signal }); + const data = yield res.text(); + const $ = cheerio.load(data); + const catalog = []; + $(".A2,.A10,.fl").map((i, element) => { + const title = $(element).find("a").eq(1).text() || $(element).find("b").text(); + const link = $(element).find("a").attr("href"); + const image = $(element).find("img").attr("src"); + if (title && link && image) { + catalog.push({ + title: title, + link: baseUrl + link, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + console.error("ff error ", err); + return []; + } + }); } diff --git a/dist/filmyfly/stream.js b/dist/filmyfly/stream.js index dc41289..75235a7 100644 --- a/dist/filmyfly/stream.js +++ b/dist/filmyfly/stream.js @@ -1,40 +1,51 @@ "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 function ({ link, signal, providerContext, }) { - try { - const res = await providerContext.axios.get(link, { signal }); - const data = res.data; - const $ = providerContext.cheerio.load(data); - const streams = []; - const elements = $(".button2,.button1,.button3,.button4,.button").toArray(); - const promises = elements.map(async (element) => { - const title = $(element).text(); - let link = $(element).attr("href"); - if (title.includes("GDFLIX") && link) { - const gdLinks = await providerContext.extractors.gdFlixExtracter(link, signal); - streams.push(...gdLinks); - } - const alreadyAdded = streams.find((s) => s.link === link); - if (title && - link && - !title.includes("Watch") && - !title.includes("Login") && - !title.includes("GoFile") && - !alreadyAdded) { - streams.push({ - server: title, - link: link, - type: "mkv", - }); - } - }); - await Promise.all(promises); - return streams; - } - catch (err) { - console.error(err); - return []; - } +const getStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, signal, providerContext, }) { + try { + const res = yield providerContext.axios.get(link, { signal }); + const data = res.data; + const $ = providerContext.cheerio.load(data); + const streams = []; + const elements = $(".button2,.button1,.button3,.button4,.button").toArray(); + const promises = elements.map((element) => __awaiter(this, void 0, void 0, function* () { + const title = $(element).text(); + let link = $(element).attr("href"); + if (title.includes("GDFLIX") && link) { + const gdLinks = yield providerContext.extractors.gdFlixExtracter(link, signal); + streams.push(...gdLinks); + } + const alreadyAdded = streams.find((s) => s.link === link); + if (title && + link && + !title.includes("Watch") && + !title.includes("Login") && + !title.includes("GoFile") && + !alreadyAdded) { + streams.push({ + server: title, + link: link, + type: "mkv", + }); + } + })); + yield Promise.all(promises); + return streams; + } + catch (err) { + console.error(err); + return []; + } + }); }; exports.getStream = getStream; diff --git a/dist/flixhq/meta.js b/dist/flixhq/meta.js index e91c7b4..9183905 100644 --- a/dist/flixhq/meta.js +++ b/dist/flixhq/meta.js @@ -1,56 +1,64 @@ "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 getMeta = async function ({ link: id, providerContext, }) { - try { - const { axios, getBaseUrl } = providerContext; - const baseUrl = await getBaseUrl("consumet"); - const url = `${baseUrl}/movies/flixhq/info?id=` + id; - const res = await axios.get(url); - const data = res.data; - const meta = { - title: data.title, - synopsis: data.description.replace(/<[^>]*>?/gm, "").trim(), - image: data.cover, - cast: data.casts, - rating: data.rating, - tags: [data?.type, data?.duration, data.releaseDate.split("-")[0]], - imdbId: "", - type: data.episodes.length > 1 ? "series" : "movie", - }; - const links = []; - data.episodes.forEach((episode) => { - const title = episode?.number - ? "Season-" + episode?.season + " Ep-" + episode.number - : episode.title; - const link = episode.id + "*" + data.id; - if (link && title) { - links.push({ - title, - link, - }); - } - }); - return { - ...meta, - linkList: [ - { - title: meta.title, - directLinks: links, - }, - ], - }; - } - catch (err) { - console.error(err); - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "movie", - linkList: [], - }; - } +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link: id, providerContext, }) { + try { + const { axios, getBaseUrl } = providerContext; + const baseUrl = yield getBaseUrl("consumet"); + const url = `${baseUrl}/movies/flixhq/info?id=` + id; + const res = yield axios.get(url); + const data = res.data; + const meta = { + title: data.title, + synopsis: data.description.replace(/<[^>]*>?/gm, "").trim(), + image: data.cover, + cast: data.casts, + rating: data.rating, + tags: [data === null || data === void 0 ? void 0 : data.type, data === null || data === void 0 ? void 0 : data.duration, data.releaseDate.split("-")[0]], + imdbId: "", + type: data.episodes.length > 1 ? "series" : "movie", + }; + const links = []; + data.episodes.forEach((episode) => { + const title = (episode === null || episode === void 0 ? void 0 : episode.number) + ? "Season-" + (episode === null || episode === void 0 ? void 0 : episode.season) + " Ep-" + episode.number + : episode.title; + const link = episode.id + "*" + data.id; + if (link && title) { + links.push({ + title, + link, + }); + } + }); + return Object.assign(Object.assign({}, meta), { linkList: [ + { + title: meta.title, + directLinks: links, + }, + ] }); + } + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/flixhq/posts.js b/dist/flixhq/posts.js index f2f9a95..60d14f1 100644 --- a/dist/flixhq/posts.js +++ b/dist/flixhq/posts.js @@ -1,44 +1,60 @@ "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 getPosts = async function ({ filter, signal, providerContext, }) { - const { getBaseUrl } = providerContext; - const urlRes = await getBaseUrl("consumet"); - const baseUrl = urlRes + "/movies/flixhq"; - const url = `${baseUrl + filter}`; - return posts({ url, signal, providerContext }); +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, signal, providerContext, }) { + const { getBaseUrl } = providerContext; + const urlRes = yield getBaseUrl("consumet"); + const baseUrl = urlRes + "/movies/flixhq"; + const url = `${baseUrl + filter}`; + return posts({ url, signal, providerContext }); + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) { - const { getBaseUrl } = providerContext; - const urlRes = await getBaseUrl("consumet"); - const baseUrl = urlRes + "/movies/flixhq"; - const url = `${baseUrl}/${searchQuery}?page=${page}`; - return posts({ url, signal, providerContext }); +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) { + const { getBaseUrl } = providerContext; + const urlRes = yield getBaseUrl("consumet"); + const baseUrl = urlRes + "/movies/flixhq"; + const url = `${baseUrl}/${searchQuery}?page=${page}`; + return posts({ url, signal, providerContext }); + }); }; exports.getSearchPosts = getSearchPosts; -async function posts({ url, signal, providerContext, }) { - try { - const { axios } = providerContext; - const res = await axios.get(url, { signal }); - const data = res.data?.results || res.data; - const catalog = []; - data?.map((element) => { - const title = element.title; - const link = element.id; - const image = element.image; - if (title && link && image) { - catalog.push({ - title: title, - link: link, - image: image, - }); - } - }); - return catalog; - } - catch (err) { - console.error("flixhq error ", err); - return []; - } +function posts(_a) { + return __awaiter(this, arguments, void 0, function* ({ url, signal, providerContext, }) { + var _b; + try { + const { axios } = providerContext; + const res = yield axios.get(url, { signal }); + const data = ((_b = res.data) === null || _b === void 0 ? void 0 : _b.results) || res.data; + const catalog = []; + data === null || data === void 0 ? void 0 : data.map((element) => { + const title = element.title; + const link = element.id; + const image = element.image; + if (title && link && image) { + catalog.push({ + title: title, + link: link, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + console.error("flixhq error ", err); + return []; + } + }); } diff --git a/dist/flixhq/stream.js b/dist/flixhq/stream.js index b36e0b5..e17d468 100644 --- a/dist/flixhq/stream.js +++ b/dist/flixhq/stream.js @@ -1,55 +1,69 @@ "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 types_1 = require("../types"); -const getStream = async function ({ link: id, providerContext, }) { - try { - const { getBaseUrl } = providerContext; - const episodeId = id.split("*")[0]; - const mediaId = id.split("*")[1]; - const baseUrl = await getBaseUrl("consumet"); - const serverUrl = `${baseUrl}/movies/flixhq/servers?episodeId=${episodeId}&mediaId=${mediaId}`; - const res = await fetch(serverUrl); - const servers = await res.json(); - const streamLinks = []; - for (const server of servers) { - const streamUrl = `${baseUrl}/movies/flixhq/watch?server=` + - server.name + - "&episodeId=" + - episodeId + - "&mediaId=" + - mediaId; - const streamRes = await fetch(streamUrl); - const streamData = await streamRes.json(); - const subtitles = []; - if (streamData?.sources?.length > 0) { - if (streamData.subtitles) { - streamData.subtitles.forEach((sub) => { - subtitles.push({ - language: sub?.lang?.slice(0, 2), - uri: sub?.url, - type: types_1.TextTrackType.VTT, - title: sub?.lang, +const getStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link: id, providerContext, }) { + var _b; + try { + const { getBaseUrl } = providerContext; + const episodeId = id.split("*")[0]; + const mediaId = id.split("*")[1]; + const baseUrl = yield getBaseUrl("consumet"); + const serverUrl = `${baseUrl}/movies/flixhq/servers?episodeId=${episodeId}&mediaId=${mediaId}`; + const res = yield fetch(serverUrl); + const servers = yield res.json(); + const streamLinks = []; + for (const server of servers) { + const streamUrl = `${baseUrl}/movies/flixhq/watch?server=` + + server.name + + "&episodeId=" + + episodeId + + "&mediaId=" + + mediaId; + const streamRes = yield fetch(streamUrl); + const streamData = yield streamRes.json(); + const subtitles = []; + if (((_b = streamData === null || streamData === void 0 ? void 0 : streamData.sources) === null || _b === void 0 ? void 0 : _b.length) > 0) { + if (streamData.subtitles) { + streamData.subtitles.forEach((sub) => { + var _a; + subtitles.push({ + language: (_a = sub === null || sub === void 0 ? void 0 : sub.lang) === null || _a === void 0 ? void 0 : _a.slice(0, 2), + uri: sub === null || sub === void 0 ? void 0 : sub.url, + type: types_1.TextTrackType.VTT, + title: sub === null || sub === void 0 ? void 0 : sub.lang, + }); + }); + } + streamData.sources.forEach((source) => { + var _a; + streamLinks.push({ + server: (server === null || server === void 0 ? void 0 : server.name) + + "-" + + ((_a = source === null || source === void 0 ? void 0 : source.quality) === null || _a === void 0 ? void 0 : _a.replace("auto", "MultiQuality")), + link: source.url, + type: source.isM3U8 ? "m3u8" : "mp4", + subtitles: subtitles, }); }); } - streamData.sources.forEach((source) => { - streamLinks.push({ - server: server?.name + - "-" + - source?.quality?.replace("auto", "MultiQuality"), - link: source.url, - type: source.isM3U8 ? "m3u8" : "mp4", - subtitles: subtitles, - }); - }); } + return streamLinks; } - return streamLinks; - } - catch (err) { - console.error(err); - return []; - } + catch (err) { + console.error(err); + return []; + } + }); }; exports.getStream = getStream; diff --git a/dist/gdflixExtractor.js b/dist/gdflixExtractor.js index 059a9b3..33ec793 100644 --- a/dist/gdflixExtractor.js +++ b/dist/gdflixExtractor.js @@ -32,6 +32,15 @@ var __importStar = (this && this.__importStar) || (function () { return result; }; })(); +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()); + }); +}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; @@ -40,162 +49,163 @@ exports.gdFlixExtracter = gdFlixExtracter; const axios_1 = __importDefault(require("axios")); const cheerio = __importStar(require("cheerio")); const headers_1 = require("./headers"); -async function gdFlixExtracter(link, signal) { - try { - const streamLinks = []; - const res = await (0, axios_1.default)(`${link}`, { headers: headers_1.headers, signal }); - console.log('gdFlixExtracter', link); - const data = res.data; - let $drive = cheerio.load(data); - // handle if redirected to another link - if ($drive('body').attr('onload')?.includes('location.replace')) { - const newLink = $drive('body') - .attr('onload') - ?.split("location.replace('")?.[1] - .split("'")?.[0]; - console.log('newLink', newLink); - if (newLink) { - const newRes = await axios_1.default.get(newLink, { headers: headers_1.headers, signal }); - $drive = cheerio.load(newRes.data); - } - } - // try { - // const resumeBot = $drive('.fab.fa-artstation').prev().attr('href') || ''; - // console.log('resumeBot', resumeBot); - // const resumeBotRes = await axios.get(resumeBot, {headers}); - // const resumeBotToken = resumeBotRes.data.match( - // /formData\.append\('token', '([a-f0-9]+)'\)/, - // )[1]; - // const resumeBotBody = new FormData(); - // resumeBotBody.append('token', resumeBotToken); - // const resumeBotPath = resumeBotRes.data.match( - // /fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/, - // )[1]; - // const resumeBotBaseUrl = resumeBot.split('/download')[0]; - // // console.log( - // // 'resumeBotPath', - // // resumeBotBaseUrl + '/download?id=' + resumeBotPath, - // // ); - // // console.log('resumeBotBody', resumeBotToken); - // const resumeBotDownload = await fetch( - // resumeBotBaseUrl + '/download?id=' + resumeBotPath, - // { - // method: 'POST', - // body: resumeBotBody, - // headers: { - // Referer: resumeBot, - // Cookie: 'PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308', - // }, - // }, - // ); - // const resumeBotDownloadData = await resumeBotDownload.json(); - // console.log('resumeBotDownloadData', resumeBotDownloadData.url); - // streamLinks.push({ - // server: 'ResumeBot', - // link: resumeBotDownloadData.url, - // type: 'mkv', - // }); - // } catch (err) { - // console.log('ResumeBot link not found', err); - // } - /// resume cloud +function gdFlixExtracter(link, signal) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c, _d, _e, _f, _g, _h; try { - const baseUrl = link.split('/').slice(0, 3).join('/'); - const resumeDrive = $drive('.btn-secondary').attr('href') || ''; - console.log('resumeDrive', resumeDrive); - if (resumeDrive.includes('indexbot')) { - const resumeBotRes = await axios_1.default.get(resumeDrive, { headers: headers_1.headers }); - const resumeBotToken = resumeBotRes.data.match(/formData\.append\('token', '([a-f0-9]+)'\)/)[1]; - const resumeBotBody = new FormData(); - resumeBotBody.append('token', resumeBotToken); - const resumeBotPath = resumeBotRes.data.match(/fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/)[1]; - const resumeBotBaseUrl = resumeDrive.split('/download')[0]; - // console.log( - // 'resumeBotPath', - // resumeBotBaseUrl + '/download?id=' + resumeBotPath, - // ); - // console.log('resumeBotBody', resumeBotToken); - const resumeBotDownload = await fetch(resumeBotBaseUrl + '/download?id=' + resumeBotPath, { - method: 'POST', - body: resumeBotBody, - headers: { - Referer: resumeDrive, - Cookie: 'PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308', - }, - }); - const resumeBotDownloadData = await resumeBotDownload.json(); - console.log('resumeBotDownloadData', resumeBotDownloadData.url); - streamLinks.push({ - server: 'ResumeBot', - link: resumeBotDownloadData.url, - type: 'mkv', - }); - } - else { - const url = baseUrl + resumeDrive; - const resumeDriveRes = await axios_1.default.get(url, { headers: headers_1.headers }); - 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', - }); + const streamLinks = []; + const res = yield (0, axios_1.default)(`${link}`, { headers: headers_1.headers, signal }); + console.log('gdFlixExtracter', link); + const data = res.data; + let $drive = cheerio.load(data); + // handle if redirected to another link + if ((_a = $drive('body').attr('onload')) === null || _a === void 0 ? void 0 : _a.includes('location.replace')) { + const newLink = (_d = (_c = (_b = $drive('body') + .attr('onload')) === null || _b === void 0 ? void 0 : _b.split("location.replace('")) === null || _c === void 0 ? void 0 : _c[1].split("'")) === null || _d === void 0 ? void 0 : _d[0]; + console.log('newLink', newLink); + if (newLink) { + const newRes = yield axios_1.default.get(newLink, { headers: headers_1.headers, signal }); + $drive = cheerio.load(newRes.data); } } - } - catch (err) { - console.log('Resume link not found'); - } - //instant link - try { - const seed = $drive('.btn-danger').attr('href') || ''; - console.log('seed', seed); - if (!seed.includes('?url=')) { - const newLinkRes = await axios_1.default.head(seed, { headers: headers_1.headers, signal }); - console.log('newLinkRes', newLinkRes.request?.responseURL); - const newLink = newLinkRes.request?.responseURL?.split('?url=')?.[1] || seed; - streamLinks.push({ server: 'G-Drive', link: newLink, type: 'mkv' }); - } - else { - 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 = await fetch(videoSeedUrl, { - method: 'POST', - body: InstantFromData, - headers: { - 'x-token': videoSeedUrl, - }, - }); - const instantLinkData = await instantLinkRes.json(); - // console.log('instantLinkData', instantLinkData); - if (instantLinkData.error === false) { - const instantLink = instantLinkData.url; + // try { + // const resumeBot = $drive('.fab.fa-artstation').prev().attr('href') || ''; + // console.log('resumeBot', resumeBot); + // const resumeBotRes = await axios.get(resumeBot, {headers}); + // const resumeBotToken = resumeBotRes.data.match( + // /formData\.append\('token', '([a-f0-9]+)'\)/, + // )[1]; + // const resumeBotBody = new FormData(); + // resumeBotBody.append('token', resumeBotToken); + // const resumeBotPath = resumeBotRes.data.match( + // /fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/, + // )[1]; + // const resumeBotBaseUrl = resumeBot.split('/download')[0]; + // // console.log( + // // 'resumeBotPath', + // // resumeBotBaseUrl + '/download?id=' + resumeBotPath, + // // ); + // // console.log('resumeBotBody', resumeBotToken); + // const resumeBotDownload = await fetch( + // resumeBotBaseUrl + '/download?id=' + resumeBotPath, + // { + // method: 'POST', + // body: resumeBotBody, + // headers: { + // Referer: resumeBot, + // Cookie: 'PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308', + // }, + // }, + // ); + // const resumeBotDownloadData = await resumeBotDownload.json(); + // console.log('resumeBotDownloadData', resumeBotDownloadData.url); + // streamLinks.push({ + // server: 'ResumeBot', + // link: resumeBotDownloadData.url, + // type: 'mkv', + // }); + // } catch (err) { + // console.log('ResumeBot link not found', err); + // } + /// resume cloud + try { + const baseUrl = link.split('/').slice(0, 3).join('/'); + const resumeDrive = $drive('.btn-secondary').attr('href') || ''; + console.log('resumeDrive', resumeDrive); + if (resumeDrive.includes('indexbot')) { + const resumeBotRes = yield axios_1.default.get(resumeDrive, { headers: headers_1.headers }); + const resumeBotToken = resumeBotRes.data.match(/formData\.append\('token', '([a-f0-9]+)'\)/)[1]; + const resumeBotBody = new FormData(); + resumeBotBody.append('token', resumeBotToken); + const resumeBotPath = resumeBotRes.data.match(/fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/)[1]; + const resumeBotBaseUrl = resumeDrive.split('/download')[0]; + // console.log( + // 'resumeBotPath', + // resumeBotBaseUrl + '/download?id=' + resumeBotPath, + // ); + // console.log('resumeBotBody', resumeBotToken); + const resumeBotDownload = yield fetch(resumeBotBaseUrl + '/download?id=' + resumeBotPath, { + method: 'POST', + body: resumeBotBody, + headers: { + Referer: resumeDrive, + Cookie: 'PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308', + }, + }); + const resumeBotDownloadData = yield resumeBotDownload.json(); + console.log('resumeBotDownloadData', resumeBotDownloadData.url); streamLinks.push({ - server: 'Gdrive-Instant', - link: instantLink, + server: 'ResumeBot', + link: resumeBotDownloadData.url, type: 'mkv', }); } else { - console.log('Instant link not found', instantLinkData); + const url = baseUrl + resumeDrive; + const resumeDriveRes = yield axios_1.default.get(url, { headers: headers_1.headers }); + 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 seed = $drive('.btn-danger').attr('href') || ''; + console.log('seed', seed); + if (!seed.includes('?url=')) { + const newLinkRes = yield axios_1.default.head(seed, { headers: headers_1.headers, signal }); + console.log('newLinkRes', (_e = newLinkRes.request) === null || _e === void 0 ? void 0 : _e.responseURL); + const newLink = ((_h = (_g = (_f = newLinkRes.request) === null || _f === void 0 ? void 0 : _f.responseURL) === null || _g === void 0 ? void 0 : _g.split('?url=')) === null || _h === void 0 ? void 0 : _h[1]) || seed; + streamLinks.push({ server: 'G-Drive', link: newLink, type: 'mkv' }); + } + else { + 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; } - catch (err) { - console.log('Instant link not found', err); + catch (error) { + console.log('gdflix error: ', error); + return []; } - return streamLinks; - } - catch (error) { - console.log('gdflix error: ', error); - return []; - } + }); } diff --git a/dist/getBaseUrl.js b/dist/getBaseUrl.js index 8f42fa3..81dd596 100644 --- a/dist/getBaseUrl.js +++ b/dist/getBaseUrl.js @@ -1,10 +1,19 @@ "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.getBaseUrl = void 0; const storage_1 = require("../storage"); // 1 hour const expireTime = 60 * 60 * 1000; -const getBaseUrl = async (providerValue) => { +const getBaseUrl = (providerValue) => __awaiter(void 0, void 0, void 0, function* () { try { let baseUrl = ''; const cacheKey = 'CacheBaseUrl' + providerValue; @@ -17,8 +26,8 @@ const getBaseUrl = async (providerValue) => { baseUrl = cachedUrl; } else { - const baseUrlRes = await fetch('https://himanshu8443.github.io/providers/modflix.json'); - const baseUrlData = await baseUrlRes.json(); + const baseUrlRes = yield fetch('https://himanshu8443.github.io/providers/modflix.json'); + const baseUrlData = yield baseUrlRes.json(); baseUrl = baseUrlData[providerValue].url; storage_1.cacheStorageService.setString(cacheKey, baseUrl); storage_1.cacheStorageService.setObject(timeKey, Date.now()); @@ -29,5 +38,5 @@ const getBaseUrl = async (providerValue) => { console.error(`Error fetching baseUrl: ${providerValue}`, error); return ''; } -}; +}); exports.getBaseUrl = getBaseUrl; diff --git a/dist/gofileExtracter.js b/dist/gofileExtracter.js index 246fff2..5ea2122 100644 --- a/dist/gofileExtracter.js +++ b/dist/gofileExtracter.js @@ -1,37 +1,48 @@ "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()); + }); +}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.gofileExtracter = gofileExtracter; const axios_1 = __importDefault(require("axios")); -async function gofileExtracter(id) { - try { - const gofileRes = await axios_1.default.get('https://gofile.io/d/' + id); - const genAccountres = await axios_1.default.post('https://api.gofile.io/accounts'); - const token = genAccountres.data.data.token; - console.log('gofile token', token); - const wtRes = await axios_1.default.get('https://gofile.io/dist/js/global.js'); - const wt = wtRes.data.match(/appdata\.wt\s*=\s*["']([^"']+)["']/)[1]; - console.log('gofile wt', wt); - const res = await axios_1.default.get(`https://api.gofile.io/contents/${id}?wt=${wt}`, { - headers: { - Authorization: `Bearer ${token}`, - }, - }); - const oId = Object.keys(res.data.data.children)[0]; - console.log('gofile extracter', res.data.data.children[oId].link); - const link = res.data.data.children[oId].link; - return { - link, - token, - }; - } - catch (e) { - console.log('gofile extracter err', e); - return { - link: '', - token: '', - }; - } +function gofileExtracter(id) { + return __awaiter(this, void 0, void 0, function* () { + try { + const gofileRes = yield axios_1.default.get('https://gofile.io/d/' + id); + const genAccountres = yield axios_1.default.post('https://api.gofile.io/accounts'); + const token = genAccountres.data.data.token; + console.log('gofile token', token); + const wtRes = yield axios_1.default.get('https://gofile.io/dist/js/global.js'); + const wt = wtRes.data.match(/appdata\.wt\s*=\s*["']([^"']+)["']/)[1]; + console.log('gofile wt', wt); + const res = yield axios_1.default.get(`https://api.gofile.io/contents/${id}?wt=${wt}`, { + headers: { + Authorization: `Bearer ${token}`, + }, + }); + const oId = Object.keys(res.data.data.children)[0]; + console.log('gofile extracter', res.data.data.children[oId].link); + const link = res.data.data.children[oId].link; + return { + link, + token, + }; + } + catch (e) { + console.log('gofile extracter err', e); + return { + link: '', + token: '', + }; + } + }); } diff --git a/dist/guardahd/meta.js b/dist/guardahd/meta.js index a78d2a1..6349003 100644 --- a/dist/guardahd/meta.js +++ b/dist/guardahd/meta.js @@ -1,89 +1,99 @@ "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 getMeta = async function ({ link, providerContext, }) { - const axios = providerContext.axios; - try { - console.log("all", link); - const res = await axios.get(link); - const data = res.data; - const meta = { - title: "", - synopsis: "", - image: "", - imdbId: data?.meta?.imdb_id || "", - type: data?.meta?.type || "movie", - }; - const links = []; - let directLinks = []; - let season = new Map(); - if (meta.type === "series") { - data?.meta?.videos?.map((video) => { - if (video?.season <= 0) - return; - if (!season.has(video?.season)) { - season.set(video?.season, []); - } - season.get(video?.season).push({ - title: "Episode " + video?.episode, - type: "series", - link: JSON.stringify({ - title: data?.meta?.name, - imdbId: data?.meta?.imdb_id, - season: video?.id?.split(":")[1], - episode: video?.id?.split(":")[2], - type: data?.meta?.type, - tmdbId: data?.meta?.moviedb_id?.toString() || "", - year: data?.meta?.year, - }), - }); - }); - const keys = Array.from(season.keys()); - keys.sort(); - keys.map((key) => { - directLinks = season.get(key); - links.push({ - title: `Season ${key}`, - directLinks: directLinks, - }); - }); - } - else { - console.log("all meta Mv🔥🔥", meta); - links.push({ - title: data?.meta?.name, - directLinks: [ - { - title: "Movie", - type: "movie", +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { + var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; + const axios = providerContext.axios; + try { + console.log("all", link); + const res = yield axios.get(link); + const data = res.data; + const meta = { + title: "", + synopsis: "", + image: "", + imdbId: ((_b = data === null || data === void 0 ? void 0 : data.meta) === null || _b === void 0 ? void 0 : _b.imdb_id) || "", + type: ((_c = data === null || data === void 0 ? void 0 : data.meta) === null || _c === void 0 ? void 0 : _c.type) || "movie", + }; + const links = []; + let directLinks = []; + let season = new Map(); + if (meta.type === "series") { + (_e = (_d = data === null || data === void 0 ? void 0 : data.meta) === null || _d === void 0 ? void 0 : _d.videos) === null || _e === void 0 ? void 0 : _e.map((video) => { + var _a, _b, _c, _d, _e, _f, _g, _h; + if ((video === null || video === void 0 ? void 0 : video.season) <= 0) + return; + if (!season.has(video === null || video === void 0 ? void 0 : video.season)) { + season.set(video === null || video === void 0 ? void 0 : video.season, []); + } + season.get(video === null || video === void 0 ? void 0 : video.season).push({ + title: "Episode " + (video === null || video === void 0 ? void 0 : video.episode), + type: "series", link: JSON.stringify({ - title: data?.meta?.name, - imdbId: data?.meta?.imdb_id, - season: "", - episode: "", - type: data?.meta?.type, - tmdbId: data?.meta?.moviedb_id?.toString() || "", - year: data?.meta?.year, + title: (_a = data === null || data === void 0 ? void 0 : data.meta) === null || _a === void 0 ? void 0 : _a.name, + imdbId: (_b = data === null || data === void 0 ? void 0 : data.meta) === null || _b === void 0 ? void 0 : _b.imdb_id, + season: (_c = video === null || video === void 0 ? void 0 : video.id) === null || _c === void 0 ? void 0 : _c.split(":")[1], + episode: (_d = video === null || video === void 0 ? void 0 : video.id) === null || _d === void 0 ? void 0 : _d.split(":")[2], + type: (_e = data === null || data === void 0 ? void 0 : data.meta) === null || _e === void 0 ? void 0 : _e.type, + tmdbId: ((_g = (_f = data === null || data === void 0 ? void 0 : data.meta) === null || _f === void 0 ? void 0 : _f.moviedb_id) === null || _g === void 0 ? void 0 : _g.toString()) || "", + year: (_h = data === null || data === void 0 ? void 0 : data.meta) === null || _h === void 0 ? void 0 : _h.year, }), - }, - ], - }); + }); + }); + const keys = Array.from(season.keys()); + keys.sort(); + keys.map((key) => { + directLinks = season.get(key); + links.push({ + title: `Season ${key}`, + directLinks: directLinks, + }); + }); + } + else { + console.log("all meta Mv🔥🔥", meta); + links.push({ + title: (_f = data === null || data === void 0 ? void 0 : data.meta) === null || _f === void 0 ? void 0 : _f.name, + directLinks: [ + { + title: "Movie", + type: "movie", + link: JSON.stringify({ + title: (_g = data === null || data === void 0 ? void 0 : data.meta) === null || _g === void 0 ? void 0 : _g.name, + imdbId: (_h = data === null || data === void 0 ? void 0 : data.meta) === null || _h === void 0 ? void 0 : _h.imdb_id, + season: "", + episode: "", + type: (_j = data === null || data === void 0 ? void 0 : data.meta) === null || _j === void 0 ? void 0 : _j.type, + tmdbId: ((_l = (_k = data === null || data === void 0 ? void 0 : data.meta) === null || _k === void 0 ? void 0 : _k.moviedb_id) === null || _l === void 0 ? void 0 : _l.toString()) || "", + year: (_m = data === null || data === void 0 ? void 0 : data.meta) === null || _m === void 0 ? void 0 : _m.year, + }), + }, + ], + }); + } + return Object.assign(Object.assign({}, meta), { linkList: links }); } - return { - ...meta, - linkList: links, - }; - } - catch (err) { - console.error(err); - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "movie", - linkList: [], - }; - } + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/guardahd/posts.js b/dist/guardahd/posts.js index 3fddbf2..2fb59be 100644 --- a/dist/guardahd/posts.js +++ b/dist/guardahd/posts.js @@ -1,66 +1,79 @@ "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 getPosts = async function ({ filter, signal, providerContext, }) { - try { - const catalog = []; - const url = "https://cinemeta-catalogs.strem.io" + filter; - console.log("allGetPostUrl", url); - const res = await providerContext.axios.get(url, { - headers: providerContext.commonHeaders, - signal, - }); - const data = res.data; - data?.metas.map((result) => { - const title = result?.name; - const id = result?.imdb_id || result?.id; - const type = result?.type; - const image = result?.poster; - if (id) { - catalog.push({ - title: title, - link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`, - image: image, - }); - } - }); - console.log("catalog", catalog.length); - return catalog; - } - catch (err) { - console.error("AutoEmbed error ", err); - return []; - } -}; -exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) { - try { - const { axios, commonHeaders: headers } = providerContext; - if (page > 1) { +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, signal, providerContext, }) { + try { + const catalog = []; + const url = "https://cinemeta-catalogs.strem.io" + filter; + console.log("allGetPostUrl", url); + const res = yield providerContext.axios.get(url, { + headers: providerContext.commonHeaders, + signal, + }); + const data = res.data; + data === null || data === void 0 ? void 0 : data.metas.map((result) => { + const title = result === null || result === void 0 ? void 0 : result.name; + const id = (result === null || result === void 0 ? void 0 : result.imdb_id) || (result === null || result === void 0 ? void 0 : result.id); + const type = result === null || result === void 0 ? void 0 : result.type; + const image = result === null || result === void 0 ? void 0 : result.poster; + if (id) { + catalog.push({ + title: title, + link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`, + image: image, + }); + } + }); + console.log("catalog", catalog.length); + return catalog; + } + catch (err) { + console.error("AutoEmbed error ", err); return []; } - const catalog = []; - const url2 = `https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(searchQuery)}.json`; - const res2 = await axios.get(url2, { headers, signal }); - const data2 = res2.data; - data2?.metas.map((result) => { - const title = result?.name || ""; - const id = result?.imdb_id || result?.id; - const image = result?.poster; - const type = result?.type; - if (id) { - catalog.push({ - title: title, - link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`, - image: image, - }); + }); +}; +exports.getPosts = getPosts; +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) { + try { + const { axios, commonHeaders: headers } = providerContext; + if (page > 1) { + return []; } - }); - return catalog; - } - catch (err) { - console.error("AutoEmbed error ", err); - return []; - } + const catalog = []; + const url2 = `https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(searchQuery)}.json`; + const res2 = yield axios.get(url2, { headers, signal }); + const data2 = res2.data; + data2 === null || data2 === void 0 ? void 0 : data2.metas.map((result) => { + const title = (result === null || result === void 0 ? void 0 : result.name) || ""; + const id = (result === null || result === void 0 ? void 0 : result.imdb_id) || (result === null || result === void 0 ? void 0 : result.id); + const image = result === null || result === void 0 ? void 0 : result.poster; + const type = result === null || result === void 0 ? void 0 : result.type; + if (id) { + catalog.push({ + title: title, + link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + console.error("AutoEmbed error ", err); + return []; + } + }); }; exports.getSearchPosts = getSearchPosts; diff --git a/dist/guardahd/stream.js b/dist/guardahd/stream.js index 729758f..52ac9a9 100644 --- a/dist/guardahd/stream.js +++ b/dist/guardahd/stream.js @@ -1,102 +1,117 @@ "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 function ({ link: id, type, providerContext, }) { - try { - const { axios, cheerio, extractors } = providerContext; - const { superVideoExtractor } = extractors; - async function ExtractGuardahd({ imdb, // type, // season, - }) { - try { - const baseUrl = "https://guardahd.stream"; - const path = "/set-movie-a/" + imdb; - const url = baseUrl + path; - console.log("url:", url); - const res = await axios.get(url, { timeout: 4000 }); - const html = res.data; - const $ = cheerio.load(html); - const superVideoUrl = $('li:contains("supervideo")').attr("data-link"); - console.log("superVideoUrl:", superVideoUrl); - if (!superVideoUrl) { - return null; - } - const controller2 = new AbortController(); - const signal2 = controller2.signal; - setTimeout(() => controller2.abort(), 4000); - const res2 = await fetch("https:" + superVideoUrl, { signal: signal2 }); - const data = await res2.text(); - // console.log('mostraguarda data:', data); - const streamUrl = await superVideoExtractor(data); - return streamUrl; +const getStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link: id, type, providerContext, }) { + try { + const { axios, cheerio, extractors } = providerContext; + const { superVideoExtractor } = extractors; + function ExtractGuardahd(_a) { + return __awaiter(this, arguments, void 0, function* ({ imdb, // type, // season, + }) { + try { + const baseUrl = "https://guardahd.stream"; + const path = "/set-movie-a/" + imdb; + const url = baseUrl + path; + console.log("url:", url); + const res = yield axios.get(url, { timeout: 4000 }); + const html = res.data; + const $ = cheerio.load(html); + const superVideoUrl = $('li:contains("supervideo")').attr("data-link"); + console.log("superVideoUrl:", superVideoUrl); + if (!superVideoUrl) { + return null; + } + const controller2 = new AbortController(); + const signal2 = controller2.signal; + setTimeout(() => controller2.abort(), 4000); + const res2 = yield fetch("https:" + superVideoUrl, { signal: signal2 }); + const data = yield res2.text(); + // console.log('mostraguarda data:', data); + const streamUrl = yield superVideoExtractor(data); + return streamUrl; + } + catch (err) { + console.error("Error in GetMostraguardaStram:", err); + } + }); } - catch (err) { - console.error("Error in GetMostraguardaStram:", err); + function GetMostraguardaStream(_a) { + return __awaiter(this, arguments, void 0, function* ({ imdb, type, season, episode, }) { + try { + const baseUrl = "https://mostraguarda.stream"; + const path = type === "tv" + ? `/serie/${imdb}/${season}/${episode}` + : `/movie/${imdb}`; + const url = baseUrl + path; + console.log("url:", url); + const res = yield axios(url, { timeout: 4000 }); + const html = res.data; + const $ = cheerio.load(html); + const superVideoUrl = $('li:contains("supervideo")').attr("data-link"); + console.log("superVideoUrl:", superVideoUrl); + if (!superVideoUrl) { + return null; + } + const controller2 = new AbortController(); + const signal2 = controller2.signal; + setTimeout(() => controller2.abort(), 4000); + const res2 = yield fetch("https:" + superVideoUrl, { signal: signal2 }); + const data = yield res2.text(); + // console.log('mostraguarda data:', data); + const streamUrl = yield superVideoExtractor(data); + return streamUrl; + } + catch (err) { + console.error("Error in GetMostraguardaStram:", err); + } + }); } - } - async function GetMostraguardaStream({ imdb, type, season, episode, }) { - try { - const baseUrl = "https://mostraguarda.stream"; - const path = type === "tv" - ? `/serie/${imdb}/${season}/${episode}` - : `/movie/${imdb}`; - const url = baseUrl + path; - console.log("url:", url); - const res = await axios(url, { timeout: 4000 }); - const html = res.data; - const $ = cheerio.load(html); - const superVideoUrl = $('li:contains("supervideo")').attr("data-link"); - console.log("superVideoUrl:", superVideoUrl); - if (!superVideoUrl) { - return null; - } - const controller2 = new AbortController(); - const signal2 = controller2.signal; - setTimeout(() => controller2.abort(), 4000); - const res2 = await fetch("https:" + superVideoUrl, { signal: signal2 }); - const data = await res2.text(); - // console.log('mostraguarda data:', data); - const streamUrl = await superVideoExtractor(data); - return streamUrl; - } - catch (err) { - console.error("Error in GetMostraguardaStram:", err); - } - } - console.log(id); - const streams = []; - const { imdbId, season, episode } = JSON.parse(id); - ///// mostraguarda - const mostraguardaStream = await GetMostraguardaStream({ - imdb: imdbId, - type: type, - season: season, - episode: episode, - }); - if (mostraguardaStream) { - streams.push({ - server: "Supervideo 1", - link: mostraguardaStream, - type: "m3u8", + console.log(id); + const streams = []; + const { imdbId, season, episode } = JSON.parse(id); + ///// mostraguarda + const mostraguardaStream = yield GetMostraguardaStream({ + imdb: imdbId, + type: type, + season: season, + episode: episode, }); - } - const guardahdStream = await ExtractGuardahd({ - imdb: imdbId, - type: type, - season: season, - episode: episode, - }); - if (guardahdStream) { - streams.push({ - server: "Supervideo 2", - link: guardahdStream, - type: "m3u8", + if (mostraguardaStream) { + streams.push({ + server: "Supervideo 1", + link: mostraguardaStream, + type: "m3u8", + }); + } + const guardahdStream = yield ExtractGuardahd({ + imdb: imdbId, + type: type, + season: season, + episode: episode, }); + if (guardahdStream) { + streams.push({ + server: "Supervideo 2", + link: guardahdStream, + type: "m3u8", + }); + } + return streams; } - return streams; - } - catch (err) { - console.error(err); - return []; - } + catch (err) { + console.error(err); + return []; + } + }); }; exports.getStream = getStream; diff --git a/dist/hdhub4u/meta.js b/dist/hdhub4u/meta.js index 46ab5c1..2ab5e49 100644 --- a/dist/hdhub4u/meta.js +++ b/dist/hdhub4u/meta.js @@ -1,4 +1,13 @@ "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 = { @@ -6,110 +15,113 @@ const hdbHeaders = { 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 = async function ({ link, providerContext, }) { - try { - const { axios, cheerio } = providerContext; - const url = link; - const res = await axios.get(url, { headers: hdbHeaders }); - const data = res.data; - const $ = cheerio.load(data); - const container = $(".page-body"); - const imdbId = container - .find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])') - .attr("href") - ?.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) +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() - .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) { + .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.toLocaleUpperCase(), + 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, + }; } - if (directLink.length > 0) { - links.push({ - title: title, - directLinks: directLink, - }); + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; } - if (directLink.length === 0) { - container - .find('a:contains("480"),a:contains("720"),a:contains("1080"),a:contains("2160"),a:contains("4K")') - .map((i, element) => { - const quality = $(element) - .text() - .match(/\b(480p|720p|1080p|2160p)\b/i)?.[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; diff --git a/dist/hdhub4u/posts.js b/dist/hdhub4u/posts.js index 79d0387..67ad50e 100644 --- a/dist/hdhub4u/posts.js +++ b/dist/hdhub4u/posts.js @@ -1,4 +1,13 @@ "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 = { @@ -6,48 +15,54 @@ const hdbHeaders = { 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 = async function ({ filter, page, signal, providerContext, }) { - const { getBaseUrl } = providerContext; - const baseUrl = await getBaseUrl("hdhub"); - const url = `${baseUrl + filter}/page/${page}/`; - return posts({ url, signal, providerContext }); +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 = async function ({ searchQuery, page, signal, providerContext, }) { - const { getBaseUrl } = providerContext; - const baseUrl = await getBaseUrl("hdhub"); - const url = `${baseUrl}/page/${page}/?s=${searchQuery}`; - return posts({ url, signal, providerContext }); +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; -async function posts({ url, signal, providerContext, }) { - const { cheerio } = providerContext; - try { - const res = await fetch(url, { - headers: hdbHeaders, - signal, - }); - const data = await 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 []; - } +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 []; + } + }); } diff --git a/dist/hdhub4u/stream.js b/dist/hdhub4u/stream.js index fb75f53..3d9790b 100644 --- a/dist/hdhub4u/stream.js +++ b/dist/hdhub4u/stream.js @@ -1,51 +1,63 @@ "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; -async function getStream({ link, signal, providerContext, }) { - const { axios, cheerio, extractors, commonHeaders: headers, } = providerContext; - const { hubcloudExtracter } = extractors; - let hubdriveLink = ""; - if (link.includes("hubdrive")) { - const hubdriveRes = await 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 = await axios.get(link, { headers, signal }); - const text = res.data; - const encryptedString = text.split("s('o','")?.[1]?.split("',180")?.[0]; - const decodedString = decodeString(encryptedString); - link = atob(decodedString?.o); - const redirectLink = await getRedirectLinks(link, signal, headers); - const redirectLinkRes = await 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 = await axios.get(hubdriveLink, { headers, signal }); +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); + const $ = cheerio.load(hubdriveText); hubdriveLink = - $$(".btn.btn-primary.btn-user.btn-success1.m-1").attr("href") || - hubdriveLink; + $(".btn.btn-primary.btn-user.btn-success1.m-1").attr("href") || link; } - } - const hubdriveLinkRes = await axios.get(hubdriveLink, { headers, signal }); - const hubcloudText = hubdriveLinkRes.data; - const hubcloudLink = hubcloudText.match(//i)?.[1] || hubdriveLink; - try { - return await hubcloudExtracter(hubcloudLink, signal); - } - catch (error) { - console.log("hd hub 4 getStream error: ", error); - return []; - } + 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(//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()); @@ -78,49 +90,51 @@ const abortableTimeout = (ms, { signal } = {}) => { } }); }; -async function getRedirectLinks(link, signal, headers) { - try { - const res = await fetch(link, { headers, signal }); - const resText = await 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?.data); - const blogLink = data?.wp_http1 + "?re=" + token; - // abort timeout on signal - let wait = abortableTimeout((Number(data?.total_time) + 3) * 1000, { - signal, - }); - await wait; - console.log("blogLink", blogLink); - let vcloudLink = "Invalid Request"; - while (vcloudLink.includes("Invalid Request")) { - const blogRes = await fetch(blogLink, { headers, signal }); - const blogResText = (await blogRes.text()); - if (blogResText.includes("Invalid Request")) { - console.log(blogResText); +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]; } - else { - vcloudLink = blogResText.match(/var reurl = "([^"]+)"/) || ""; - break; + // 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; } - // console.log('vcloudLink', vcloudLink?.[1]); - return blogLink || link; - } - catch (err) { - console.log("Error in getRedirectLinks", err); - return link; - } + catch (err) { + console.log("Error in getRedirectLinks", err); + return link; + } + }); } function rot13(str) { return str.replace(/[a-zA-Z]/g, function (char) { diff --git a/dist/hiAnime/meta.js b/dist/hiAnime/meta.js index 235a299..3df6a86 100644 --- a/dist/hiAnime/meta.js +++ b/dist/hiAnime/meta.js @@ -1,78 +1,86 @@ "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 getMeta = async function ({ link, providerContext, }) { - try { - const { getBaseUrl, axios } = providerContext; - const baseUrl = await getBaseUrl("consumet"); - const url = `${baseUrl}/anime/zoro/info?id=` + link; - const res = await axios.get(url); - const data = res.data; - const meta = { - title: data.title, - synopsis: data.description, - image: data.image, - tags: [ - data?.type, - data?.subOrDub === "both" ? "Sub And Dub" : data?.subOrDub, - ], - imdbId: "", - type: data.episodes.length > 0 ? "series" : "movie", - }; - const linkList = []; - const subLinks = []; - data.episodes.forEach((episode) => { - if (!episode?.isSubbed) { - return; - } - const title = "Episode " + episode.number + (episode?.isFiller ? " (Filler)" : ""); - const link = episode.id + "$sub"; - if (link && title) { - subLinks.push({ - title, - link, - }); - } - }); - linkList.push({ - title: meta.title + " (Sub)", - directLinks: subLinks, - }); - if (data?.subOrDub === "both") { - const dubLinks = []; +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { + try { + const { getBaseUrl, axios } = providerContext; + const baseUrl = yield getBaseUrl("consumet"); + const url = `${baseUrl}/anime/zoro/info?id=` + link; + const res = yield axios.get(url); + const data = res.data; + const meta = { + title: data.title, + synopsis: data.description, + image: data.image, + tags: [ + data === null || data === void 0 ? void 0 : data.type, + (data === null || data === void 0 ? void 0 : data.subOrDub) === "both" ? "Sub And Dub" : data === null || data === void 0 ? void 0 : data.subOrDub, + ], + imdbId: "", + type: data.episodes.length > 0 ? "series" : "movie", + }; + const linkList = []; + const subLinks = []; data.episodes.forEach((episode) => { - if (!episode?.isDubbed) { + if (!(episode === null || episode === void 0 ? void 0 : episode.isSubbed)) { return; } - const title = "Episode " + episode.number + (episode?.isFiller ? " (Filler)" : ""); - const link = episode.id + "$dub"; + const title = "Episode " + episode.number + ((episode === null || episode === void 0 ? void 0 : episode.isFiller) ? " (Filler)" : ""); + const link = episode.id + "$sub"; if (link && title) { - dubLinks.push({ + subLinks.push({ title, link, }); } }); linkList.push({ - title: meta.title + " (Dub)", - directLinks: dubLinks, + title: meta.title + " (Sub)", + directLinks: subLinks, }); + if ((data === null || data === void 0 ? void 0 : data.subOrDub) === "both") { + const dubLinks = []; + data.episodes.forEach((episode) => { + if (!(episode === null || episode === void 0 ? void 0 : episode.isDubbed)) { + return; + } + const title = "Episode " + episode.number + ((episode === null || episode === void 0 ? void 0 : episode.isFiller) ? " (Filler)" : ""); + const link = episode.id + "$dub"; + if (link && title) { + dubLinks.push({ + title, + link, + }); + } + }); + linkList.push({ + title: meta.title + " (Dub)", + directLinks: dubLinks, + }); + } + return Object.assign(Object.assign({}, meta), { linkList: linkList }); } - return { - ...meta, - linkList: linkList, - }; - } - catch (err) { - console.error(err); - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "movie", - linkList: [], - }; - } + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/hiAnime/posts.js b/dist/hiAnime/posts.js index 072b1a7..fb78271 100644 --- a/dist/hiAnime/posts.js +++ b/dist/hiAnime/posts.js @@ -1,41 +1,57 @@ "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 getPosts = async function ({ filter, page, signal, providerContext, }) { - const { getBaseUrl, axios } = providerContext; - const baseUrl = await getBaseUrl("consumet"); - const url = `${baseUrl + filter}?page=${page}`; - return posts({ url, signal, axios }); +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, signal, providerContext, }) { + const { getBaseUrl, axios } = providerContext; + const baseUrl = yield getBaseUrl("consumet"); + const url = `${baseUrl + filter}?page=${page}`; + return posts({ url, signal, axios }); + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) { - const { getBaseUrl, axios } = providerContext; - const baseUrl = await getBaseUrl("consumet"); - const url = `${baseUrl}/anime/zoro/${searchQuery}?page=${page}`; - return posts({ url, signal, axios }); +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) { + const { getBaseUrl, axios } = providerContext; + const baseUrl = yield getBaseUrl("consumet"); + const url = `${baseUrl}/anime/zoro/${searchQuery}?page=${page}`; + return posts({ url, signal, axios }); + }); }; exports.getSearchPosts = getSearchPosts; -async function posts({ url, signal, axios, }) { - try { - const res = await axios.get(url, { signal }); - const data = res.data?.results; - const catalog = []; - data?.map((element) => { - const title = element.title; - const link = element.id; - const image = element.image; - if (title && link && image) { - catalog.push({ - title: title, - link: link, - image: image, - }); - } - }); - return catalog; - } - catch (err) { - console.error("zoro error ", err); - return []; - } +function posts(_a) { + return __awaiter(this, arguments, void 0, function* ({ url, signal, axios, }) { + var _b; + try { + const res = yield axios.get(url, { signal }); + const data = (_b = res.data) === null || _b === void 0 ? void 0 : _b.results; + const catalog = []; + data === null || data === void 0 ? void 0 : data.map((element) => { + const title = element.title; + const link = element.id; + const image = element.image; + if (title && link && image) { + catalog.push({ + title: title, + link: link, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + console.error("zoro error ", err); + return []; + } + }); } diff --git a/dist/hiAnime/stream.js b/dist/hiAnime/stream.js index 4062675..8d01487 100644 --- a/dist/hiAnime/stream.js +++ b/dist/hiAnime/stream.js @@ -1,54 +1,67 @@ "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 types_1 = require("../types"); -const getStream = async function ({ link: id, providerContext, }) { - try { - const { getBaseUrl, axios } = providerContext; - const baseUrl = await getBaseUrl("consumet"); - const servers = ["vidcloud", "vidstreaming"]; - const url = `${baseUrl}/anime/zoro/watch?episodeId=${id}&server=`; - const streamLinks = []; - await Promise.all(servers.map(async (server) => { - try { - const res = await axios.get(url + server); - if (res.data) { - const subtitles = []; - res.data?.subtitles.forEach((sub) => { - if (sub?.lang === "Thumbnails") - return; - subtitles.push({ - language: sub?.lang?.slice(0, 2) || "Und", - uri: sub?.url, - title: sub?.lang || "Undefined", - type: sub?.url?.endsWith(".vtt") - ? types_1.TextTrackType.VTT - : types_1.TextTrackType.SUBRIP, +const getStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link: id, providerContext, }) { + try { + const { getBaseUrl, axios } = providerContext; + const baseUrl = yield getBaseUrl("consumet"); + const servers = ["vidcloud", "vidstreaming"]; + const url = `${baseUrl}/anime/zoro/watch?episodeId=${id}&server=`; + const streamLinks = []; + yield Promise.all(servers.map((server) => __awaiter(this, void 0, void 0, function* () { + var _a, _b; + try { + const res = yield axios.get(url + server); + if (res.data) { + const subtitles = []; + (_a = res.data) === null || _a === void 0 ? void 0 : _a.subtitles.forEach((sub) => { + var _a, _b; + if ((sub === null || sub === void 0 ? void 0 : sub.lang) === "Thumbnails") + return; + subtitles.push({ + language: ((_a = sub === null || sub === void 0 ? void 0 : sub.lang) === null || _a === void 0 ? void 0 : _a.slice(0, 2)) || "Und", + uri: sub === null || sub === void 0 ? void 0 : sub.url, + title: (sub === null || sub === void 0 ? void 0 : sub.lang) || "Undefined", + type: ((_b = sub === null || sub === void 0 ? void 0 : sub.url) === null || _b === void 0 ? void 0 : _b.endsWith(".vtt")) + ? types_1.TextTrackType.VTT + : types_1.TextTrackType.SUBRIP, + }); }); - }); - res.data?.sources.forEach((source) => { - streamLinks.push({ - server: server, - link: source?.url, - type: source?.isM3U8 ? "m3u8" : "mp4", - headers: { - Referer: "https://megacloud.club/", - Origin: "https://megacloud.club", - }, - subtitles: subtitles, + (_b = res.data) === null || _b === void 0 ? void 0 : _b.sources.forEach((source) => { + streamLinks.push({ + server: server, + link: source === null || source === void 0 ? void 0 : source.url, + type: (source === null || source === void 0 ? void 0 : source.isM3U8) ? "m3u8" : "mp4", + headers: { + Referer: "https://megacloud.club/", + Origin: "https://megacloud.club", + }, + subtitles: subtitles, + }); }); - }); + } } - } - catch (e) { - console.log(e); - } - })); - return streamLinks; - } - catch (err) { - console.error(err); - return []; - } + catch (e) { + console.log(e); + } + }))); + return streamLinks; + } + catch (err) { + console.error(err); + return []; + } + }); }; exports.getStream = getStream; diff --git a/dist/hubcloudExtractor.js b/dist/hubcloudExtractor.js index 77df343..3301b10 100644 --- a/dist/hubcloudExtractor.js +++ b/dist/hubcloudExtractor.js @@ -32,6 +32,15 @@ var __importStar = (this && this.__importStar) || (function () { return result; }; })(); +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()); + }); +}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; @@ -46,75 +55,78 @@ const decode = function (value) { } return atob(value.toString()); }; -async function hubcloudExtracter(link, signal) { - try { - console.log('hubcloudExtracter', link); - const baseUrl = link.split('/').slice(0, 3).join('/'); - const streamLinks = []; - const vLinkRes = await (0, axios_1.default)(`${link}`, { headers: headers_1.headers, signal }); - const vLinkText = vLinkRes.data; - const $vLink = cheerio.load(vLinkText); - const vLinkRedirect = vLinkText.match(/var\s+url\s*=\s*'([^']+)';/) || []; - let vcloudLink = decode(vLinkRedirect[1]?.split('r=')?.[1]) || - vLinkRedirect[1] || - $vLink('.fa-file-download.fa-lg').parent().attr('href') || - link; - console.log('vcloudLink', vcloudLink); - if (vcloudLink?.startsWith('/')) { - vcloudLink = `${baseUrl}${vcloudLink}`; - console.log('New vcloudLink', vcloudLink); +function hubcloudExtracter(link, signal) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c, _d, _e; + try { + console.log('hubcloudExtracter', link); + const baseUrl = link.split('/').slice(0, 3).join('/'); + const streamLinks = []; + const vLinkRes = yield (0, axios_1.default)(`${link}`, { headers: headers_1.headers, signal }); + const vLinkText = vLinkRes.data; + const $vLink = cheerio.load(vLinkText); + const vLinkRedirect = vLinkText.match(/var\s+url\s*=\s*'([^']+)';/) || []; + let vcloudLink = decode((_b = (_a = vLinkRedirect[1]) === null || _a === void 0 ? void 0 : _a.split('r=')) === null || _b === void 0 ? void 0 : _b[1]) || + vLinkRedirect[1] || + $vLink('.fa-file-download.fa-lg').parent().attr('href') || + link; + console.log('vcloudLink', vcloudLink); + if (vcloudLink === null || vcloudLink === void 0 ? void 0 : vcloudLink.startsWith('/')) { + vcloudLink = `${baseUrl}${vcloudLink}`; + console.log('New vcloudLink', vcloudLink); + } + const vcloudRes = yield fetch(vcloudLink, { + headers: headers_1.headers, + signal, + redirect: 'follow', + }); + const $ = cheerio.load(yield vcloudRes.text()); + // console.log('vcloudRes', $.text()); + const linkClass = $('.btn-success.btn-lg.h6,.btn-danger,.btn-secondary'); + for (const element of linkClass) { + const itm = $(element); + let link = itm.attr('href') || ''; + if ((link === null || link === void 0 ? void 0 : link.includes('.dev')) && !(link === null || link === void 0 ? void 0 : link.includes('/?id='))) { + streamLinks.push({ server: 'Cf Worker', link: link, type: 'mkv' }); + } + if (link === null || link === void 0 ? void 0 : link.includes('pixeld')) { + if (!(link === null || link === void 0 ? void 0 : link.includes('api'))) { + const token = link.split('/').pop(); + const baseUrl = link.split('/').slice(0, -2).join('/'); + link = `${baseUrl}/api/file/${token}?download`; + } + streamLinks.push({ server: 'Pixeldrain', link: link, type: 'mkv' }); + } + if ((link === null || link === void 0 ? void 0 : link.includes('hubcloud')) || (link === null || link === void 0 ? void 0 : link.includes('/?id='))) { + try { + const newLinkRes = yield axios_1.default.head(link, { headers: headers_1.headers, signal }); + const newLink = ((_e = (_d = (_c = newLinkRes.request) === null || _c === void 0 ? void 0 : _c.responseURL) === null || _d === void 0 ? void 0 : _d.split('link=')) === null || _e === void 0 ? void 0 : _e[1]) || link; + streamLinks.push({ server: 'hubcloud', link: newLink, type: 'mkv' }); + } + catch (error) { + console.log('hubcloudExtracter error in hubcloud link: ', error); + } + } + if (link === null || link === void 0 ? void 0 : link.includes('cloudflarestorage')) { + streamLinks.push({ server: 'CfStorage', link: link, type: 'mkv' }); + } + if (link === null || link === void 0 ? void 0 : link.includes('fastdl')) { + streamLinks.push({ server: 'FastDl', link: link, type: 'mkv' }); + } + if (link.includes('hubcdn')) { + streamLinks.push({ + server: 'HubCdn', + link: link, + type: 'mkv', + }); + } + } + console.log('streamLinks', streamLinks); + return streamLinks; } - const vcloudRes = await fetch(vcloudLink, { - headers: headers_1.headers, - signal, - redirect: 'follow', - }); - const $ = cheerio.load(await vcloudRes.text()); - // console.log('vcloudRes', $.text()); - const linkClass = $('.btn-success.btn-lg.h6,.btn-danger,.btn-secondary'); - for (const element of linkClass) { - const itm = $(element); - let link = itm.attr('href') || ''; - if (link?.includes('.dev') && !link?.includes('/?id=')) { - streamLinks.push({ server: 'Cf Worker', link: link, type: 'mkv' }); - } - if (link?.includes('pixeld')) { - if (!link?.includes('api')) { - const token = link.split('/').pop(); - const baseUrl = link.split('/').slice(0, -2).join('/'); - link = `${baseUrl}/api/file/${token}?download`; - } - streamLinks.push({ server: 'Pixeldrain', link: link, type: 'mkv' }); - } - if (link?.includes('hubcloud') || link?.includes('/?id=')) { - try { - const newLinkRes = await axios_1.default.head(link, { headers: headers_1.headers, signal }); - const newLink = newLinkRes.request?.responseURL?.split('link=')?.[1] || link; - streamLinks.push({ server: 'hubcloud', link: newLink, type: 'mkv' }); - } - catch (error) { - console.log('hubcloudExtracter error in hubcloud link: ', error); - } - } - if (link?.includes('cloudflarestorage')) { - streamLinks.push({ server: 'CfStorage', link: link, type: 'mkv' }); - } - if (link?.includes('fastdl')) { - streamLinks.push({ server: 'FastDl', link: link, type: 'mkv' }); - } - if (link.includes('hubcdn')) { - streamLinks.push({ - server: 'HubCdn', - link: link, - type: 'mkv', - }); - } + catch (error) { + console.log('hubcloudExtracter error: ', error); + return []; } - console.log('streamLinks', streamLinks); - return streamLinks; - } - catch (error) { - console.log('hubcloudExtracter error: ', error); - return []; - } + }); } diff --git a/dist/katmovies/episodes.js b/dist/katmovies/episodes.js index 03b1e4d..8c95b93 100644 --- a/dist/katmovies/episodes.js +++ b/dist/katmovies/episodes.js @@ -1,70 +1,86 @@ "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.getEpisodes = void 0; exports.extractKmhdLink = extractKmhdLink; -const getEpisodes = async function ({ url, providerContext, }) { - const { axios, cheerio } = providerContext; - const episodesLink = []; - try { - if (url.includes("gdflix")) { - const baseUrl = url.split("/pack")?.[0]; - const res = await axios.get(url); - const data = res.data; - const $ = cheerio.load(data); - const links = $(".list-group-item"); - links?.map((i, link) => { - episodesLink.push({ - title: $(link).text() || "", - link: baseUrl + $(link).find("a").attr("href") || "", +const getEpisodes = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) { + var _b; + const { axios, cheerio } = providerContext; + const episodesLink = []; + try { + if (url.includes("gdflix")) { + const baseUrl = (_b = url.split("/pack")) === null || _b === void 0 ? void 0 : _b[0]; + const res = yield axios.get(url); + const data = res.data; + const $ = cheerio.load(data); + const links = $(".list-group-item"); + links === null || links === void 0 ? void 0 : links.map((i, link) => { + episodesLink.push({ + title: $(link).text() || "", + link: baseUrl + $(link).find("a").attr("href") || "", + }); }); - }); - if (episodesLink.length > 0) { - return episodesLink; + if (episodesLink.length > 0) { + return episodesLink; + } } - } - if (url.includes("/pack")) { - const epIds = await extractKmhdEpisodes(url, providerContext); - epIds?.forEach((id, index) => { + if (url.includes("/pack")) { + const epIds = yield extractKmhdEpisodes(url, providerContext); + epIds === null || epIds === void 0 ? void 0 : epIds.forEach((id, index) => { + episodesLink.push({ + title: `Episode ${index + 1}`, + link: url.split("/pack")[0] + "/file/" + id, + }); + }); + } + const res = yield axios.get(url, { + headers: { + Cookie: "_ga_GNR438JY8N=GS1.1.1722240350.5.0.1722240350.0.0.0; _ga=GA1.1.372196696.1722150754; unlocked=true", + }, + }); + const episodeData = res.data; + const $ = cheerio.load(episodeData); + const links = $(".autohyperlink"); + links === null || links === void 0 ? void 0 : links.map((i, link) => { episodesLink.push({ - title: `Episode ${index + 1}`, - link: url.split("/pack")[0] + "/file/" + id, + title: $(link).parent().children().remove().end().text() || "", + link: $(link).attr("href") || "", }); }); + return episodesLink; } - const res = await axios.get(url, { - headers: { - Cookie: "_ga_GNR438JY8N=GS1.1.1722240350.5.0.1722240350.0.0.0; _ga=GA1.1.372196696.1722150754; unlocked=true", - }, - }); - const episodeData = res.data; - const $ = cheerio.load(episodeData); - const links = $(".autohyperlink"); - links?.map((i, link) => { - episodesLink.push({ - title: $(link).parent().children().remove().end().text() || "", - link: $(link).attr("href") || "", - }); - }); - return episodesLink; - } - catch (err) { - console.error(err); - return []; - } + catch (err) { + console.error(err); + return []; + } + }); }; exports.getEpisodes = getEpisodes; -async function extractKmhdLink(katlink, providerContext) { - const { axios } = providerContext; - const res = await 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; +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; + }); } -async function extractKmhdEpisodes(katlink, providerContext) { - const { axios } = providerContext; - const res = await axios.get(katlink); - const data = res.data; - const ids = data.match(/[\w]+_[a-f0-9]{8}/g); - return ids; +function extractKmhdEpisodes(katlink, providerContext) { + return __awaiter(this, void 0, void 0, function* () { + const { axios } = providerContext; + const res = yield axios.get(katlink); + const data = res.data; + const ids = data.match(/[\w]+_[a-f0-9]{8}/g); + return ids; + }); } diff --git a/dist/katmovies/meta.js b/dist/katmovies/meta.js index 9fdd433..3365722 100644 --- a/dist/katmovies/meta.js +++ b/dist/katmovies/meta.js @@ -1,115 +1,128 @@ "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 getMeta = async function ({ link, providerContext, }) { - try { - const { axios, cheerio } = providerContext; - const url = link; - const res = await axios.get(url); - const data = res.data; - const $ = cheerio.load(data); - const container = $(".yQ8hqd.ksSzJd.LoQAYe").html() - ? $(".yQ8hqd.ksSzJd.LoQAYe") - : $(".FxvUNb"); - const imdbId = container - .find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])') - .attr("href") - ?.split("/")[4] || ""; - const title = container - .find('li:contains("Name")') - .children() - .remove() - .end() - .text(); - const type = $(".yQ8hqd.ksSzJd.LoQAYe").html() ? "series" : "movie"; - const synopsis = container.find('li:contains("Stars")').text(); - const image = $('h4:contains("SCREENSHOTS")').next().find("img").attr("src") || ""; - console.log("katGetInfo", title, synopsis, image, imdbId, type); - // Links - const links = []; - const directLink = []; - // direct links - $(".entry-content") - .find('p:contains("Episode")') - .each((i, element) => { - const dlLink = $(element) - .nextAll("h3,h2") - .first() - .find('a:contains("1080"),a:contains("720"),a:contains("480")') - .attr("href") || ""; - const dlTitle = $(element).find("span").text(); - if (link.trim().length > 0 && dlTitle.includes("Episode ")) { - directLink.push({ - title: dlTitle, - link: dlLink, - }); - } - }); - if (directLink.length > 0) { - links.push({ - quality: "", - title: title, - directLinks: directLink, - }); - } - $(".entry-content") - .find("pre") - .nextUntil("div") - .filter("h2") - .each((i, element) => { - const link = $(element).find("a").attr("href"); - const quality = $(element) - .text() - .match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || ""; - const title = $(element).text(); - if (link && title.includes("")) { - links.push({ - quality, - title, - episodesLink: link, - }); - } - }); - if (links.length === 0 && type === "movie") { +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); + const data = res.data; + const $ = cheerio.load(data); + const container = $(".yQ8hqd.ksSzJd.LoQAYe").html() + ? $(".yQ8hqd.ksSzJd.LoQAYe") + : $(".FxvUNb"); + 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('li:contains("Name")') + .children() + .remove() + .end() + .text(); + const type = $(".yQ8hqd.ksSzJd.LoQAYe").html() ? "series" : "movie"; + const synopsis = container.find('li:contains("Stars")').text(); + const image = $('h4:contains("SCREENSHOTS")').next().find("img").attr("src") || ""; + console.log("katGetInfo", title, synopsis, image, imdbId, type); + // Links + const links = []; + const directLink = []; + // direct links $(".entry-content") - .find('h2:contains("DOWNLOAD"),h3:contains("DOWNLOAD")') - .nextUntil("pre,div") - .filter("h2") + .find('p:contains("Episode")') .each((i, element) => { - const link = $(element).find("a").attr("href"); - const quality = $(element) - .text() - .match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || ""; - const title = $(element).text(); - if (link && !title.includes("Online")) { - links.push({ - quality, - title, - directLinks: [{ link, title, type: "movie" }], + const dlLink = $(element) + .nextAll("h3,h2") + .first() + .find('a:contains("1080"),a:contains("720"),a:contains("480")') + .attr("href") || ""; + const dlTitle = $(element).find("span").text(); + if (link.trim().length > 0 && dlTitle.includes("Episode ")) { + directLink.push({ + title: dlTitle, + link: dlLink, }); } }); + if (directLink.length > 0) { + links.push({ + quality: "", + title: title, + directLinks: directLink, + }); + } + $(".entry-content") + .find("pre") + .nextUntil("div") + .filter("h2") + .each((i, element) => { + var _a; + const link = $(element).find("a").attr("href"); + const quality = ((_a = $(element) + .text() + .match(/\b(480p|720p|1080p|2160p)\b/i)) === null || _a === void 0 ? void 0 : _a[0]) || ""; + const title = $(element).text(); + if (link && title.includes("")) { + links.push({ + quality, + title, + episodesLink: link, + }); + } + }); + if (links.length === 0 && type === "movie") { + $(".entry-content") + .find('h2:contains("DOWNLOAD"),h3:contains("DOWNLOAD")') + .nextUntil("pre,div") + .filter("h2") + .each((i, element) => { + var _a; + const link = $(element).find("a").attr("href"); + const quality = ((_a = $(element) + .text() + .match(/\b(480p|720p|1080p|2160p)\b/i)) === null || _a === void 0 ? void 0 : _a[0]) || ""; + const title = $(element).text(); + if (link && !title.includes("Online")) { + links.push({ + quality, + title, + directLinks: [{ link, title, type: "movie" }], + }); + } + }); + } + // console.log('drive meta', title, synopsis, image, imdbId, type, links); + return { + title, + synopsis, + image, + imdbId, + type, + linkList: links, + }; } - // 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: [], - }; - } + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/katmovies/posts.js b/dist/katmovies/posts.js index 330d7de..c1f8a94 100644 --- a/dist/katmovies/posts.js +++ b/dist/katmovies/posts.js @@ -1,44 +1,59 @@ "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 getPosts = async function ({ filter, page, signal, providerContext, }) { - const { getBaseUrl, cheerio } = providerContext; - const baseUrl = await getBaseUrl("kat"); - const url = `${baseUrl + filter}/page/${page}/`; - return posts({ url, signal, cheerio }); +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, signal, providerContext, }) { + const { getBaseUrl, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("kat"); + const url = `${baseUrl + filter}/page/${page}/`; + return posts({ url, signal, cheerio }); + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) { - const { getBaseUrl, cheerio } = providerContext; - const baseUrl = await getBaseUrl("kat"); - const url = `${baseUrl}/page/${page}/?s=${searchQuery}`; - return posts({ url, signal, cheerio }); +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) { + const { getBaseUrl, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("kat"); + const url = `${baseUrl}/page/${page}/?s=${searchQuery}`; + return posts({ url, signal, cheerio }); + }); }; exports.getSearchPosts = getSearchPosts; -async function posts({ url, signal, cheerio, }) { - try { - const res = await fetch(url, { signal }); - const data = await res.text(); - const $ = cheerio.load(data); - const catalog = []; - $(".recent-posts") - .children() - .map((i, element) => { - const title = $(element).find("img").attr("alt"); - const link = $(element).find("a").attr("href"); - const image = $(element).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("katmovies error ", err); - return []; - } +function posts(_a) { + return __awaiter(this, arguments, void 0, function* ({ url, signal, cheerio, }) { + try { + const res = yield fetch(url, { signal }); + const data = yield res.text(); + const $ = cheerio.load(data); + const catalog = []; + $(".recent-posts") + .children() + .map((i, element) => { + const title = $(element).find("img").attr("alt"); + const link = $(element).find("a").attr("href"); + const image = $(element).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("katmovies error ", err); + return []; + } + }); } diff --git a/dist/katmovies/stream.js b/dist/katmovies/stream.js index 04e54d9..fbffc07 100644 --- a/dist/katmovies/stream.js +++ b/dist/katmovies/stream.js @@ -1,91 +1,104 @@ "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; -async function extractKmhdLink(katlink, providerContext) { - const { axios } = providerContext; - const res = await 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; +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 = async 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 await gdFlixExtracter(link, signal); - } - if (link.includes("kmhd")) { - const hubcloudLink = await extractKmhdLink(link, providerContext); - return await hubcloudExtracter(hubcloudLink, signal); - } - if (link.includes("gdflix")) { - // resume link - try { - const resumeDrive = link.replace("/file", "/zfile"); - // console.log('resumeDrive', resumeDrive); - const resumeDriveRes = await 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", +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("Resume link not found"); - } - //instant link - try { - const driveres = await 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 = await fetch(videoSeedUrl, { - method: "POST", - body: InstantFromData, - headers: { - "x-token": videoSeedUrl, - }, - }); - const instantLinkData = await 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; } - catch (err) { - console.log("Instant link not found", err); - } - return streamLinks; + const stereams = yield hubcloudExtracter(link, signal); + return stereams; } - const stereams = await hubcloudExtracter(link, signal); - return stereams; - } - catch (error) { - console.log("katgetStream error: ", error); - return []; - } + catch (error) { + console.log("katgetStream error: ", error); + return []; + } + }); }; exports.getStream = getStream; diff --git a/dist/kissKh/meta.js b/dist/kissKh/meta.js index 67874b5..62b37d1 100644 --- a/dist/kissKh/meta.js +++ b/dist/kissKh/meta.js @@ -1,50 +1,60 @@ "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 getMeta = async function ({ link, providerContext, }) { - try { - const { axios } = providerContext; - const res = await axios.get(link); - const data = res.data; - const meta = { - title: data.title, - synopsis: data.description, - image: data.thumbnail, - tags: [data?.releaseDate?.split("-")[0], data?.status, data?.type], - imdbId: "", - type: data.episodesCount > 1 ? "series" : "movie", - }; - const linkList = []; - const subLinks = []; - data?.episodes?.reverse().map((episode) => { - const title = "Episode " + episode?.number; - const link = episode?.id?.toString(); - if (link && title) { - subLinks.push({ - title, - link, - }); - } - }); - linkList.push({ - title: meta.title, - directLinks: subLinks, - }); - return { - ...meta, - linkList: linkList, - }; - } - catch (err) { - console.error(err); - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "movie", - linkList: [], - }; - } +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { + var _b, _c; + try { + const { axios } = providerContext; + const res = yield axios.get(link); + const data = res.data; + const meta = { + title: data.title, + synopsis: data.description, + image: data.thumbnail, + tags: [(_b = data === null || data === void 0 ? void 0 : data.releaseDate) === null || _b === void 0 ? void 0 : _b.split("-")[0], data === null || data === void 0 ? void 0 : data.status, data === null || data === void 0 ? void 0 : data.type], + imdbId: "", + type: data.episodesCount > 1 ? "series" : "movie", + }; + const linkList = []; + const subLinks = []; + (_c = data === null || data === void 0 ? void 0 : data.episodes) === null || _c === void 0 ? void 0 : _c.reverse().map((episode) => { + var _a; + const title = "Episode " + (episode === null || episode === void 0 ? void 0 : episode.number); + const link = (_a = episode === null || episode === void 0 ? void 0 : episode.id) === null || _a === void 0 ? void 0 : _a.toString(); + if (link && title) { + subLinks.push({ + title, + link, + }); + } + }); + linkList.push({ + title: meta.title, + directLinks: subLinks, + }); + return Object.assign(Object.assign({}, meta), { linkList: linkList }); + } + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/kissKh/posts.js b/dist/kissKh/posts.js index 84e94f7..ea325c1 100644 --- a/dist/kissKh/posts.js +++ b/dist/kissKh/posts.js @@ -1,59 +1,73 @@ "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 getPosts = async function ({ filter, signal, providerContext, }) { - const { getBaseUrl, axios } = providerContext; - const baseUrl = await getBaseUrl("kissKh"); - const url = `${baseUrl + filter}&type=0`; - try { - const res = await axios.get(url, { signal }); - const data = res.data?.data; - const catalog = []; - data?.map((element) => { - const title = element.title; - const link = baseUrl + `/api/DramaList/Drama/${element?.id}?isq=false`; - const image = element.thumbnail; - if (title && link && image) { - catalog.push({ - title: title, - link: link, - image: image, - }); - } - }); - return catalog; - } - catch (err) { - console.error("kiss error ", err); - return []; - } +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, signal, providerContext, }) { + var _b; + const { getBaseUrl, axios } = providerContext; + const baseUrl = yield getBaseUrl("kissKh"); + const url = `${baseUrl + filter}&type=0`; + try { + const res = yield axios.get(url, { signal }); + const data = (_b = res.data) === null || _b === void 0 ? void 0 : _b.data; + const catalog = []; + data === null || data === void 0 ? void 0 : data.map((element) => { + const title = element.title; + const link = baseUrl + `/api/DramaList/Drama/${element === null || element === void 0 ? void 0 : element.id}?isq=false`; + const image = element.thumbnail; + if (title && link && image) { + catalog.push({ + title: title, + link: link, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + console.error("kiss error ", err); + return []; + } + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, signal, providerContext, }) { - const { getBaseUrl, axios } = providerContext; - const baseUrl = await getBaseUrl("kissKh"); - const url = `${baseUrl}/api/DramaList/Search?q=${searchQuery}&type=0`; - try { - const res = await axios.get(url, { signal }); - const data = res.data; - const catalog = []; - data?.map((element) => { - const title = element.title; - const link = baseUrl + `/api/DramaList/Drama/${element?.id}?isq=false`; - const image = element.thumbnail; - if (title && link && image) { - catalog.push({ - title: title, - link: link, - image: image, - }); - } - }); - return catalog; - } - catch (err) { - console.error("kiss error ", err); - return []; - } +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, signal, providerContext, }) { + const { getBaseUrl, axios } = providerContext; + const baseUrl = yield getBaseUrl("kissKh"); + const url = `${baseUrl}/api/DramaList/Search?q=${searchQuery}&type=0`; + try { + const res = yield axios.get(url, { signal }); + const data = res.data; + const catalog = []; + data === null || data === void 0 ? void 0 : data.map((element) => { + const title = element.title; + const link = baseUrl + `/api/DramaList/Drama/${element === null || element === void 0 ? void 0 : element.id}?isq=false`; + const image = element.thumbnail; + if (title && link && image) { + catalog.push({ + title: title, + link: link, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + console.error("kiss error ", err); + return []; + } + }); }; exports.getSearchPosts = getSearchPosts; diff --git a/dist/kissKh/stream.js b/dist/kissKh/stream.js index 17dcd07..af5b7c0 100644 --- a/dist/kissKh/stream.js +++ b/dist/kissKh/stream.js @@ -1,42 +1,55 @@ "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 types_1 = require("../types"); -const getStream = async function ({ link: id, providerContext, }) { - try { - const { axios, getBaseUrl } = providerContext; - const streamLinks = []; - const subtitles = []; - const baseUrl = await getBaseUrl("kissKh"); - const streamUrl = "https://adorable-salamander-ecbb21.netlify.app/api/kisskh/video?id=" + - id; - const res = await axios.get(streamUrl); - const stream = res.data?.source?.Video; - const subData = res.data?.subtitles; - subData?.map((sub) => { - subtitles.push({ - title: sub?.label, - language: sub?.land, - type: sub?.src?.includes(".vtt") - ? types_1.TextTrackType.VTT - : types_1.TextTrackType.SUBRIP, - uri: sub?.src, +const getStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link: id, providerContext, }) { + var _b, _c, _d; + try { + const { axios, getBaseUrl } = providerContext; + const streamLinks = []; + const subtitles = []; + const baseUrl = yield getBaseUrl("kissKh"); + const streamUrl = "https://adorable-salamander-ecbb21.netlify.app/api/kisskh/video?id=" + + id; + const res = yield axios.get(streamUrl); + const stream = (_c = (_b = res.data) === null || _b === void 0 ? void 0 : _b.source) === null || _c === void 0 ? void 0 : _c.Video; + const subData = (_d = res.data) === null || _d === void 0 ? void 0 : _d.subtitles; + subData === null || subData === void 0 ? void 0 : subData.map((sub) => { + var _a; + subtitles.push({ + title: sub === null || sub === void 0 ? void 0 : sub.label, + language: sub === null || sub === void 0 ? void 0 : sub.land, + type: ((_a = sub === null || sub === void 0 ? void 0 : sub.src) === null || _a === void 0 ? void 0 : _a.includes(".vtt")) + ? types_1.TextTrackType.VTT + : types_1.TextTrackType.SUBRIP, + uri: sub === null || sub === void 0 ? void 0 : sub.src, + }); }); - }); - streamLinks.push({ - server: "kissKh", - link: stream, - type: "m3u8", - subtitles, - headers: { - referer: baseUrl, - }, - }); - return streamLinks; - } - catch (err) { - console.error(err); - return []; - } + streamLinks.push({ + server: "kissKh", + link: stream, + type: "m3u8", + subtitles, + headers: { + referer: baseUrl, + }, + }); + return streamLinks; + } + catch (err) { + console.error(err); + return []; + } + }); }; exports.getStream = getStream; diff --git a/dist/luxMovies/episodes.js b/dist/luxMovies/episodes.js index 7d19743..e7dc86e 100644 --- a/dist/luxMovies/episodes.js +++ b/dist/luxMovies/episodes.js @@ -1,34 +1,45 @@ "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.getEpisodes = void 0; -const getEpisodes = async function ({ url, providerContext, }) { - const { axios, cheerio, commonHeaders: headers } = providerContext; - console.log("getEpisodeLinks", url); - try { - const res = await axios.get(url, { headers }); - const $ = cheerio.load(res.data); - const container = $(".entry-content,.entry-inner"); - $(".unili-content,.code-block-1").remove(); - const episodes = []; - container.find("h4").each((index, element) => { - const el = $(element); - const title = el.text().replaceAll("-", "").replaceAll(":", ""); - const link = el - .next("p") - .find('.btn-outline[style="background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;"]') - .parent() - .attr("href"); - if (title && link) { - episodes.push({ title, link }); - } - }); - // console.log(episodes); - return episodes; - } - catch (err) { - console.log("getEpisodeLinks error: "); - // console.error(err); - return []; - } +const getEpisodes = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) { + const { axios, cheerio, commonHeaders: headers } = providerContext; + console.log("getEpisodeLinks", url); + try { + const res = yield axios.get(url, { headers }); + const $ = cheerio.load(res.data); + const container = $(".entry-content,.entry-inner"); + $(".unili-content,.code-block-1").remove(); + const episodes = []; + container.find("h4").each((index, element) => { + const el = $(element); + const title = el.text().replaceAll("-", "").replaceAll(":", ""); + const link = el + .next("p") + .find('.btn-outline[style="background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;"]') + .parent() + .attr("href"); + if (title && link) { + episodes.push({ title, link }); + } + }); + // console.log(episodes); + return episodes; + } + catch (err) { + console.log("getEpisodeLinks error: "); + // console.error(err); + return []; + } + }); }; exports.getEpisodes = getEpisodes; diff --git a/dist/luxMovies/meta.js b/dist/luxMovies/meta.js index 0abf761..e34b34e 100644 --- a/dist/luxMovies/meta.js +++ b/dist/luxMovies/meta.js @@ -1,4 +1,13 @@ "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 headers = { @@ -17,88 +26,69 @@ const headers = { "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", }; -const getMeta = async ({ link, providerContext, }) => { +const getMeta = (_a) => __awaiter(void 0, [_a], void 0, function* ({ link, providerContext, }) { + var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v; try { const { axios, cheerio } = providerContext; const url = link; console.log("url", url); const baseUrl = url.split("/").slice(0, 3).join("/"); - const response = await axios.get(url, { - headers: { - ...headers, - Referer: baseUrl, - }, + const response = yield axios.get(url, { + headers: Object.assign(Object.assign({}, headers), { Referer: baseUrl }), }); const $ = cheerio.load(response.data); const infoContainer = $(".entry-content,.post-inner"); - const heading = infoContainer?.find("h3"); + const heading = infoContainer === null || infoContainer === void 0 ? void 0 : infoContainer.find("h3"); const imdbId = //@ts-ignore - heading?.next("p")?.find("a")?.[0]?.attribs?.href?.match(/tt\d+/g)?.[0] || - infoContainer.text().match(/tt\d+/g)?.[0] || + ((_g = (_f = (_e = (_d = (_c = (_b = heading === null || heading === void 0 ? void 0 : heading.next("p")) === null || _b === void 0 ? void 0 : _b.find("a")) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.attribs) === null || _e === void 0 ? void 0 : _e.href) === null || _f === void 0 ? void 0 : _f.match(/tt\d+/g)) === null || _g === void 0 ? void 0 : _g[0]) || + ((_h = infoContainer.text().match(/tt\d+/g)) === null || _h === void 0 ? void 0 : _h[0]) || ""; // console.log(imdbId) - const type = heading?.next("p")?.text()?.includes("Series Name") + const type = ((_k = (_j = heading === null || heading === void 0 ? void 0 : heading.next("p")) === null || _j === void 0 ? void 0 : _j.text()) === null || _k === void 0 ? void 0 : _k.includes("Series Name")) ? "series" : "movie"; // console.log(type); // title const titleRegex = /Name: (.+)/; - const title = heading?.next("p")?.text()?.match(titleRegex)?.[1] || ""; + const title = ((_o = (_m = (_l = heading === null || heading === void 0 ? void 0 : heading.next("p")) === null || _l === void 0 ? void 0 : _l.text()) === null || _m === void 0 ? void 0 : _m.match(titleRegex)) === null || _o === void 0 ? void 0 : _o[1]) || ""; // console.log(title); // synopsis const synopsisNode = //@ts-ignore - infoContainer?.find("p")?.next("h3,h4")?.next("p")?.[0]?.children?.[0]; + (_t = (_s = (_r = (_q = (_p = infoContainer === null || infoContainer === void 0 ? void 0 : infoContainer.find("p")) === null || _p === void 0 ? void 0 : _p.next("h3,h4")) === null || _q === void 0 ? void 0 : _q.next("p")) === null || _r === void 0 ? void 0 : _r[0]) === null || _s === void 0 ? void 0 : _s.children) === null || _t === void 0 ? void 0 : _t[0]; const synopsis = synopsisNode && "data" in synopsisNode ? synopsisNode.data : ""; // console.log(synopsis); // image - let image = infoContainer?.find("img[data-lazy-src]")?.attr("data-lazy-src") || ""; + let image = ((_u = infoContainer === null || infoContainer === void 0 ? void 0 : infoContainer.find("img[data-lazy-src]")) === null || _u === void 0 ? void 0 : _u.attr("data-lazy-src")) || ""; if (image.startsWith("//")) { image = "https:" + image; } // console.log(image); // console.log({title, synopsis, image, imdbId, type}); /// Links - const hr = infoContainer?.first()?.find("hr"); - const list = hr?.nextUntil("hr"); + const hr = (_v = infoContainer === null || infoContainer === void 0 ? void 0 : infoContainer.first()) === null || _v === void 0 ? void 0 : _v.find("hr"); + const list = hr === null || hr === void 0 ? void 0 : hr.nextUntil("hr"); const links = []; list.each((index, element) => { + var _a, _b, _c, _d, _e, _f, _g, _h, _j; element = $(element); // title - const title = element?.text() || ""; - const quality = element?.text().match(/\d+p\b/)?.[0] || ""; + const title = (element === null || element === void 0 ? void 0 : element.text()) || ""; + const quality = ((_a = element === null || element === void 0 ? void 0 : element.text().match(/\d+p\b/)) === null || _a === void 0 ? void 0 : _a[0]) || ""; // console.log(title); // movieLinks - const movieLinks = element - ?.next() - .find(".dwd-button") - .text() - .toLowerCase() - .includes("download") - ? element?.next().find(".dwd-button")?.parent()?.attr("href") + const movieLinks = (element === null || element === void 0 ? void 0 : element.next().find(".dwd-button").text().toLowerCase().includes("download")) + ? (_c = (_b = element === null || element === void 0 ? void 0 : element.next().find(".dwd-button")) === null || _b === void 0 ? void 0 : _b.parent()) === null || _c === void 0 ? void 0 : _c.attr("href") : ""; // episode links - const vcloudLinks = element - ?.next() - .find(".btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;'],.btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: #fdf8f2;']") - ?.parent() - ?.attr("href"); + const vcloudLinks = (_e = (_d = element === null || element === void 0 ? void 0 : element.next().find(".btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;'],.btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: #fdf8f2;']")) === null || _d === void 0 ? void 0 : _d.parent()) === null || _e === void 0 ? void 0 : _e.attr("href"); console.log(title); const episodesLink = (vcloudLinks ? vcloudLinks - : element - ?.next() - .find(".dwd-button") - .text() - .toLowerCase() - .includes("episode") - ? element?.next().find(".dwd-button")?.parent()?.attr("href") + : (element === null || element === void 0 ? void 0 : element.next().find(".dwd-button").text().toLowerCase().includes("episode")) + ? (_g = (_f = element === null || element === void 0 ? void 0 : element.next().find(".dwd-button")) === null || _f === void 0 ? void 0 : _f.parent()) === null || _g === void 0 ? void 0 : _g.attr("href") : "") || - element - ?.next() - .find(".btn-outline[style='background:linear-gradient(135deg,#0ebac3,#09d261); color: white;']") - ?.parent() - ?.attr("href"); + ((_j = (_h = element === null || element === void 0 ? void 0 : element.next().find(".btn-outline[style='background:linear-gradient(135deg,#0ebac3,#09d261); color: white;']")) === null || _h === void 0 ? void 0 : _h.parent()) === null || _j === void 0 ? void 0 : _j.attr("href")); if (movieLinks || episodesLink) { links.push({ title, @@ -133,5 +123,5 @@ const getMeta = async ({ link, providerContext, }) => { linkList: [], }; } -}; +}); exports.getMeta = getMeta; diff --git a/dist/luxMovies/posts.js b/dist/luxMovies/posts.js index b421840..a10fa13 100644 --- a/dist/luxMovies/posts.js +++ b/dist/luxMovies/posts.js @@ -1,4 +1,13 @@ "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 headers = { @@ -17,57 +26,55 @@ const headers = { "Upgrade-Insecure-Requests": "1", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0", }; -const getPosts = async ({ filter, page, providerValue, signal, providerContext, }) => { +const getPosts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ filter, page, providerValue, signal, providerContext, }) { const { getBaseUrl } = providerContext; - const baseUrl = await getBaseUrl("lux"); + const baseUrl = yield getBaseUrl("lux"); console.log("vegaGetPosts baseUrl:", providerValue, baseUrl); const url = `${baseUrl}/${filter}/page/${page}/`; console.log("lux url:", url); return posts(url, signal, providerContext); -}; +}); exports.getPosts = getPosts; -const getSearchPosts = async ({ searchQuery, page, providerValue, signal, providerContext, }) => { +const getSearchPosts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ searchQuery, page, providerValue, signal, providerContext, }) { const { getBaseUrl } = providerContext; - const baseUrl = await getBaseUrl("lux"); + const baseUrl = yield getBaseUrl("lux"); console.log("vegaGetPosts baseUrl:", providerValue, baseUrl); const url = `${baseUrl}/page/${page}/?s=${searchQuery}`; console.log("lux url:", url); return posts(url, signal, providerContext); -}; +}); exports.getSearchPosts = getSearchPosts; -async function posts(url, signal, providerContext) { - try { - const { axios, cheerio } = providerContext; - const urlRes = await axios.get(url, { headers, signal }); - const $ = cheerio.load(urlRes.data); - const posts = []; - $(".blog-items") - ?.children("article") - ?.each((index, element) => { - const post = { - title: $(element) - ?.find("a") - ?.attr("title") - ?.replace("Download", "") - ?.match(/^(.*?)\s*\((\d{4})\)|^(.*?)\s*\((Season \d+)\)/)?.[0] || - $(element)?.find("a")?.attr("title")?.replace("Download", "") || - "", - link: $(element)?.find("a")?.attr("href") || "", - image: $(element).find("a").find("img").attr("data-lazy-src") || - $(element).find("a").find("img").attr("data-src") || - $(element).find("a").find("img").attr("src") || - "", - }; - if (post.image.startsWith("//")) { - post.image = "https:" + post.image; - } - posts.push(post); - }); - // console.log(posts); - return posts; - } - catch (error) { - console.error("vegaGetPosts error:", error); - return []; - } +function posts(url, signal, providerContext) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b; + try { + const { axios, cheerio } = providerContext; + const urlRes = yield axios.get(url, { headers, signal }); + const $ = cheerio.load(urlRes.data); + const posts = []; + (_b = (_a = $(".blog-items")) === null || _a === void 0 ? void 0 : _a.children("article")) === null || _b === void 0 ? void 0 : _b.each((index, element) => { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; + const post = { + title: ((_e = (_d = (_c = (_b = (_a = $(element)) === null || _a === void 0 ? void 0 : _a.find("a")) === null || _b === void 0 ? void 0 : _b.attr("title")) === null || _c === void 0 ? void 0 : _c.replace("Download", "")) === null || _d === void 0 ? void 0 : _d.match(/^(.*?)\s*\((\d{4})\)|^(.*?)\s*\((Season \d+)\)/)) === null || _e === void 0 ? void 0 : _e[0]) || + ((_h = (_g = (_f = $(element)) === null || _f === void 0 ? void 0 : _f.find("a")) === null || _g === void 0 ? void 0 : _g.attr("title")) === null || _h === void 0 ? void 0 : _h.replace("Download", "")) || + "", + link: ((_k = (_j = $(element)) === null || _j === void 0 ? void 0 : _j.find("a")) === null || _k === void 0 ? void 0 : _k.attr("href")) || "", + image: $(element).find("a").find("img").attr("data-lazy-src") || + $(element).find("a").find("img").attr("data-src") || + $(element).find("a").find("img").attr("src") || + "", + }; + if (post.image.startsWith("//")) { + post.image = "https:" + post.image; + } + posts.push(post); + }); + // console.log(posts); + return posts; + } + catch (error) { + console.error("vegaGetPosts error:", error); + return []; + } + }); } diff --git a/dist/luxMovies/stream.js b/dist/luxMovies/stream.js index 42f0062..71a2787 100644 --- a/dist/luxMovies/stream.js +++ b/dist/luxMovies/stream.js @@ -1,4 +1,13 @@ "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 = { @@ -17,49 +26,35 @@ const headers = { "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", }; -async function getStream({ link, type, signal, providerContext, }) { - const { axios, cheerio, extractors } = providerContext; - const { hubcloudExtracter } = extractors; - try { - const streamLinks = []; - console.log("dotlink", link); - if (type === "movie") { - // vlink - const dotlinkRes = await axios(`${link}`, { headers }); - const dotlinkText = dotlinkRes.data; - // console.log('dotlinkText', dotlinkText); - const vlink = dotlinkText.match(/ { - const seriesTitle = $(element).text(); - const episodesLink = $(element).find("a").attr("href"); - if (episodesLink && episodesLink !== "#") { - episodeLinks.push({ - title: seriesTitle.trim() || "No title found", - link: episodesLink || "", - }); +const getEpisodes = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) { + var _b; + const { axios, cheerio } = providerContext; + try { + if (url.includes("url=")) { + url = atob(url.split("url=")[1]); } - }); - $("a.maxbutton").map((i, element) => { - const seriesTitle = $(element).children("span").text(); - const episodesLink = $(element).attr("href"); - if (episodesLink && episodesLink !== "#") { - episodeLinks.push({ - title: seriesTitle.trim() || "No title found", - link: episodesLink || "", - }); + const res = yield axios.get(url); + const html = res.data; + let $ = cheerio.load(html); + if (url.includes("url=")) { + const newUrl = (_b = $("meta[http-equiv='refresh']") + .attr("content")) === null || _b === void 0 ? void 0 : _b.split("url=")[1]; + const res2 = yield axios.get(newUrl || url); + const html2 = res2.data; + $ = cheerio.load(html2); } - }); - return episodeLinks; - } - catch (err) { - console.error(err); - return []; - } + const episodeLinks = []; + $("h3,h4").map((i, element) => { + const seriesTitle = $(element).text(); + const episodesLink = $(element).find("a").attr("href"); + if (episodesLink && episodesLink !== "#") { + episodeLinks.push({ + title: seriesTitle.trim() || "No title found", + link: episodesLink || "", + }); + } + }); + $("a.maxbutton").map((i, element) => { + const seriesTitle = $(element).children("span").text(); + const episodesLink = $(element).attr("href"); + if (episodesLink && episodesLink !== "#") { + episodeLinks.push({ + title: seriesTitle.trim() || "No title found", + link: episodesLink || "", + }); + } + }); + return episodeLinks; + } + catch (err) { + console.error(err); + return []; + } + }); }; exports.getEpisodes = getEpisodes; diff --git a/dist/mod/meta.js b/dist/mod/meta.js index a2c4c23..43ca4ca 100644 --- a/dist/mod/meta.js +++ b/dist/mod/meta.js @@ -1,62 +1,75 @@ "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 getMeta = async function ({ link, providerContext, }) { - try { - const { axios, cheerio } = providerContext; - const url = link; - const res = await axios.get(url); - const data = res.data; - const $ = cheerio.load(data); - const meta = { - title: $(".imdbwp__title").text(), - synopsis: $(".imdbwp__teaser").text(), - image: $(".imdbwp__thumb").find("img").attr("src") || "", - imdbId: $(".imdbwp__link").attr("href")?.split("/")[4] || "", - type: $(".thecontent").text().toLocaleLowerCase().includes("season") - ? "series" - : "movie", - }; - const links = []; - $("h3,h4").map((i, element) => { - const seriesTitle = $(element).text(); - // const batchZipLink = $(element) - // .next("p") - // .find(".maxbutton-batch-zip,.maxbutton-zip-download") - // .attr("href"); - const episodesLink = $(element) - .next("p") - .find(".maxbutton-episode-links,.maxbutton-g-drive,.maxbutton-af-download") - .attr("href"); - const movieLink = $(element) - .next("p") - .find(".maxbutton-download-links") - .attr("href"); - if (movieLink || - (episodesLink && episodesLink !== "javascript:void(0);")) { - links.push({ - title: seriesTitle.replace("Download ", "").trim() || "Download", - episodesLink: episodesLink || "", - directLinks: movieLink - ? [{ link: movieLink, title: "Movie", type: "movie" }] - : [], - quality: seriesTitle?.match(/\d+p\b/)?.[0] || "", - }); - } - }); - // console.log('mod meta', links); - return { ...meta, linkList: links }; - } - catch (err) { - console.error(err); - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "movie", - linkList: [], - }; - } +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); + const data = res.data; + const $ = cheerio.load(data); + const meta = { + title: $(".imdbwp__title").text(), + synopsis: $(".imdbwp__teaser").text(), + image: $(".imdbwp__thumb").find("img").attr("src") || "", + imdbId: ((_b = $(".imdbwp__link").attr("href")) === null || _b === void 0 ? void 0 : _b.split("/")[4]) || "", + type: $(".thecontent").text().toLocaleLowerCase().includes("season") + ? "series" + : "movie", + }; + const links = []; + $("h3,h4").map((i, element) => { + var _a; + const seriesTitle = $(element).text(); + // const batchZipLink = $(element) + // .next("p") + // .find(".maxbutton-batch-zip,.maxbutton-zip-download") + // .attr("href"); + const episodesLink = $(element) + .next("p") + .find(".maxbutton-episode-links,.maxbutton-g-drive,.maxbutton-af-download") + .attr("href"); + const movieLink = $(element) + .next("p") + .find(".maxbutton-download-links") + .attr("href"); + if (movieLink || + (episodesLink && episodesLink !== "javascript:void(0);")) { + links.push({ + title: seriesTitle.replace("Download ", "").trim() || "Download", + episodesLink: episodesLink || "", + directLinks: movieLink + ? [{ link: movieLink, title: "Movie", type: "movie" }] + : [], + quality: ((_a = seriesTitle === null || seriesTitle === void 0 ? void 0 : seriesTitle.match(/\d+p\b/)) === null || _a === void 0 ? void 0 : _a[0]) || "", + }); + } + }); + // console.log('mod meta', links); + return Object.assign(Object.assign({}, meta), { linkList: links }); + } + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/mod/posts.js b/dist/mod/posts.js index 33dea80..25fae11 100644 --- a/dist/mod/posts.js +++ b/dist/mod/posts.js @@ -1,44 +1,59 @@ "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 getPosts = async function ({ filter, page, signal, providerContext, }) { - const { getBaseUrl, axios, cheerio } = providerContext; - const baseUrl = await getBaseUrl("Moviesmod"); - const url = `${baseUrl + filter}/page/${page}/`; - return posts({ url, signal, axios, cheerio }); +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, signal, providerContext, }) { + const { getBaseUrl, axios, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("Moviesmod"); + const url = `${baseUrl + filter}/page/${page}/`; + return posts({ url, signal, axios, cheerio }); + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) { - const { getBaseUrl, axios, cheerio } = providerContext; - const baseUrl = await getBaseUrl("Moviesmod"); - const url = `${baseUrl}/search/${searchQuery}/page/${page}/`; - return posts({ url, signal, axios, cheerio }); +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) { + const { getBaseUrl, axios, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("Moviesmod"); + const url = `${baseUrl}/search/${searchQuery}/page/${page}/`; + return posts({ url, signal, axios, cheerio }); + }); }; exports.getSearchPosts = getSearchPosts; -async function posts({ url, signal, axios, cheerio, }) { - try { - const res = await axios.get(url, { signal }); - const data = res.data; - const $ = cheerio.load(data); - const catalog = []; - $(".post-cards") - .find("article") - .map((i, element) => { - const title = $(element).find("a").attr("title"); - const link = $(element).find("a").attr("href"); - const image = $(element).find("img").attr("src"); - if (title && link && image) { - catalog.push({ - title: title, - link: link, - image: image, - }); - } - }); - return catalog; - } - catch (err) { - console.error("modGetPosts error ", err); - return []; - } +function posts(_a) { + return __awaiter(this, arguments, void 0, function* ({ url, signal, axios, cheerio, }) { + try { + const res = yield axios.get(url, { signal }); + const data = res.data; + const $ = cheerio.load(data); + const catalog = []; + $(".post-cards") + .find("article") + .map((i, element) => { + const title = $(element).find("a").attr("title"); + const link = $(element).find("a").attr("href"); + const image = $(element).find("img").attr("src"); + if (title && link && image) { + catalog.push({ + title: title, + link: link, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + console.error("modGetPosts error ", err); + return []; + } + }); } diff --git a/dist/mod/stream.js b/dist/mod/stream.js index f7076c2..3dea75c 100644 --- a/dist/mod/stream.js +++ b/dist/mod/stream.js @@ -1,4 +1,13 @@ "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 headers = { @@ -17,192 +26,199 @@ const headers = { "Upgrade-Insecure-Requests": "1", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0", }; -const getStream = async function ({ link: url, type, providerContext, }) { - const { axios, cheerio } = providerContext; - try { - const modGetEpisodeLinks = async function ({ url, providerContext, }) { - const { axios, cheerio } = providerContext; +const getStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link: url, type, providerContext, }) { + var _b, _c; + const { axios, cheerio } = providerContext; + try { + const modGetEpisodeLinks = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) { + var _b; + const { axios, cheerio } = providerContext; + try { + if (url.includes("url=")) { + url = atob(url.split("url=")[1]); + } + const res = yield axios.get(url); + const html = res.data; + let $ = cheerio.load(html); + if (url.includes("url=")) { + const newUrl = (_b = $("meta[http-equiv='refresh']") + .attr("content")) === null || _b === void 0 ? void 0 : _b.split("url=")[1]; + const res2 = yield axios.get(newUrl || url); + const html2 = res2.data; + $ = cheerio.load(html2); + } + const episodeLinks = []; + $("h3,h4").map((i, element) => { + const seriesTitle = $(element).text(); + const episodesLink = $(element).find("a").attr("href"); + if (episodesLink && episodesLink !== "#") { + episodeLinks.push({ + title: seriesTitle.trim() || "No title found", + link: episodesLink || "", + }); + } + }); + $("a.maxbutton").map((i, element) => { + const seriesTitle = $(element).children("span").text(); + const episodesLink = $(element).attr("href"); + if (episodesLink && episodesLink !== "#") { + episodeLinks.push({ + title: seriesTitle.trim() || "No title found", + link: episodesLink || "", + }); + } + }); + return episodeLinks; + } + catch (err) { + console.error(err); + return []; + } + }); + }; + console.log("modGetStream", type, url); + if (type === "movie") { + const servers = yield modGetEpisodeLinks({ url, providerContext }); + url = servers[0].link || url; + } + let downloadLink = yield modExtractor(url, providerContext); + // console.log(downloadLink.data); + const ddl = ((_c = (_b = downloadLink === null || downloadLink === void 0 ? void 0 : downloadLink.data) === null || _b === void 0 ? void 0 : _b.match(/content="0;url=(.*?)"/)) === null || _c === void 0 ? void 0 : _c[1]) || url; + // console.log('ddl', url); + // console.log(ddl); + // console.log(ddl); + const servers = []; + const driveLink = yield isDriveLink(ddl); + const driveRes = yield axios.get(driveLink, { headers }); + const driveHtml = driveRes.data; + const $drive = cheerio.load(driveHtml); try { - if (url.includes("url=")) { - url = atob(url.split("url=")[1]); - } - const res = await axios.get(url); - const html = res.data; - let $ = cheerio.load(html); - if (url.includes("url=")) { - const newUrl = $("meta[http-equiv='refresh']") - .attr("content") - ?.split("url=")[1]; - const res2 = await axios.get(newUrl || url); - const html2 = res2.data; - $ = cheerio.load(html2); - } - const episodeLinks = []; - $("h3,h4").map((i, element) => { - const seriesTitle = $(element).text(); - const episodesLink = $(element).find("a").attr("href"); - if (episodesLink && episodesLink !== "#") { - episodeLinks.push({ - title: seriesTitle.trim() || "No title found", - link: episodesLink || "", - }); - } + const resumeBot = $drive(".btn.btn-light").attr("href") || ""; + const resumeBotRes = yield axios.get(resumeBot, { headers }); + const resumeBotToken = resumeBotRes.data.match(/formData\.append\('token', '([a-f0-9]+)'\)/)[1]; + const resumeBotBody = new FormData(); + resumeBotBody.append("token", resumeBotToken); + const resumeBotPath = resumeBotRes.data.match(/fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/)[1]; + const resumeBotBaseUrl = resumeBot.split("/download")[0]; + // console.log( + // 'resumeBotPath', + // resumeBotBaseUrl + '/download?id=' + resumeBotPath, + // ); + // console.log('resumeBotBody', resumeBotToken); + const resumeBotDownload = yield fetch(resumeBotBaseUrl + "/download?id=" + resumeBotPath, { + method: "POST", + body: resumeBotBody, + headers: { + Referer: resumeBot, + Cookie: "PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308", + }, }); - $("a.maxbutton").map((i, element) => { - const seriesTitle = $(element).children("span").text(); - const episodesLink = $(element).attr("href"); - if (episodesLink && episodesLink !== "#") { - episodeLinks.push({ - title: seriesTitle.trim() || "No title found", - link: episodesLink || "", - }); - } - }); - return episodeLinks; - } - catch (err) { - console.error(err); - return []; - } - }; - console.log("modGetStream", type, url); - if (type === "movie") { - const servers = await modGetEpisodeLinks({ url, providerContext }); - url = servers[0].link || url; - } - let downloadLink = await modExtractor(url, providerContext); - // console.log(downloadLink.data); - const ddl = downloadLink?.data?.match(/content="0;url=(.*?)"/)?.[1] || url; - // console.log('ddl', url); - // console.log(ddl); - // console.log(ddl); - const servers = []; - const driveLink = await isDriveLink(ddl); - const driveRes = await axios.get(driveLink, { headers }); - const driveHtml = driveRes.data; - const $drive = cheerio.load(driveHtml); - try { - const resumeBot = $drive(".btn.btn-light").attr("href") || ""; - const resumeBotRes = await axios.get(resumeBot, { headers }); - const resumeBotToken = resumeBotRes.data.match(/formData\.append\('token', '([a-f0-9]+)'\)/)[1]; - const resumeBotBody = new FormData(); - resumeBotBody.append("token", resumeBotToken); - const resumeBotPath = resumeBotRes.data.match(/fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/)[1]; - const resumeBotBaseUrl = resumeBot.split("/download")[0]; - // console.log( - // 'resumeBotPath', - // resumeBotBaseUrl + '/download?id=' + resumeBotPath, - // ); - // console.log('resumeBotBody', resumeBotToken); - const resumeBotDownload = await fetch(resumeBotBaseUrl + "/download?id=" + resumeBotPath, { - method: "POST", - body: resumeBotBody, - headers: { - Referer: resumeBot, - Cookie: "PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308", - }, - }); - const resumeBotDownloadData = await resumeBotDownload.json(); - console.log("resumeBotDownloadData", resumeBotDownloadData.url); - servers.push({ - server: "ResumeBot", - link: resumeBotDownloadData.url, - type: "mkv", - }); - } - catch (err) { - console.log("ResumeBot link not found", err); - } - // CF workers type 1 - try { - const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=1"; - const cfWorkersRes = await axios.get(cfWorkersLink, { headers }); - const cfWorkersHtml = cfWorkersRes.data; - const $cfWorkers = cheerio.load(cfWorkersHtml); - const cfWorkersStream = $cfWorkers(".btn-success"); - cfWorkersStream.each((i, el) => { - const link = el.attribs?.href; - if (link) { - servers.push({ - server: "Cf Worker 1." + i, - link: link, - type: "mkv", - }); - } - }); - } - catch (err) { - console.log("CF workers link not found", err); - } - // CF workers type 2 - try { - const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=2"; - const cfWorkersRes = await axios.get(cfWorkersLink, { headers }); - const cfWorkersHtml = cfWorkersRes.data; - const $cfWorkers = cheerio.load(cfWorkersHtml); - const cfWorkersStream = $cfWorkers(".btn-success"); - cfWorkersStream.each((i, el) => { - const link = el.attribs?.href; - if (link) { - servers.push({ - server: "Cf Worker 2." + i, - link: link, - type: "mkv", - }); - } - }); - } - catch (err) { - console.log("CF workers link not found", err); - } - // gdrive - //instant link - try { - 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 = await fetch(videoSeedUrl, { - method: "POST", - body: InstantFromData, - headers: { - "x-token": videoSeedUrl, - }, - }); - const instantLinkData = await instantLinkRes.json(); - // console.log('instantLinkData', instantLinkData); - if (instantLinkData.error === false) { - const instantLink = instantLinkData.url; + const resumeBotDownloadData = yield resumeBotDownload.json(); + console.log("resumeBotDownloadData", resumeBotDownloadData.url); servers.push({ - server: "Gdrive-Instant", - link: instantLink, + server: "ResumeBot", + link: resumeBotDownloadData.url, type: "mkv", }); } - else { - console.log("Instant link not found", instantLinkData); + catch (err) { + console.log("ResumeBot link not found", err); } + // CF workers type 1 + try { + const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=1"; + const cfWorkersRes = yield axios.get(cfWorkersLink, { headers }); + const cfWorkersHtml = cfWorkersRes.data; + const $cfWorkers = cheerio.load(cfWorkersHtml); + const cfWorkersStream = $cfWorkers(".btn-success"); + cfWorkersStream.each((i, el) => { + var _a; + const link = (_a = el.attribs) === null || _a === void 0 ? void 0 : _a.href; + if (link) { + servers.push({ + server: "Cf Worker 1." + i, + link: link, + type: "mkv", + }); + } + }); + } + catch (err) { + console.log("CF workers link not found", err); + } + // CF workers type 2 + try { + const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=2"; + const cfWorkersRes = yield axios.get(cfWorkersLink, { headers }); + const cfWorkersHtml = cfWorkersRes.data; + const $cfWorkers = cheerio.load(cfWorkersHtml); + const cfWorkersStream = $cfWorkers(".btn-success"); + cfWorkersStream.each((i, el) => { + var _a; + const link = (_a = el.attribs) === null || _a === void 0 ? void 0 : _a.href; + if (link) { + servers.push({ + server: "Cf Worker 2." + i, + link: link, + type: "mkv", + }); + } + }); + } + catch (err) { + console.log("CF workers link not found", err); + } + // gdrive + //instant link + try { + 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; + servers.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 servers; } catch (err) { - console.log("Instant link not found", err); + console.log("getStream error", err); + return []; } - return servers; - } - catch (err) { - console.log("getStream error", err); - return []; - } + }); }; exports.getStream = getStream; -const isDriveLink = async (ddl) => { +const isDriveLink = (ddl) => __awaiter(void 0, void 0, void 0, function* () { if (ddl.includes("drive")) { - const driveLeach = await fetch(ddl); - const driveLeachData = await driveLeach.text(); + const driveLeach = yield fetch(ddl); + const driveLeachData = yield driveLeach.text(); const pathMatch = driveLeachData.match(/window\.location\.replace\("([^"]+)"\)/); - const path = pathMatch?.[1]; + const path = pathMatch === null || pathMatch === void 0 ? void 0 : pathMatch[1]; const mainUrl = ddl.split("/")[2]; console.log(`driveUrl = https://${mainUrl}${path}`); return `https://${mainUrl}${path}`; @@ -210,47 +226,49 @@ const isDriveLink = async (ddl) => { else { return ddl; } -}; -async function modExtractor(url, providerContext) { - const { axios, cheerio } = providerContext; - try { - const wpHttp = url.split("sid=")[1]; - var bodyFormData0 = new FormData(); - bodyFormData0.append("_wp_http", wpHttp); - const res = await fetch(url.split("?")[0], { - method: "POST", - body: bodyFormData0, - }); - const data = await res.text(); - // console.log('', data); - const html = data; - const $ = cheerio.load(html); - // find input with name="_wp_http2" - const wpHttp2 = $("input").attr("name", "_wp_http2").val(); - // console.log('wpHttp2', wpHttp2); - // form data - var bodyFormData = new FormData(); - bodyFormData.append("_wp_http2", wpHttp2); - const formUrl1 = $("form").attr("action"); - const formUrl = formUrl1 || url.split("?")[0]; - const res2 = await fetch(formUrl, { - method: "POST", - body: bodyFormData, - }); - const html2 = await res2.text(); - const link = html2.match(/setAttribute\("href",\s*"(.*?)"/)[1]; - console.log(link); - const cookie = link.split("=")[1]; - console.log("cookie", cookie); - const downloadLink = await axios.get(link, { - headers: { - Referer: formUrl, - Cookie: `${cookie}=${wpHttp2}`, - }, - }); - return downloadLink; - } - catch (err) { - console.log("modGetStream error", err); - } +}); +function modExtractor(url, providerContext) { + return __awaiter(this, void 0, void 0, function* () { + const { axios, cheerio } = providerContext; + try { + const wpHttp = url.split("sid=")[1]; + var bodyFormData0 = new FormData(); + bodyFormData0.append("_wp_http", wpHttp); + const res = yield fetch(url.split("?")[0], { + method: "POST", + body: bodyFormData0, + }); + const data = yield res.text(); + // console.log('', data); + const html = data; + const $ = cheerio.load(html); + // find input with name="_wp_http2" + const wpHttp2 = $("input").attr("name", "_wp_http2").val(); + // console.log('wpHttp2', wpHttp2); + // form data + var bodyFormData = new FormData(); + bodyFormData.append("_wp_http2", wpHttp2); + const formUrl1 = $("form").attr("action"); + const formUrl = formUrl1 || url.split("?")[0]; + const res2 = yield fetch(formUrl, { + method: "POST", + body: bodyFormData, + }); + const html2 = yield res2.text(); + const link = html2.match(/setAttribute\("href",\s*"(.*?)"/)[1]; + console.log(link); + const cookie = link.split("=")[1]; + console.log("cookie", cookie); + const downloadLink = yield axios.get(link, { + headers: { + Referer: formUrl, + Cookie: `${cookie}=${wpHttp2}`, + }, + }); + return downloadLink; + } + catch (err) { + console.log("modGetStream error", err); + } + }); } diff --git a/dist/moviesApi/stream.js b/dist/moviesApi/stream.js index f18561f..795def8 100644 --- a/dist/moviesApi/stream.js +++ b/dist/moviesApi/stream.js @@ -1,85 +1,100 @@ "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.mpGetStream = void 0; const types_1 = require("../types"); -const mpGetStream = async function ({ link: id, type, providerContext, }) { - try { - const { getBaseUrl, cheerio } = providerContext; - const streams = []; - const { season, episode, tmdbId } = JSON.parse(id); - const baseUrl = await getBaseUrl('moviesapi'); - const link = type === 'movie' - ? `${baseUrl}/movie/${tmdbId}` - : `${baseUrl}/tv/${tmdbId}-${season}-${episode}`; - const res = await fetch(link, { - headers: { - referer: baseUrl, - }, - }); - const baseData = await res.text(); - const $ = cheerio.load(baseData); - const embededUrl = $('iframe').attr('src') || ''; - const response = await fetch(embededUrl, { - 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', - referer: baseUrl, - }, - referrer: baseUrl, - method: 'GET', - mode: 'cors', - }); - const data2 = await response.text(); - // Extract the encrypted content - const contents = data2.match(/const\s+Encrypted\s*=\s*['"]({.*})['"]/)?.[1] || ''; - if (embededUrl) { - const res2 = await fetch('https://ext.8man.me/api/decrypt?passphrase==JV[t}{trEV=Ilh5', { - method: 'POST', - body: contents, - }); - const finalData = await res2.json(); - const subtitle = finalData?.subtitles?.map((sub) => ({ - title: sub?.label || 'Unknown', - language: sub?.label, - type: sub?.file?.includes('.vtt') - ? types_1.TextTrackType.VTT - : types_1.TextTrackType.SUBRIP, - uri: sub?.file, - })); - streams.push({ - server: 'vidstreaming ', - type: 'm3u8', - subtitles: subtitle, - link: finalData?.videoUrl, +const mpGetStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link: id, type, providerContext, }) { + var _b, _c; + try { + const { getBaseUrl, cheerio } = providerContext; + const streams = []; + const { season, episode, tmdbId } = JSON.parse(id); + const baseUrl = yield getBaseUrl('moviesapi'); + const link = type === 'movie' + ? `${baseUrl}/movie/${tmdbId}` + : `${baseUrl}/tv/${tmdbId}-${season}-${episode}`; + const res = yield fetch(link, { headers: { - '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', + referer: baseUrl, }, }); + const baseData = yield res.text(); + const $ = cheerio.load(baseData); + const embededUrl = $('iframe').attr('src') || ''; + const response = yield fetch(embededUrl, { + 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', + referer: baseUrl, + }, + referrer: baseUrl, + 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]) || ''; + if (embededUrl) { + 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', + 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, + uri: sub === null || sub === void 0 ? void 0 : sub.file, + }); + }); + streams.push({ + 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', + 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', + }, + }); + } + return streams; } - return streams; - } - catch (err) { - console.error(err); - return []; - } + catch (err) { + console.error(err); + return []; + } + }); }; exports.mpGetStream = mpGetStream; diff --git a/dist/multi/meta.js b/dist/multi/meta.js index 7ce8c2e..1192299 100644 --- a/dist/multi/meta.js +++ b/dist/multi/meta.js @@ -1,76 +1,87 @@ "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 getMeta = async function ({ link, providerContext, }) { - try { - const { axios, cheerio } = providerContext; - const url = link; - const res = await axios.get(url); - const data = res.data; - const $ = cheerio.load(data); - const type = url.includes("tvshows") ? "series" : "movie"; - const imdbId = ""; - const title = url.split("/")[4].replace(/-/g, " "); - const image = $(".g-item").find("a").attr("href") || ""; - const synopsis = $(".wp-content").find("p").text() || ""; - // Links - const links = []; - if (type === "series") { - $("#seasons") - .children() - .map((i, element) => { - const title = $(element) - .find(".title") - .children() - .remove() - .end() - .text(); - let episodesList = []; - $(element) - .find(".episodios") +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { + try { + const { axios, cheerio } = providerContext; + const url = link; + const res = yield axios.get(url); + const data = res.data; + const $ = cheerio.load(data); + const type = url.includes("tvshows") ? "series" : "movie"; + const imdbId = ""; + const title = url.split("/")[4].replace(/-/g, " "); + const image = $(".g-item").find("a").attr("href") || ""; + const synopsis = $(".wp-content").find("p").text() || ""; + // Links + const links = []; + if (type === "series") { + $("#seasons") .children() .map((i, element) => { - const title = "Episode" + - $(element).find(".numerando").text().trim().split("-")[1]; - const link = $(element).find("a").attr("href"); - if (title && link) { - episodesList.push({ title, link }); + const title = $(element) + .find(".title") + .children() + .remove() + .end() + .text(); + let episodesList = []; + $(element) + .find(".episodios") + .children() + .map((i, element) => { + const title = "Episode" + + $(element).find(".numerando").text().trim().split("-")[1]; + const link = $(element).find("a").attr("href"); + if (title && link) { + episodesList.push({ title, link }); + } + }); + if (title && episodesList.length > 0) { + links.push({ + title, + directLinks: episodesList, + }); } }); - if (title && episodesList.length > 0) { - links.push({ - title, - directLinks: episodesList, - }); - } - }); + } + else { + links.push({ + title: title, + directLinks: [{ title: title, link: url.slice(0, -1), type: "movie" }], + }); + } + // console.log('multi meta', links); + return { + title, + synopsis, + image, + imdbId, + type, + linkList: links, + }; } - else { - links.push({ - title: title, - directLinks: [{ title: title, link: url.slice(0, -1), type: "movie" }], - }); + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; } - // console.log('multi meta', 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; diff --git a/dist/multi/posts.js b/dist/multi/posts.js index 8bddb2b..1aa8c61 100644 --- a/dist/multi/posts.js +++ b/dist/multi/posts.js @@ -1,45 +1,60 @@ "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 getPosts = async function ({ filter, page, signal, providerContext, }) { - const { getBaseUrl, cheerio } = providerContext; - const baseUrl = await getBaseUrl("multi"); - const url = `${baseUrl + filter}page/${page}/`; - return posts({ url, signal, cheerio }); +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, signal, providerContext, }) { + const { getBaseUrl, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("multi"); + const url = `${baseUrl + filter}page/${page}/`; + return posts({ url, signal, cheerio }); + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, signal, providerContext, }) { - const { getBaseUrl, cheerio } = providerContext; - const baseUrl = await getBaseUrl("multi"); - const url = `${baseUrl}/?s=${searchQuery}`; - return posts({ url, signal, cheerio }); +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, signal, providerContext, }) { + const { getBaseUrl, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("multi"); + const url = `${baseUrl}/?s=${searchQuery}`; + return posts({ url, signal, cheerio }); + }); }; exports.getSearchPosts = getSearchPosts; -async function posts({ url, signal, cheerio, }) { - try { - const res = await fetch(url, { signal }); - const data = await res.text(); - const $ = cheerio.load(data); - const catalog = []; - $(".items.full") - .children() - .map((i, element) => { - const title = $(element).find(".poster").find("img").attr("alt"); - const link = $(element).find(".poster").find("a").attr("href"); - const image = $(element).find(".poster").find("img").attr("data-src") || - $(element).find(".poster").find("img").attr("src"); - if (title && link && image) { - catalog.push({ - title: title, - link: link, - image: image, - }); - } - }); - return catalog; - } - catch (err) { - console.error("multiGetPosts error ", err); - return []; - } +function posts(_a) { + return __awaiter(this, arguments, void 0, function* ({ url, signal, cheerio, }) { + try { + const res = yield fetch(url, { signal }); + const data = yield res.text(); + const $ = cheerio.load(data); + const catalog = []; + $(".items.full") + .children() + .map((i, element) => { + const title = $(element).find(".poster").find("img").attr("alt"); + const link = $(element).find(".poster").find("a").attr("href"); + const image = $(element).find(".poster").find("img").attr("data-src") || + $(element).find(".poster").find("img").attr("src"); + if (title && link && image) { + catalog.push({ + title: title, + link: link, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + console.error("multiGetPosts error ", err); + return []; + } + }); } diff --git a/dist/multi/stream.js b/dist/multi/stream.js index 7fab223..5ebf826 100644 --- a/dist/multi/stream.js +++ b/dist/multi/stream.js @@ -1,134 +1,140 @@ "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 types_1 = require("../types"); -const getStream = async function ({ link: url, providerContext, }) { - const { axios, cheerio } = providerContext; - const headers = { - "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"', - Referer: "https://multimovies.online/", - "Sec-Fetch-User": "?1", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0", - }; - try { - const res = await axios.get(url, { headers }); - const html = res.data; - const $ = cheerio.load(html); - const streamLinks = []; - const postId = $("#player-option-1").attr("data-post"); - const nume = $("#player-option-1").attr("data-nume"); - const typeValue = $("#player-option-1").attr("data-type"); - const baseUrl = url.split("/").slice(0, 3).join("/"); - console.log("baseUrl", baseUrl); - const formData = new FormData(); - formData.append("action", "doo_player_ajax"); - formData.append("post", postId || ""); - formData.append("nume", nume || ""); - formData.append("type", typeValue || ""); - console.log("formData", formData); - const playerRes = await fetch(`${baseUrl}/wp-admin/admin-ajax.php`, { - headers: headers, - body: formData, - method: "POST", - }); - const playerData = await playerRes.json(); - console.log("playerData", playerData); - let ifameUrl = playerData?.embed_url?.match(/]+src="([^"]+)"[^>]*>/i)?.[1] || - playerData?.embed_url; - console.log("ifameUrl", ifameUrl); - if (!ifameUrl.includes("multimovies")) { - let playerBaseUrl = ifameUrl.split("/").slice(0, 3).join("/"); - const newPlayerBaseUrl = await axios.head(playerBaseUrl, { headers }); - if (newPlayerBaseUrl) { - playerBaseUrl = newPlayerBaseUrl.request?.responseURL - ?.split("/") - .slice(0, 3) - .join("/"); - } - const playerId = ifameUrl.split("/").pop(); - const NewformData = new FormData(); - NewformData.append("sid", playerId); - console.log("NewformData", playerBaseUrl + "/embedhelper.php", NewformData); - const playerRes = await fetch(`${playerBaseUrl}/embedhelper.php`, { +const getStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link: url, providerContext, }) { + var _b, _c, _d, _e, _f, _g, _h, _j, _k; + const { axios, cheerio } = providerContext; + const headers = { + "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"', + Referer: "https://multimovies.online/", + "Sec-Fetch-User": "?1", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0", + }; + try { + const res = yield axios.get(url, { headers }); + const html = res.data; + const $ = cheerio.load(html); + const streamLinks = []; + const postId = $("#player-option-1").attr("data-post"); + const nume = $("#player-option-1").attr("data-nume"); + const typeValue = $("#player-option-1").attr("data-type"); + const baseUrl = url.split("/").slice(0, 3).join("/"); + console.log("baseUrl", baseUrl); + const formData = new FormData(); + formData.append("action", "doo_player_ajax"); + formData.append("post", postId || ""); + formData.append("nume", nume || ""); + formData.append("type", typeValue || ""); + console.log("formData", formData); + const playerRes = yield fetch(`${baseUrl}/wp-admin/admin-ajax.php`, { headers: headers, - body: NewformData, + body: formData, method: "POST", }); - const playerData = await playerRes.json(); - // console.log('playerData', playerData); - const siteUrl = playerData?.siteUrls?.smwh; - const siteId = JSON.parse(atob(playerData?.mresult))?.smwh || - playerData?.mresult?.smwh; - const newIframeUrl = siteUrl + siteId; - console.log("newIframeUrl", newIframeUrl); - if (newIframeUrl) { - ifameUrl = newIframeUrl; - } - } - const iframeRes = await axios.get(ifameUrl, { - headers: { - ...headers, - Referer: url, - }, - }); - const iframeData = iframeRes.data; - // Step 1: Extract the function parameters and the encoded string - var functionRegex = /eval\(function\((.*?)\)\{.*?return p\}.*?\('(.*?)'\.split/; - var match = functionRegex.exec(iframeData); - let p = ""; - if (match) { - // var params = match[1].split(',').map(param => param.trim()); - var encodedString = match[2]; - // console.log('Parameters:', params); - // console.log('Encoded String:', encodedString.split("',36,")[0], '🔥🔥'); - p = encodedString.split("',36,")?.[0].trim(); - let a = 36; - let c = encodedString.split("',36,")[1].slice(2).split("|").length; - let k = encodedString.split("',36,")[1].slice(2).split("|"); - while (c--) { - if (k[c]) { - var regex = new RegExp("\\b" + c.toString(a) + "\\b", "g"); - p = p.replace(regex, k[c]); + const playerData = yield playerRes.json(); + console.log("playerData", playerData); + let ifameUrl = ((_c = (_b = playerData === null || playerData === void 0 ? void 0 : playerData.embed_url) === null || _b === void 0 ? void 0 : _b.match(/]+src="([^"]+)"[^>]*>/i)) === null || _c === void 0 ? void 0 : _c[1]) || + (playerData === null || playerData === void 0 ? void 0 : playerData.embed_url); + console.log("ifameUrl", ifameUrl); + if (!ifameUrl.includes("multimovies")) { + let playerBaseUrl = ifameUrl.split("/").slice(0, 3).join("/"); + const newPlayerBaseUrl = yield axios.head(playerBaseUrl, { headers }); + if (newPlayerBaseUrl) { + playerBaseUrl = (_e = (_d = newPlayerBaseUrl.request) === null || _d === void 0 ? void 0 : _d.responseURL) === null || _e === void 0 ? void 0 : _e.split("/").slice(0, 3).join("/"); + } + const playerId = ifameUrl.split("/").pop(); + const NewformData = new FormData(); + NewformData.append("sid", playerId); + console.log("NewformData", playerBaseUrl + "/embedhelper.php", NewformData); + const playerRes = yield fetch(`${playerBaseUrl}/embedhelper.php`, { + headers: headers, + body: NewformData, + method: "POST", + }); + const playerData = yield playerRes.json(); + // console.log('playerData', playerData); + const siteUrl = (_f = playerData === null || playerData === void 0 ? void 0 : playerData.siteUrls) === null || _f === void 0 ? void 0 : _f.smwh; + const siteId = ((_g = JSON.parse(atob(playerData === null || playerData === void 0 ? void 0 : playerData.mresult))) === null || _g === void 0 ? void 0 : _g.smwh) || + ((_h = playerData === null || playerData === void 0 ? void 0 : playerData.mresult) === null || _h === void 0 ? void 0 : _h.smwh); + const newIframeUrl = siteUrl + siteId; + console.log("newIframeUrl", newIframeUrl); + if (newIframeUrl) { + ifameUrl = newIframeUrl; } } - // console.log('Decoded String:', p); - } - else { - console.log("No match found"); - } - const streamUrl = p?.match(/https?:\/\/[^"]+?\.m3u8[^"]*/)?.[0]; - const subtitles = []; - const subtitleMatch = p?.match(/https:\/\/[^\s"]+\.vtt/g); - // console.log('subtitleMatch', subtitleMatch); - // console.log('streamUrl', streamUrl); - if (subtitleMatch?.length) { - subtitleMatch.forEach((sub) => { - const lang = sub.match(/_([a-zA-Z]{3})\.vtt$/)[1]; - subtitles.push({ - language: lang, - uri: sub, - type: types_1.TextTrackType.VTT, - title: lang, + const iframeRes = yield axios.get(ifameUrl, { + headers: Object.assign(Object.assign({}, headers), { Referer: url }), + }); + const iframeData = iframeRes.data; + // Step 1: Extract the function parameters and the encoded string + var functionRegex = /eval\(function\((.*?)\)\{.*?return p\}.*?\('(.*?)'\.split/; + var match = functionRegex.exec(iframeData); + let p = ""; + if (match) { + // var params = match[1].split(',').map(param => param.trim()); + var encodedString = match[2]; + // console.log('Parameters:', params); + // console.log('Encoded String:', encodedString.split("',36,")[0], '🔥🔥'); + p = (_j = encodedString.split("',36,")) === null || _j === void 0 ? void 0 : _j[0].trim(); + let a = 36; + let c = encodedString.split("',36,")[1].slice(2).split("|").length; + let k = encodedString.split("',36,")[1].slice(2).split("|"); + while (c--) { + if (k[c]) { + var regex = new RegExp("\\b" + c.toString(a) + "\\b", "g"); + p = p.replace(regex, k[c]); + } + } + // console.log('Decoded String:', p); + } + else { + console.log("No match found"); + } + const streamUrl = (_k = p === null || p === void 0 ? void 0 : p.match(/https?:\/\/[^"]+?\.m3u8[^"]*/)) === null || _k === void 0 ? void 0 : _k[0]; + const subtitles = []; + const subtitleMatch = p === null || p === void 0 ? void 0 : p.match(/https:\/\/[^\s"]+\.vtt/g); + // console.log('subtitleMatch', subtitleMatch); + // console.log('streamUrl', streamUrl); + if (subtitleMatch === null || subtitleMatch === void 0 ? void 0 : subtitleMatch.length) { + subtitleMatch.forEach((sub) => { + const lang = sub.match(/_([a-zA-Z]{3})\.vtt$/)[1]; + subtitles.push({ + language: lang, + uri: sub, + type: types_1.TextTrackType.VTT, + title: lang, + }); }); - }); + } + console.log("streamUrl", streamUrl); + console.log("newUrl", streamUrl === null || streamUrl === void 0 ? void 0 : streamUrl.replace(/&i=\d+,'\.4&/, "&i=0.4&")); + if (streamUrl) { + streamLinks.push({ + server: "Multi", + link: streamUrl.replace(/&i=\d+,'\.4&/, "&i=0.4&"), + type: "m3u8", + subtitles: subtitles, + }); + } + return streamLinks; } - console.log("streamUrl", streamUrl); - console.log("newUrl", streamUrl?.replace(/&i=\d+,'\.4&/, "&i=0.4&")); - if (streamUrl) { - streamLinks.push({ - server: "Multi", - link: streamUrl.replace(/&i=\d+,'\.4&/, "&i=0.4&"), - type: "m3u8", - subtitles: subtitles, - }); + catch (err) { + console.error(err); + return []; } - return streamLinks; - } - catch (err) { - console.error(err); - return []; - } + }); }; exports.getStream = getStream; diff --git a/dist/netflixMirror/episodes.js b/dist/netflixMirror/episodes.js index 6d0a6c1..f6d54a9 100644 --- a/dist/netflixMirror/episodes.js +++ b/dist/netflixMirror/episodes.js @@ -1,39 +1,51 @@ "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.getEpisodes = void 0; -const getEpisodes = async function ({ url: link, providerContext, }) { - const { getBaseUrl, axios } = providerContext; - let providerValue = "netflixMirror"; - try { - const baseUrl = await getBaseUrl("nfMirror"); - const url = `${baseUrl}${providerValue === "netflixMirror" - ? "/episodes.php?s=" - : "/pv/episodes.php?s="}` + - link + - "&t=" + - Math.round(new Date().getTime() / 1000); - console.log("nfEpisodesUrl", url); - const res = await axios.get(url, { - headers: { - "Content-Type": "application/json", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36", - "Accept-Language": "en-US,en;q=0.9", - }, - }); - const data = res.data; - console.log("nfEpisodes", data); - const episodeList = []; - data?.episodes?.map((episode) => { - episodeList.push({ - title: "Episode " + episode?.ep.replace("E", ""), - link: episode?.id, +const getEpisodes = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ url: link, providerContext, }) { + var _b; + const { getBaseUrl, axios } = providerContext; + let providerValue = "netflixMirror"; + try { + const baseUrl = yield getBaseUrl("nfMirror"); + const url = `${baseUrl}${providerValue === "netflixMirror" + ? "/episodes.php?s=" + : "/pv/episodes.php?s="}` + + link + + "&t=" + + Math.round(new Date().getTime() / 1000); + console.log("nfEpisodesUrl", url); + const res = yield axios.get(url, { + headers: { + "Content-Type": "application/json", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36", + "Accept-Language": "en-US,en;q=0.9", + }, }); - }); - return episodeList; - } - catch (err) { - console.error("nfGetEpisodes error", err); - return []; - } + const data = res.data; + console.log("nfEpisodes", data); + const episodeList = []; + (_b = data === null || data === void 0 ? void 0 : data.episodes) === null || _b === void 0 ? void 0 : _b.map((episode) => { + episodeList.push({ + title: "Episode " + (episode === null || episode === void 0 ? void 0 : episode.ep.replace("E", "")), + link: episode === null || episode === void 0 ? void 0 : episode.id, + }); + }); + return episodeList; + } + catch (err) { + console.error("nfGetEpisodes error", err); + return []; + } + }); }; exports.getEpisodes = getEpisodes; diff --git a/dist/netflixMirror/meta.js b/dist/netflixMirror/meta.js index dbb0afd..95c172a 100644 --- a/dist/netflixMirror/meta.js +++ b/dist/netflixMirror/meta.js @@ -1,57 +1,66 @@ "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 getMeta = async function ({ link, }) { - let providerValue = "netflixMirror"; - try { - const isPrime = providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false"; - const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${encodeURIComponent(link)}`; - console.log("nfifo", url); - const res = await fetch(url, { - credentials: "omit", - }); - const data = await res.json(); - const id = link.split("id=")[1]?.split("&")[0]; - const meta = { - title: data.title, - synopsis: data.desc, - image: `https://img.nfmirrorcdn.top/poster/h/${id}.jpg`, - cast: data?.short_cast?.split(","), - tags: [data?.year, data?.hdsd, ...data?.thismovieis?.split(",")], - imdbId: "", - type: "series", - }; - console.log("nfinfo", meta); - const linkList = []; - if (data?.season?.length > 0) { - data.season.map((season) => { - linkList.push({ - title: "Season " + season?.s, - episodesLink: season?.id, +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, }) { + var _b, _c, _d, _e; + let providerValue = "netflixMirror"; + try { + const isPrime = providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false"; + const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${encodeURIComponent(link)}`; + console.log("nfifo", url); + const res = yield fetch(url, { + credentials: "omit", + }); + const data = yield res.json(); + const id = (_b = link.split("id=")[1]) === null || _b === void 0 ? void 0 : _b.split("&")[0]; + const meta = { + title: data.title, + synopsis: data.desc, + image: `https://img.nfmirrorcdn.top/poster/h/${id}.jpg`, + cast: (_c = data === null || data === void 0 ? void 0 : data.short_cast) === null || _c === void 0 ? void 0 : _c.split(","), + tags: [data === null || data === void 0 ? void 0 : data.year, data === null || data === void 0 ? void 0 : data.hdsd, ...(_d = data === null || data === void 0 ? void 0 : data.thismovieis) === null || _d === void 0 ? void 0 : _d.split(",")], + imdbId: "", + type: "series", + }; + console.log("nfinfo", meta); + const linkList = []; + if (((_e = data === null || data === void 0 ? void 0 : data.season) === null || _e === void 0 ? void 0 : _e.length) > 0) { + data.season.map((season) => { + linkList.push({ + title: "Season " + (season === null || season === void 0 ? void 0 : season.s), + episodesLink: season === null || season === void 0 ? void 0 : season.id, + }); }); - }); + } + else { + linkList.push({ + title: meta.title, + directLinks: [{ link: id, title: "Movie", type: "movie" }], + }); + } + return Object.assign(Object.assign({}, meta), { linkList: linkList }); } - else { - linkList.push({ - title: meta.title, - directLinks: [{ link: id, title: "Movie", type: "movie" }], - }); + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "", + linkList: [], + }; } - return { - ...meta, - linkList: linkList, - }; - } - catch (err) { - console.error(err); - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "", - linkList: [], - }; - } + }); }; exports.getMeta = getMeta; diff --git a/dist/netflixMirror/posts.js b/dist/netflixMirror/posts.js index 46b3976..f148908 100644 --- a/dist/netflixMirror/posts.js +++ b/dist/netflixMirror/posts.js @@ -1,94 +1,108 @@ "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 getPosts = async function ({ filter, page, providerValue, signal, providerContext, }) { - try { - const { getBaseUrl, cheerio } = providerContext; - const baseUrl = await getBaseUrl("nfMirror"); - const catalog = []; - if (page > 1) { +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, providerValue, signal, providerContext, }) { + try { + const { getBaseUrl, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("nfMirror"); + const catalog = []; + if (page > 1) { + return []; + } + // console.log(filter); + const isPrime = providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false"; + const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${baseUrl + filter}`; + const res = yield fetch(url, { + signal: signal, + method: "GET", + credentials: "omit", + }); + const data = yield res.text(); + // console.log('nfPost', data); + const $ = cheerio.load(data); + $("a.post-data").map((i, element) => { + const title = ""; + const id = $(element).attr("data-post"); + // console.log('id', id); + const image = $(element).find("img").attr("data-src") || ""; + if (id) { + catalog.push({ + title: title, + link: baseUrl + + `${providerValue === "netflixMirror" + ? "/post.php?id=" + : "/pv/post.php?id="}` + + id + + "&t=" + + Math.round(new Date().getTime() / 1000), + image: image, + }); + } + }); + // console.log(catalog); + return catalog; + } + catch (err) { + console.error("nf error ", err); return []; } - // console.log(filter); - const isPrime = providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false"; - const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${baseUrl + filter}`; - const res = await fetch(url, { - signal: signal, - method: "GET", - credentials: "omit", - }); - const data = await res.text(); - // console.log('nfPost', data); - const $ = cheerio.load(data); - $("a.post-data").map((i, element) => { - const title = ""; - const id = $(element).attr("data-post"); - // console.log('id', id); - const image = $(element).find("img").attr("data-src") || ""; - if (id) { - catalog.push({ - title: title, - link: baseUrl + - `${providerValue === "netflixMirror" - ? "/post.php?id=" - : "/pv/post.php?id="}` + - id + - "&t=" + - Math.round(new Date().getTime() / 1000), - image: image, - }); - } - }); - // console.log(catalog); - return catalog; - } - catch (err) { - console.error("nf error ", err); - return []; - } + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, providerValue, signal, providerContext, }) { - const { getBaseUrl } = providerContext; - try { - if (page > 1) { +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, providerValue, signal, providerContext, }) { + var _b; + const { getBaseUrl } = providerContext; + try { + if (page > 1) { + return []; + } + const catalog = []; + const baseUrl = yield getBaseUrl("nfMirror"); + const isPrime = providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false"; + const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${baseUrl}${providerValue === "netflixMirror" ? "" : "/pv"}/search.php?s=${encodeURI(searchQuery)}`; + const res = yield fetch(url, { + signal: signal, + method: "GET", + credentials: "omit", + }); + const data = yield res.json(); + (_b = data === null || data === void 0 ? void 0 : data.searchResult) === null || _b === void 0 ? void 0 : _b.forEach((result) => { + const title = (result === null || result === void 0 ? void 0 : result.t) || ""; + const id = result === null || result === void 0 ? void 0 : result.id; + const image = providerValue === "netflixMirror" + ? `https://imgcdn.media/poster/v/${id}.jpg` + : ""; + if (id) { + catalog.push({ + title: title, + link: baseUrl + + `${providerValue === "netflixMirror" + ? "/mobile/post.php?id=" + : "/mobile/pv/post.php?id="}` + + id + + "&t=" + + Math.round(new Date().getTime() / 1000), + image: image, + }); + } + }); + return catalog; + } + catch (err) { + console.error("Search error:", err); return []; } - const catalog = []; - const baseUrl = await getBaseUrl("nfMirror"); - const isPrime = providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false"; - const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${baseUrl}${providerValue === "netflixMirror" ? "" : "/pv"}/search.php?s=${encodeURI(searchQuery)}`; - const res = await fetch(url, { - signal: signal, - method: "GET", - credentials: "omit", - }); - const data = await res.json(); - data?.searchResult?.forEach((result) => { - const title = result?.t || ""; - const id = result?.id; - const image = providerValue === "netflixMirror" - ? `https://imgcdn.media/poster/v/${id}.jpg` - : ""; - if (id) { - catalog.push({ - title: title, - link: baseUrl + - `${providerValue === "netflixMirror" - ? "/mobile/post.php?id=" - : "/mobile/pv/post.php?id="}` + - id + - "&t=" + - Math.round(new Date().getTime() / 1000), - image: image, - }); - } - }); - return catalog; - } - catch (err) { - console.error("Search error:", err); - return []; - } + }); }; exports.getSearchPosts = getSearchPosts; diff --git a/dist/netflixMirror/stream.js b/dist/netflixMirror/stream.js index 17bbe41..9a9a78a 100644 --- a/dist/netflixMirror/stream.js +++ b/dist/netflixMirror/stream.js @@ -1,25 +1,35 @@ "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: id, providerContext, }) => { +const getStream = (_a) => __awaiter(void 0, [_a], void 0, function* ({ link: id, providerContext, }) { const { getBaseUrl } = providerContext; try { let providerValue = "netflixMirror"; - const baseUrl = await getBaseUrl("nfMirror"); + const baseUrl = yield getBaseUrl("nfMirror"); const url = `https://netmirror.8man.me/api/net-proxy?url=${baseUrl}${providerValue === "netflixMirror" ? "/mobile/playlist.php?id=" : "/pv/playlist.php?id="}${id}&t=${Math.round(new Date().getTime() / 1000)}`; console.log("nfGetStream, url:", url); - const res = await fetch(url, { + const res = yield fetch(url, { credentials: "omit", }); - const resJson = await res.json(); - const data = resJson?.[0]; + const resJson = yield res.json(); + const data = resJson === null || resJson === void 0 ? void 0 : resJson[0]; const streamLinks = []; - data?.sources.forEach((source) => { + data === null || data === void 0 ? void 0 : data.sources.forEach((source) => { + var _a; streamLinks.push({ server: source.label, - link: (baseUrl + source.file)?.replace(":su", ":ni"), + link: (_a = (baseUrl + source.file)) === null || _a === void 0 ? void 0 : _a.replace(":su", ":ni"), type: "m3u8", headers: { Referer: baseUrl, @@ -35,5 +45,5 @@ const getStream = async ({ link: id, providerContext, }) => { console.error(err); return []; } -}; +}); exports.getStream = getStream; diff --git a/dist/primeMirror/episodes.js b/dist/primeMirror/episodes.js index 6d55668..a66dc2f 100644 --- a/dist/primeMirror/episodes.js +++ b/dist/primeMirror/episodes.js @@ -1,39 +1,51 @@ "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.getEpisodes = void 0; -const getEpisodes = async function ({ url: link, providerContext, }) { - const { getBaseUrl, axios } = providerContext; - let providerValue = "primeMirror"; - try { - const baseUrl = await getBaseUrl("nfMirror"); - const url = `${baseUrl}${providerValue === "netflixMirror" - ? "/episodes.php?s=" - : "/pv/episodes.php?s="}` + - link + - "&t=" + - Math.round(new Date().getTime() / 1000); - console.log("nfEpisodesUrl", url); - const res = await axios.get(url, { - headers: { - "Content-Type": "application/json", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36", - "Accept-Language": "en-US,en;q=0.9", - }, - }); - const data = res.data; - console.log("nfEpisodes", data); - const episodeList = []; - data?.episodes?.map((episode) => { - episodeList.push({ - title: "Episode " + episode?.ep.replace("E", ""), - link: episode?.id, +const getEpisodes = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ url: link, providerContext, }) { + var _b; + const { getBaseUrl, axios } = providerContext; + let providerValue = "primeMirror"; + try { + const baseUrl = yield getBaseUrl("nfMirror"); + const url = `${baseUrl}${providerValue === "netflixMirror" + ? "/episodes.php?s=" + : "/pv/episodes.php?s="}` + + link + + "&t=" + + Math.round(new Date().getTime() / 1000); + console.log("nfEpisodesUrl", url); + const res = yield axios.get(url, { + headers: { + "Content-Type": "application/json", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36", + "Accept-Language": "en-US,en;q=0.9", + }, }); - }); - return episodeList; - } - catch (err) { - console.error("nfGetEpisodes error", err); - return []; - } + const data = res.data; + console.log("nfEpisodes", data); + const episodeList = []; + (_b = data === null || data === void 0 ? void 0 : data.episodes) === null || _b === void 0 ? void 0 : _b.map((episode) => { + episodeList.push({ + title: "Episode " + (episode === null || episode === void 0 ? void 0 : episode.ep.replace("E", "")), + link: episode === null || episode === void 0 ? void 0 : episode.id, + }); + }); + return episodeList; + } + catch (err) { + console.error("nfGetEpisodes error", err); + return []; + } + }); }; exports.getEpisodes = getEpisodes; diff --git a/dist/primeMirror/meta.js b/dist/primeMirror/meta.js index ac96f32..f7d5c07 100644 --- a/dist/primeMirror/meta.js +++ b/dist/primeMirror/meta.js @@ -1,57 +1,66 @@ "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 getMeta = async function ({ link, }) { - let providerValue = "primeMirror"; - try { - const isPrime = providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false"; - const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${encodeURIComponent(link)}`; - console.log("nfifo", url); - const res = await fetch(url, { - credentials: "omit", - }); - const data = await res.json(); - const id = link.split("id=")[1]?.split("&")[0]; - const meta = { - title: data.title, - synopsis: data.desc, - image: `https://img.nfmirrorcdn.top/poster/h/${id}.jpg`, - cast: data?.short_cast?.split(","), - tags: [data?.year, data?.hdsd, ...data?.thismovieis?.split(",")], - imdbId: "", - type: "series", - }; - console.log("nfinfo", meta); - const linkList = []; - if (data?.season?.length > 0) { - data.season.map((season) => { - linkList.push({ - title: "Season " + season?.s, - episodesLink: season?.id, +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, }) { + var _b, _c, _d, _e; + let providerValue = "primeMirror"; + try { + const isPrime = providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false"; + const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${encodeURIComponent(link)}`; + console.log("nfifo", url); + const res = yield fetch(url, { + credentials: "omit", + }); + const data = yield res.json(); + const id = (_b = link.split("id=")[1]) === null || _b === void 0 ? void 0 : _b.split("&")[0]; + const meta = { + title: data.title, + synopsis: data.desc, + image: `https://img.nfmirrorcdn.top/poster/h/${id}.jpg`, + cast: (_c = data === null || data === void 0 ? void 0 : data.short_cast) === null || _c === void 0 ? void 0 : _c.split(","), + tags: [data === null || data === void 0 ? void 0 : data.year, data === null || data === void 0 ? void 0 : data.hdsd, ...(_d = data === null || data === void 0 ? void 0 : data.thismovieis) === null || _d === void 0 ? void 0 : _d.split(",")], + imdbId: "", + type: "series", + }; + console.log("nfinfo", meta); + const linkList = []; + if (((_e = data === null || data === void 0 ? void 0 : data.season) === null || _e === void 0 ? void 0 : _e.length) > 0) { + data.season.map((season) => { + linkList.push({ + title: "Season " + (season === null || season === void 0 ? void 0 : season.s), + episodesLink: season === null || season === void 0 ? void 0 : season.id, + }); }); - }); + } + else { + linkList.push({ + title: meta.title, + directLinks: [{ link: id, title: "Movie", type: "movie" }], + }); + } + return Object.assign(Object.assign({}, meta), { linkList: linkList }); } - else { - linkList.push({ - title: meta.title, - directLinks: [{ link: id, title: "Movie", type: "movie" }], - }); + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "", + linkList: [], + }; } - return { - ...meta, - linkList: linkList, - }; - } - catch (err) { - console.error(err); - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "", - linkList: [], - }; - } + }); }; exports.getMeta = getMeta; diff --git a/dist/primeMirror/posts.js b/dist/primeMirror/posts.js index 46b3976..f148908 100644 --- a/dist/primeMirror/posts.js +++ b/dist/primeMirror/posts.js @@ -1,94 +1,108 @@ "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 getPosts = async function ({ filter, page, providerValue, signal, providerContext, }) { - try { - const { getBaseUrl, cheerio } = providerContext; - const baseUrl = await getBaseUrl("nfMirror"); - const catalog = []; - if (page > 1) { +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, providerValue, signal, providerContext, }) { + try { + const { getBaseUrl, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("nfMirror"); + const catalog = []; + if (page > 1) { + return []; + } + // console.log(filter); + const isPrime = providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false"; + const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${baseUrl + filter}`; + const res = yield fetch(url, { + signal: signal, + method: "GET", + credentials: "omit", + }); + const data = yield res.text(); + // console.log('nfPost', data); + const $ = cheerio.load(data); + $("a.post-data").map((i, element) => { + const title = ""; + const id = $(element).attr("data-post"); + // console.log('id', id); + const image = $(element).find("img").attr("data-src") || ""; + if (id) { + catalog.push({ + title: title, + link: baseUrl + + `${providerValue === "netflixMirror" + ? "/post.php?id=" + : "/pv/post.php?id="}` + + id + + "&t=" + + Math.round(new Date().getTime() / 1000), + image: image, + }); + } + }); + // console.log(catalog); + return catalog; + } + catch (err) { + console.error("nf error ", err); return []; } - // console.log(filter); - const isPrime = providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false"; - const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${baseUrl + filter}`; - const res = await fetch(url, { - signal: signal, - method: "GET", - credentials: "omit", - }); - const data = await res.text(); - // console.log('nfPost', data); - const $ = cheerio.load(data); - $("a.post-data").map((i, element) => { - const title = ""; - const id = $(element).attr("data-post"); - // console.log('id', id); - const image = $(element).find("img").attr("data-src") || ""; - if (id) { - catalog.push({ - title: title, - link: baseUrl + - `${providerValue === "netflixMirror" - ? "/post.php?id=" - : "/pv/post.php?id="}` + - id + - "&t=" + - Math.round(new Date().getTime() / 1000), - image: image, - }); - } - }); - // console.log(catalog); - return catalog; - } - catch (err) { - console.error("nf error ", err); - return []; - } + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, providerValue, signal, providerContext, }) { - const { getBaseUrl } = providerContext; - try { - if (page > 1) { +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, providerValue, signal, providerContext, }) { + var _b; + const { getBaseUrl } = providerContext; + try { + if (page > 1) { + return []; + } + const catalog = []; + const baseUrl = yield getBaseUrl("nfMirror"); + const isPrime = providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false"; + const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${baseUrl}${providerValue === "netflixMirror" ? "" : "/pv"}/search.php?s=${encodeURI(searchQuery)}`; + const res = yield fetch(url, { + signal: signal, + method: "GET", + credentials: "omit", + }); + const data = yield res.json(); + (_b = data === null || data === void 0 ? void 0 : data.searchResult) === null || _b === void 0 ? void 0 : _b.forEach((result) => { + const title = (result === null || result === void 0 ? void 0 : result.t) || ""; + const id = result === null || result === void 0 ? void 0 : result.id; + const image = providerValue === "netflixMirror" + ? `https://imgcdn.media/poster/v/${id}.jpg` + : ""; + if (id) { + catalog.push({ + title: title, + link: baseUrl + + `${providerValue === "netflixMirror" + ? "/mobile/post.php?id=" + : "/mobile/pv/post.php?id="}` + + id + + "&t=" + + Math.round(new Date().getTime() / 1000), + image: image, + }); + } + }); + return catalog; + } + catch (err) { + console.error("Search error:", err); return []; } - const catalog = []; - const baseUrl = await getBaseUrl("nfMirror"); - const isPrime = providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false"; - const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${baseUrl}${providerValue === "netflixMirror" ? "" : "/pv"}/search.php?s=${encodeURI(searchQuery)}`; - const res = await fetch(url, { - signal: signal, - method: "GET", - credentials: "omit", - }); - const data = await res.json(); - data?.searchResult?.forEach((result) => { - const title = result?.t || ""; - const id = result?.id; - const image = providerValue === "netflixMirror" - ? `https://imgcdn.media/poster/v/${id}.jpg` - : ""; - if (id) { - catalog.push({ - title: title, - link: baseUrl + - `${providerValue === "netflixMirror" - ? "/mobile/post.php?id=" - : "/mobile/pv/post.php?id="}` + - id + - "&t=" + - Math.round(new Date().getTime() / 1000), - image: image, - }); - } - }); - return catalog; - } - catch (err) { - console.error("Search error:", err); - return []; - } + }); }; exports.getSearchPosts = getSearchPosts; diff --git a/dist/primeMirror/stream.js b/dist/primeMirror/stream.js index ee5fbc0..8cc17d6 100644 --- a/dist/primeMirror/stream.js +++ b/dist/primeMirror/stream.js @@ -1,25 +1,35 @@ "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: id, providerContext, }) => { +const getStream = (_a) => __awaiter(void 0, [_a], void 0, function* ({ link: id, providerContext, }) { const { getBaseUrl } = providerContext; try { let providerValue = "primeMirror"; - const baseUrl = await getBaseUrl("nfMirror"); + const baseUrl = yield getBaseUrl("nfMirror"); const url = `https://netmirror.8man.me/api/net-proxy?url=${baseUrl}${providerValue === "netflixMirror" ? "/mobile/playlist.php?id=" : "/pv/playlist.php?id="}${id}&t=${Math.round(new Date().getTime() / 1000)}`; console.log("nfGetStream, url:", url); - const res = await fetch(url, { + const res = yield fetch(url, { credentials: "omit", }); - const resJson = await res.json(); - const data = resJson?.[0]; + const resJson = yield res.json(); + const data = resJson === null || resJson === void 0 ? void 0 : resJson[0]; const streamLinks = []; - data?.sources.forEach((source) => { + data === null || data === void 0 ? void 0 : data.sources.forEach((source) => { + var _a; streamLinks.push({ server: source.label, - link: (baseUrl + source.file)?.replace(":su", ":ni"), + link: (_a = (baseUrl + source.file)) === null || _a === void 0 ? void 0 : _a.replace(":su", ":ni"), type: "m3u8", headers: { Referer: baseUrl, @@ -35,5 +45,5 @@ const getStream = async ({ link: id, providerContext, }) => { console.error(err); return []; } -}; +}); exports.getStream = getStream; diff --git a/dist/primewire/meta.js b/dist/primewire/meta.js index 3797fcf..33c3d6b 100644 --- a/dist/primewire/meta.js +++ b/dist/primewire/meta.js @@ -1,78 +1,89 @@ "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 getMeta = async function ({ link, providerContext, }) { - try { - const { axios, cheerio } = providerContext; - const url = link; - const baseUrl = link.split("/").slice(0, 3).join("/"); - const res = await axios.get(url); - const html = await res.data; - const $ = cheerio.load(html); - const imdbId = $(".movie_info") - .find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])') - .attr("href") - ?.split("/")[4] || ""; - const type = $(".show_season").html() ? "series" : "movie"; - const linkList = []; - $(".show_season").each((i, element) => { - const seasonTitle = "Season " + $(element).attr("data-id"); - const episodes = []; - $(element) - .children() - .each((i, element2) => { - const episodeTitle = $(element2) - .find("a") +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { + var _b; + try { + const { axios, cheerio } = providerContext; + const url = link; + const baseUrl = link.split("/").slice(0, 3).join("/"); + const res = yield axios.get(url); + const html = yield res.data; + const $ = cheerio.load(html); + const imdbId = ((_b = $(".movie_info") + .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 type = $(".show_season").html() ? "series" : "movie"; + const linkList = []; + $(".show_season").each((i, element) => { + const seasonTitle = "Season " + $(element).attr("data-id"); + const episodes = []; + $(element) .children() - .remove() - .end() - .text() - .trim() - .replace("E", "Epiosode "); - const episodeLink = baseUrl + $(element2).find("a").attr("href"); - if (episodeTitle && episodeLink) { - episodes.push({ - title: episodeTitle, - link: episodeLink, - }); - } - }); - linkList.push({ - title: seasonTitle, - directLinks: episodes, - }); - }); - if (type === "movie") { - linkList.push({ - title: "Movie", - directLinks: [ - { - link: link, - title: "Movie", - type: "movie", - }, - ], + .each((i, element2) => { + const episodeTitle = $(element2) + .find("a") + .children() + .remove() + .end() + .text() + .trim() + .replace("E", "Epiosode "); + const episodeLink = baseUrl + $(element2).find("a").attr("href"); + if (episodeTitle && episodeLink) { + episodes.push({ + title: episodeTitle, + link: episodeLink, + }); + } + }); + linkList.push({ + title: seasonTitle, + directLinks: episodes, + }); }); + if (type === "movie") { + linkList.push({ + title: "Movie", + directLinks: [ + { + link: link, + title: "Movie", + type: "movie", + }, + ], + }); + } + return { + title: "", + image: "", + imdbId: imdbId, + synopsis: "", + type: type, + linkList: linkList, + }; } - return { - title: "", - image: "", - imdbId: imdbId, - synopsis: "", - type: type, - linkList: linkList, - }; - } - catch (error) { - console.error(error); - return { - title: "", - image: "", - imdbId: "", - synopsis: "", - linkList: [], - type: "uhd", - }; - } + catch (error) { + console.error(error); + return { + title: "", + image: "", + imdbId: "", + synopsis: "", + linkList: [], + type: "uhd", + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/primewire/posts.js b/dist/primewire/posts.js index b14d6ba..0c04813 100644 --- a/dist/primewire/posts.js +++ b/dist/primewire/posts.js @@ -1,46 +1,63 @@ "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 getPosts = async function ({ filter, page, signal, providerContext, }) { - const { getBaseUrl, axios, cheerio } = providerContext; - const baseUrl = await getBaseUrl("primewire"); - const url = `${baseUrl + filter}&page=${page}`; - return posts({ baseUrl, url, signal, axios, cheerio }); +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, signal, providerContext, }) { + const { getBaseUrl, axios, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("primewire"); + const url = `${baseUrl + filter}&page=${page}`; + return posts({ baseUrl, url, signal, axios, cheerio }); + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) { - const { getBaseUrl, axios, cheerio, Aes } = providerContext; - const getSHA256ofJSON = async function (input) { - return await Aes.sha1(input); - }; - const baseUrl = await getBaseUrl("primewire"); - const hash = await getSHA256ofJSON(searchQuery + "JyjId97F9PVqUPuMO0"); - const url = `${baseUrl}/filter?s=${searchQuery}&page=${page}&ds=${hash.slice(0, 10)}`; - return posts({ baseUrl, url, signal, axios, cheerio }); +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) { + const { getBaseUrl, axios, cheerio, Aes } = providerContext; + const getSHA256ofJSON = function (input) { + return __awaiter(this, void 0, void 0, function* () { + return yield Aes.sha1(input); + }); + }; + const baseUrl = yield getBaseUrl("primewire"); + const hash = yield getSHA256ofJSON(searchQuery + "JyjId97F9PVqUPuMO0"); + const url = `${baseUrl}/filter?s=${searchQuery}&page=${page}&ds=${hash.slice(0, 10)}`; + return posts({ baseUrl, url, signal, axios, cheerio }); + }); }; exports.getSearchPosts = getSearchPosts; -async function posts({ baseUrl, url, signal, axios, cheerio, }) { - try { - const res = await axios.get(url, { signal }); - const data = res.data; - const $ = cheerio.load(data); - const catalog = []; - $(".index_item.index_item_ie").map((i, element) => { - const title = $(element).find("a").attr("title"); - const link = $(element).find("a").attr("href"); - const image = $(element).find("img").attr("src") || ""; - if (title && link) { - catalog.push({ - title: title, - link: baseUrl + link, - image: image, - }); - } - }); - return catalog; - } - catch (err) { - console.error("primewire error ", err); - return []; - } +function posts(_a) { + return __awaiter(this, arguments, void 0, function* ({ baseUrl, url, signal, axios, cheerio, }) { + try { + const res = yield axios.get(url, { signal }); + const data = res.data; + const $ = cheerio.load(data); + const catalog = []; + $(".index_item.index_item_ie").map((i, element) => { + const title = $(element).find("a").attr("title"); + const link = $(element).find("a").attr("href"); + const image = $(element).find("img").attr("src") || ""; + if (title && link) { + catalog.push({ + title: title, + link: baseUrl + link, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + console.error("primewire error ", err); + return []; + } + }); } diff --git a/dist/primewire/stream.js b/dist/primewire/stream.js index 366bf32..450ba55 100644 --- a/dist/primewire/stream.js +++ b/dist/primewire/stream.js @@ -1,102 +1,40 @@ "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 function ({ link: url, type, providerContext, }) { - const { axios, cheerio } = providerContext; - try { - console.log("pwGetStream", type, url); - const baseUrl = url.split("/").slice(0, 3).join("/"); - const streamLinks = []; - const urls = []; - const res = await axios.get(url); - const data = res.data; - const $ = cheerio.load(data); - $('tr:contains("mixdrop")').map((i, element) => { - const id = $(element).find(".wp-menu-btn").attr("data-wp-menu"); - const size = $(element).find(".wp-menu-btn").next().text(); - if (id) { - urls.push({ id: baseUrl + "/links/go/" + id, size }); - } - }); - console.log("urls", urls); - for (const url of urls) { - const res2 = await axios.head(url.id); - const location = res2.request?.responseURL.replace("/f/", "/e/"); - const res3 = await fetch(location, { - credentials: "include", - 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", - "Upgrade-Insecure-Requests": "1", - "Sec-Fetch-Dest": "iframe", - "Sec-Fetch-Mode": "navigate", - "Sec-Fetch-Site": "same-origin", - Pragma: "no-cache", - "Cache-Control": "no-cache", - referer: res2.request?.responseURL, - }, - referrer: res2.request?.responseURL, - method: "GET", - mode: "cors", +const getStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link: url, type, providerContext, }) { + var _b, _c, _d, _e, _f, _g; + const { axios, cheerio } = providerContext; + try { + console.log("pwGetStream", type, url); + const baseUrl = url.split("/").slice(0, 3).join("/"); + const streamLinks = []; + const urls = []; + const res = yield axios.get(url); + const data = res.data; + const $ = cheerio.load(data); + $('tr:contains("mixdrop")').map((i, element) => { + const id = $(element).find(".wp-menu-btn").attr("data-wp-menu"); + const size = $(element).find(".wp-menu-btn").next().text(); + if (id) { + urls.push({ id: baseUrl + "/links/go/" + id, size }); + } }); - const data3 = await res3.text(); - // let MDCore: any = {}; - // Step 1: Extract the function parameters and the encoded string - var functionRegex = /eval\(function\((.*?)\)\{.*?return p\}.*?\('(.*?)'\.split/; - var match = functionRegex.exec(data3); - let p = ""; - if (match) { - // var params = match[1].split(',').map(param => param.trim()); - var encodedString = match[2]; - console.log("Encoded String:", encodedString); - // console.log('Parameters:', params); - // console.log('Encoded String:', encodedString.split("',36,")[0], '🔥🔥'); - const base = Number(encodedString.split(",'|MDCore|")[0].split(",")[encodedString.split(",'|MDCore|")[0].split(",").length - 1]); - console.log("Base:", base); - p = encodedString.split(`',${base},`)?.[0].trim(); - let a = base; - let c = encodedString.split(`',${base},`)[1].slice(2).split("|").length; - let k = encodedString.split(`',${base},`)[1].slice(2).split("|"); - // console.log('p:', p); - // console.log('a:', a); - // console.log('c:', c); - // console.log('k:', k); - const decode = function (p, a, c, k, e, d) { - e = function (c) { - return c.toString(36); - }; - if (!"".replace(/^/, String)) { - while (c--) { - d[c.toString(a)] = k[c] || c.toString(a); - } - k = [ - function (e) { - return d[e]; - }, - ]; - e = function () { - return "\\w+"; - }; - c = 1; - } - while (c--) { - if (k[c]) { - p = p.replace(new RegExp("\\b" + e(c) + "\\b", "g"), k[c]); - } - } - return p; - }; - const decoded = decode(p, a, c, k, 0, {}); - // get MDCore.wurl= - const wurl = decoded.match(/MDCore\.wurl="([^"]+)"/)?.[1]; - console.log("wurl:", wurl); - const streamUrl = "https:" + wurl; - console.log("streamUrl:", streamUrl); - streamLinks.push({ - server: "Mixdrop " + url.size, - link: streamUrl, - type: "mp4", + console.log("urls", urls); + for (const url of urls) { + const res2 = yield axios.head(url.id); + const location = (_b = res2.request) === null || _b === void 0 ? void 0 : _b.responseURL.replace("/f/", "/e/"); + const res3 = yield fetch(location, { + credentials: "include", 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", @@ -107,19 +45,93 @@ const getStream = async function ({ link: url, type, providerContext, }) { "Sec-Fetch-Site": "same-origin", Pragma: "no-cache", "Cache-Control": "no-cache", - referer: res2.request?.responseURL, + referer: (_c = res2.request) === null || _c === void 0 ? void 0 : _c.responseURL, }, + referrer: (_d = res2.request) === null || _d === void 0 ? void 0 : _d.responseURL, + method: "GET", + mode: "cors", }); + const data3 = yield res3.text(); + // let MDCore: any = {}; + // Step 1: Extract the function parameters and the encoded string + var functionRegex = /eval\(function\((.*?)\)\{.*?return p\}.*?\('(.*?)'\.split/; + var match = functionRegex.exec(data3); + let p = ""; + if (match) { + // var params = match[1].split(',').map(param => param.trim()); + var encodedString = match[2]; + console.log("Encoded String:", encodedString); + // console.log('Parameters:', params); + // console.log('Encoded String:', encodedString.split("',36,")[0], '🔥🔥'); + const base = Number(encodedString.split(",'|MDCore|")[0].split(",")[encodedString.split(",'|MDCore|")[0].split(",").length - 1]); + console.log("Base:", base); + p = (_e = encodedString.split(`',${base},`)) === null || _e === void 0 ? void 0 : _e[0].trim(); + let a = base; + let c = encodedString.split(`',${base},`)[1].slice(2).split("|").length; + let k = encodedString.split(`',${base},`)[1].slice(2).split("|"); + // console.log('p:', p); + // console.log('a:', a); + // console.log('c:', c); + // console.log('k:', k); + const decode = function (p, a, c, k, e, d) { + e = function (c) { + return c.toString(36); + }; + if (!"".replace(/^/, String)) { + while (c--) { + d[c.toString(a)] = k[c] || c.toString(a); + } + k = [ + function (e) { + return d[e]; + }, + ]; + e = function () { + return "\\w+"; + }; + c = 1; + } + while (c--) { + if (k[c]) { + p = p.replace(new RegExp("\\b" + e(c) + "\\b", "g"), k[c]); + } + } + return p; + }; + const decoded = decode(p, a, c, k, 0, {}); + // get MDCore.wurl= + const wurl = (_f = decoded.match(/MDCore\.wurl="([^"]+)"/)) === null || _f === void 0 ? void 0 : _f[1]; + console.log("wurl:", wurl); + const streamUrl = "https:" + wurl; + console.log("streamUrl:", streamUrl); + streamLinks.push({ + server: "Mixdrop " + url.size, + link: streamUrl, + type: "mp4", + 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", + "Upgrade-Insecure-Requests": "1", + "Sec-Fetch-Dest": "iframe", + "Sec-Fetch-Mode": "navigate", + "Sec-Fetch-Site": "same-origin", + Pragma: "no-cache", + "Cache-Control": "no-cache", + referer: (_g = res2.request) === null || _g === void 0 ? void 0 : _g.responseURL, + }, + }); + } + else { + console.log("No match found"); + } } - else { - console.log("No match found"); - } + return streamLinks; } - return streamLinks; - } - catch (err) { - console.error(err); - return []; - } + catch (err) { + console.error(err); + return []; + } + }); }; exports.getStream = getStream; diff --git a/dist/protonMovies/meta.js b/dist/protonMovies/meta.js index a8c6325..ac31234 100644 --- a/dist/protonMovies/meta.js +++ b/dist/protonMovies/meta.js @@ -1,93 +1,102 @@ "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 getMeta = async function ({ link, providerContext, }) { - try { - const { axios, cheerio, getBaseUrl } = providerContext; - console.log("all", link); - const res = await axios.get(link); - const data = res.data; - function decodeHtml(encodedArray) { - // Join array elements into a single string - const joined = encodedArray.join(""); - // Replace escaped quotes - const unescaped = joined.replace(/\\"/g, '"').replace(/\\'/g, "'"); - // Remove remaining escape characters - const cleaned = unescaped - .replace(/\\n/g, "\n") - .replace(/\\t/g, "\t") - .replace(/\\r/g, "\r"); - // Convert literal string representations back to characters - const decoded = cleaned - .replace(/"/g, '"') - .replace(/</g, "<") - .replace(/>/g, ">") - .replace(/&/g, "&"); - return decoded; - } - const $$ = cheerio.load(data); - const htmlArray = $$('script:contains("decodeURIComponent")') - .text() - .split(" = ")?.[1] - ?.split("protomovies")?.[0] - ?.trim() - ?.slice(0, -1); // remove the last character - // console.log('protonGetInfo', htmlArray); - const html = decodeHtml(JSON.parse(htmlArray)); - // console.log('all', html); - const $ = cheerio.load(html); - const title = $(".trending-text.fw-bold.texture-text.text-uppercase.my-0.fadeInLeft.animated.d-inline-block").text(); - const image = $("#thumbnail").attr("src"); - const type = link.includes("series") ? "series" : "movie"; - const synopsis = $(".col-12.iq-mb-30.animated.fadeIn").first().text() || - $(".description-content").text(); - const tags = $(".p-0.mt-2.list-inline.d-flex.flex-wrap.movie-tag") - .find("li") - .map((i, el) => $(el).text()) - .slice(0, 3) - .get(); - const baseUrl = await getBaseUrl("protonMovies"); - const links = []; - if (type === "movie") { - const directLinks = []; - directLinks.push({ title: "Movie", link: link }); - links.push({ title: "Movie", directLinks: directLinks }); - } - else { - $("#episodes") - .children() - .map((i, element) => { - let directLinks = []; - $(element) - .find(".episode-block") - .map((j, ep) => { - const link = baseUrl + $(ep).find("a").attr("href") || ""; - const title = "Episode " + $(ep).find(".episode-number").text().split("E")[1]; - directLinks.push({ title, link }); +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { + var _b, _c, _d, _e, _f; + try { + const { axios, cheerio, getBaseUrl } = providerContext; + console.log("all", link); + const res = yield axios.get(link); + const data = res.data; + function decodeHtml(encodedArray) { + // Join array elements into a single string + const joined = encodedArray.join(""); + // Replace escaped quotes + const unescaped = joined.replace(/\\"/g, '"').replace(/\\'/g, "'"); + // Remove remaining escape characters + const cleaned = unescaped + .replace(/\\n/g, "\n") + .replace(/\\t/g, "\t") + .replace(/\\r/g, "\r"); + // Convert literal string representations back to characters + const decoded = cleaned + .replace(/"/g, '"') + .replace(/</g, "<") + .replace(/>/g, ">") + .replace(/&/g, "&"); + return decoded; + } + const $$ = cheerio.load(data); + const htmlArray = (_f = (_e = (_d = (_c = (_b = $$('script:contains("decodeURIComponent")') + .text() + .split(" = ")) === null || _b === void 0 ? void 0 : _b[1]) === null || _c === void 0 ? void 0 : _c.split("protomovies")) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.trim()) === null || _f === void 0 ? void 0 : _f.slice(0, -1); // remove the last character + // console.log('protonGetInfo', htmlArray); + const html = decodeHtml(JSON.parse(htmlArray)); + // console.log('all', html); + const $ = cheerio.load(html); + const title = $(".trending-text.fw-bold.texture-text.text-uppercase.my-0.fadeInLeft.animated.d-inline-block").text(); + const image = $("#thumbnail").attr("src"); + const type = link.includes("series") ? "series" : "movie"; + const synopsis = $(".col-12.iq-mb-30.animated.fadeIn").first().text() || + $(".description-content").text(); + const tags = $(".p-0.mt-2.list-inline.d-flex.flex-wrap.movie-tag") + .find("li") + .map((i, el) => $(el).text()) + .slice(0, 3) + .get(); + const baseUrl = yield getBaseUrl("protonMovies"); + const links = []; + if (type === "movie") { + const directLinks = []; + directLinks.push({ title: "Movie", link: link }); + links.push({ title: "Movie", directLinks: directLinks }); + } + else { + $("#episodes") + .children() + .map((i, element) => { + let directLinks = []; + $(element) + .find(".episode-block") + .map((j, ep) => { + const link = baseUrl + $(ep).find("a").attr("href") || ""; + const title = "Episode " + $(ep).find(".episode-number").text().split("E")[1]; + directLinks.push({ title, link }); + }); + links.push({ title: "Season " + (i + 1), directLinks: directLinks }); }); - links.push({ title: "Season " + (i + 1), directLinks: directLinks }); - }); + } + return { + image: image || "", + imdbId: "", + linkList: links, + title: title || "", + synopsis: synopsis, + tags: tags, + type: type, + }; } - return { - image: image || "", - imdbId: "", - linkList: links, - title: title || "", - synopsis: synopsis, - tags: tags, - type: type, - }; - } - catch (err) { - console.error("prton", err); - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "movie", - linkList: [], - }; - } + catch (err) { + console.error("prton", err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/protonMovies/posts.js b/dist/protonMovies/posts.js index bae4e41..962e805 100644 --- a/dist/protonMovies/posts.js +++ b/dist/protonMovies/posts.js @@ -1,70 +1,85 @@ "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 getPosts = async function ({ filter, page, signal, providerContext, }) { - const { getBaseUrl, axios, cheerio } = providerContext; - const baseUrl = await getBaseUrl("protonMovies"); - const url = `${baseUrl + filter}/page/${page}/`; - return posts({ url, baseUrl, signal, axios, cheerio }); +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, signal, providerContext, }) { + const { getBaseUrl, axios, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("protonMovies"); + const url = `${baseUrl + filter}/page/${page}/`; + return posts({ url, baseUrl, signal, axios, cheerio }); + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) { - const { getBaseUrl, axios, cheerio } = providerContext; - const baseUrl = await getBaseUrl("protonMovies"); - const url = `${baseUrl}/search/${searchQuery}/page/${page}/`; - return posts({ url, baseUrl, signal, axios, cheerio }); +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) { + const { getBaseUrl, axios, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("protonMovies"); + const url = `${baseUrl}/search/${searchQuery}/page/${page}/`; + return posts({ url, baseUrl, signal, axios, cheerio }); + }); }; exports.getSearchPosts = getSearchPosts; -async function posts({ url, baseUrl, signal, axios, cheerio, }) { - function decodeHtml(encodedArray) { - // Join array elements into a single string - const joined = encodedArray.join(""); - // Replace escaped quotes - const unescaped = joined.replace(/\\"/g, '"').replace(/\\'/g, "'"); - // Remove remaining escape characters - const cleaned = unescaped - .replace(/\\n/g, "\n") - .replace(/\\t/g, "\t") - .replace(/\\r/g, "\r"); - // Convert literal string representations back to characters - const decoded = cleaned - .replace(/"/g, '"') - .replace(/</g, "<") - .replace(/>/g, ">") - .replace(/&/g, "&"); - return decoded; - } - try { - const res = await axios.get(url, { - headers: { - referer: baseUrl, - }, - signal, - }); - const data = res.data; - const regex = /\[(?=.*?"
{ - const title = $(element).find("h5").text(); - const link = $(element).find("h5").find("a").attr("href"); - const image = $(element).find("img").attr("data-src") || - $(element).find("img").attr("src") || - ""; - if (title && link && image) { - catalog.push({ - title: title, - link: link, - image: image, - }); - } - }); - return catalog; - } - catch (err) { - console.error("protonGetPosts error ", err); - return []; - } +function posts(_a) { + return __awaiter(this, arguments, void 0, function* ({ url, baseUrl, signal, axios, cheerio, }) { + function decodeHtml(encodedArray) { + // Join array elements into a single string + const joined = encodedArray.join(""); + // Replace escaped quotes + const unescaped = joined.replace(/\\"/g, '"').replace(/\\'/g, "'"); + // Remove remaining escape characters + const cleaned = unescaped + .replace(/\\n/g, "\n") + .replace(/\\t/g, "\t") + .replace(/\\r/g, "\r"); + // Convert literal string representations back to characters + const decoded = cleaned + .replace(/"/g, '"') + .replace(/</g, "<") + .replace(/>/g, ">") + .replace(/&/g, "&"); + return decoded; + } + try { + const res = yield axios.get(url, { + headers: { + referer: baseUrl, + }, + signal, + }); + const data = res.data; + const regex = /\[(?=.*?"
{ + const title = $(element).find("h5").text(); + const link = $(element).find("h5").find("a").attr("href"); + const image = $(element).find("img").attr("data-src") || + $(element).find("img").attr("src") || + ""; + if (title && link && image) { + catalog.push({ + title: title, + link: link, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + console.error("protonGetPosts error ", err); + return []; + } + }); } diff --git a/dist/protonMovies/stream.js b/dist/protonMovies/stream.js index 3b94351..6f67f30 100644 --- a/dist/protonMovies/stream.js +++ b/dist/protonMovies/stream.js @@ -1,4 +1,13 @@ "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 LALLJLutmoZpvvbikjaWM(str) { @@ -13,153 +22,150 @@ function getOrCreateUID() { const uid = "uid_" + Date.now() + "_" + Math.random().toString(36).substr(2, 9); return uid; } -const getStream = async function ({ link, providerContext, }) { - const { axios, cheerio, commonHeaders: headers, extractors, } = providerContext; - const { gofileExtracter } = extractors; - function generateMessageToken(baseUrlL) { - const hostname = baseUrlL?.replace(/https?:\/\//, "").split("/")[0]; - console.log("generateMessageToken hostname", hostname); - const NsmxUftCNibQ = `[hostname=${hostname}][agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 Edg/137.0.0.0][tmz=India Standard Time][userTimezoneOffset=-330][{"url":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.4/jquery.min.js","type":"script","duration":253.30000000074506},{"url":"https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback","type":"script","duration":397.19999999925494},{"url":"https://adoto.net/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js","type":"img","duration":225.90000000223517},{"url":"https://code.jquery.com/jquery-3.3.1.slim.min.js","type":"script","duration":65.30000000074506},{"url":"https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015","type":"script","duration":225.89999999850988},{"url":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.4/jquery.min.js","type":"script","duration":253.30000000074506},{"url":"https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback","type":"script","duration":397.19999999925494},{"url":"https://adoto.net/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js","type":"img","duration":225.90000000223517},{"url":"https://code.jquery.com/jquery-3.3.1.slim.min.js","type":"script","duration":65.30000000074506},{"url":"https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015","type":"script","duration":225.89999999850988},{"url":"https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/turnstile/if/ov2/av0/rcv/b3dhg/0x4AAAAAAAQDru7r64xT2ifD/auto/fbE/new/normal/auto/","type":"iframe","duration":2050.300000000745},{"url":"https://new19.gdtot.dad/favicon.ico","type":"img","duration":1003.6999999992549},{"url":"https://vikingfile.com/assets/favicon-64375c377b5df8304acbdad4f4430694.ico","type":"img","duration":183.19999999925494},{"url":"https://gofile.io/dist/img/favicon32.png","type":"img","duration":19177.199999999255},{"url":"https://pub.clickadu.com/assets/scripts/supported-browsers.js","type":"fetch","duration":18.799999997019768},{"url":"https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/turnstile/if/ov2/av0/rcv/b3dhg/0x4AAAAAAAQDru7r64xT2ifD/auto/fbE/auto_expire/normal/auto/","type":"iframe","duration":1612.5999999977648},{"url":"https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/turnstile/if/ov2/av0/rcv/b3dhg/0x4AAAAAAAQDru7r64xT2ifD/auto/fbE/auto_expire/normal/auto/","type":"iframe","duration":1154.0999999977648},{"url":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.4/jquery.min.js","type":"script","duration":253.30000000074506},{"url":"https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback","type":"script","duration":397.19999999925494},{"url":"https://adoto.net/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js","type":"img","duration":225.90000000223517},{"url":"https://code.jquery.com/jquery-3.3.1.slim.min.js","type":"script","duration":65.30000000074506},{"url":"https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015","type":"script","duration":225.89999999850988},{"url":"https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/turnstile/if/ov2/av0/rcv/b3dhg/0x4AAAAAAAQDru7r64xT2ifD/auto/fbE/new/normal/auto/","type":"iframe","duration":2050.300000000745},{"url":"https://new19.gdtot.dad/favicon.ico","type":"img","duration":1003.6999999992549},{"url":"https://vikingfile.com/assets/favicon-64375c377b5df8304acbdad4f4430694.ico","type":"img","duration":183.19999999925494},{"url":"https://gofile.io/dist/img/favicon32.png","type":"img","duration":19177.199999999255},{"url":"https://pub.clickadu.com/assets/scripts/supported-browsers.js","type":"fetch","duration":18.799999997019768},{"url":"https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/turnstile/if/ov2/av0/rcv/b3dhg/0x4AAAAAAAQDru7r64xT2ifD/auto/fbE/auto_expire/normal/auto/","type":"iframe","duration":1612.5999999977648},{"url":"https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/turnstile/if/ov2/av0/rcv/b3dhg/0x4AAAAAAAQDru7r64xT2ifD/auto/fbE/auto_expire/normal/auto/","type":"iframe","duration":1154.0999999977648},{"url":"https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/turnstile/if/ov2/av0/rcv/b3dhg/0x4AAAAAAAQDru7r64xT2ifD/auto/fbE/auto_expire/normal/auto/","type":"iframe","duration":986}][{"elements":{"div":70,"span":68,"img":4,"iframe":0,"script":28,"link":20,"p":5,"a":213,"ul":28,"li":208,"button":9,"input":5},"hidden":{"div":13,"span":60,"img":1,"iframe":0,"script":28,"link":20,"p":0,"a":186,"ul":22,"li":184,"button":6,"input":2},"errors":{"network":0,"js":0},"eventListeners":0}]`; - var jRpeP = LALLJLutmoZpvvbikjaWM(NsmxUftCNibQ); - var jzKEwqEAcWFMNwHZnCCqJQ = new Uint8Array(jRpeP); - var kyMXQUxoFYuZIBlKvlHa = jzKEwqEAcWFMNwHZnCCqJQ.toString(); - var kyMXQUxoFYuZIBlKvlHa = kyMXQUxoFYuZIBlKvlHa.replace(/2/g, "004"); - var kyMXQUxoFYuZIBlKvlHa = kyMXQUxoFYuZIBlKvlHa.replace(/3/g, "005"); - var kyMXQUxoFYuZIBlKvlHa = kyMXQUxoFYuZIBlKvlHa.replace(/7/g, "007"); - var kyMXQUxoFYuZIBlKvlHa = kyMXQUxoFYuZIBlKvlHa.replace(/,0,0,0/g, ""); - return kyMXQUxoFYuZIBlKvlHa; - } - function decodeHtml(encodedArray) { - // Join array elements into a single string - const joined = encodedArray.join(""); - // Replace escaped quotes - const unescaped = joined.replace(/\\"/g, '"').replace(/\\'/g, "'"); - // Remove remaining escape characters - const cleaned = unescaped - .replace(/\\n/g, "\n") - .replace(/\\t/g, "\t") - .replace(/\\r/g, "\r"); - // Convert literal string representations back to characters - const decoded = cleaned - .replace(/"/g, '"') - .replace(/</g, "<") - .replace(/>/g, ">") - .replace(/&/g, "&"); - return decoded; - } - try { - const streamLinks = []; - const res = await axios.get(link, { headers }); - const data = res.data; - // const regex = /\[(?=.*?"
") + .replace(/&/g, "&"); + return decoded; } - const id480 = $('tr:contains("480p")') - .find('button:contains("Info")') - .attr("id") - ?.split("-")[1]; - if (id480) { - idList.push({ - id: id480, - quality: "480p", - }); - } - // console.log('idList', idList); - const baseUrl = link.split("/").slice(0, 3).join("/"); - const secondIdList = []; - await Promise.all(idList.slice(0, 2).map(async (id) => { - const formData = new URLSearchParams(); - formData.append("downloadid", id.id); - formData.append("token", "ok"); - const messageToken = generateMessageToken(baseUrl); - const uid = getOrCreateUID(); - const idRes = await fetch(`${baseUrl}/ppd.php`, { - headers: { - accept: "*/*", - "accept-language": "en-US,en;q=0.9,en-IN;q=0.8", - "cache-control": "no-cache", - "content-type": "application/x-www-form-urlencoded", - pragma: "no-cache", - priority: "u=1, i", - "sec-ch-ua": '"Chromium";v="136", "Microsoft Edge";v="136", "Not.A/Brand";v="99"', - "sec-ch-ua-mobile": "?0", - "sec-ch-ua-platform": '"Windows"', - "sec-fetch-dest": "empty", - "sec-fetch-mode": "cors", - "sec-fetch-site": "same-origin", - cookie: "ext_name=ojplmecpdpgccookcobabopnaifgidhf; tgInvite222=true; cf_clearance=3ynJv2B6lHMj3FCOqtfQaL7lTN4KC3xmPRMgcNtddAc-1748787867-1.2.1.1-SEIhLbWR3ehfib5Y3P5pjzj1Qu9wipc52Icv4AmNkztXn2pTXhjKgxXnvTuA2bNscgHuc1juXujAHteqY_vaMmy2C3djMWnJGzjje_XvXZXKht8rwHZt6sviq7KAYvrYZPTrATqENuopzmqmK6dDFS.CAnWHt0VDn8q06iLm5rYj1AXUo3qkV5p1Idx_25elWHYGG8yengBrQV1MYVM9LMdQqv44PXu69FZvNkgv.d6blCKyneJnoLkw4LHAccu.QRPbFwWqqTDyO9YTLRQW9w29bKghD3_JVxkz.qxpg5FbocJ3i6tJJy74SvROpYdpVUOn0fW1YgQ7RxYwhNoHpdTKy8pvmQJGRuSVW1GjO_k", - Referer: "https://m3.protonmovies.top/download/", - "Referrer-Policy": "strict-origin-when-cross-origin", - }, - body: `downloadid=${id.id}&msg=${messageToken}&uid=${uid}&token=ok`, - method: "POST", - }); - const idData = await idRes.text(); - secondIdList.push({ - quality: id.quality, - id: idData, - }); - console.log("idData", idData); - })); - await Promise.all(secondIdList.map(async (id) => { - const idRes = await axios.post(`${baseUrl}/tmp/${id.id}`); - if (idRes.data.ppd["gofile.io"]) { - const goRes = await gofileExtracter(idRes.data.ppd["gofile.io"].link.split("/").pop()); - console.log("link", goRes.link); - if (goRes.link) { - streamLinks.push({ - link: goRes.link, - server: "gofile " + id.quality, - type: "mkv", - headers: { - referer: "https://gofile.io", - connection: "keep-alive", - contentType: "video/x-matroska", - cookie: "accountToken=" + goRes.token, - }, - }); - } + try { + const streamLinks = []; + const res = yield axios.get(link, { headers }); + const data = res.data; + // const regex = /\[(?=.*?"
__awaiter(this, void 0, void 0, function* () { + const formData = new URLSearchParams(); + formData.append("downloadid", id.id); + formData.append("token", "ok"); + const messageToken = generateMessageToken(baseUrl); + const uid = getOrCreateUID(); + const idRes = yield fetch(`${baseUrl}/ppd.php`, { + headers: { + accept: "*/*", + "accept-language": "en-US,en;q=0.9,en-IN;q=0.8", + "cache-control": "no-cache", + "content-type": "application/x-www-form-urlencoded", + pragma: "no-cache", + priority: "u=1, i", + "sec-ch-ua": '"Chromium";v="136", "Microsoft Edge";v="136", "Not.A/Brand";v="99"', + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": '"Windows"', + "sec-fetch-dest": "empty", + "sec-fetch-mode": "cors", + "sec-fetch-site": "same-origin", + cookie: "ext_name=ojplmecpdpgccookcobabopnaifgidhf; tgInvite222=true; cf_clearance=3ynJv2B6lHMj3FCOqtfQaL7lTN4KC3xmPRMgcNtddAc-1748787867-1.2.1.1-SEIhLbWR3ehfib5Y3P5pjzj1Qu9wipc52Icv4AmNkztXn2pTXhjKgxXnvTuA2bNscgHuc1juXujAHteqY_vaMmy2C3djMWnJGzjje_XvXZXKht8rwHZt6sviq7KAYvrYZPTrATqENuopzmqmK6dDFS.CAnWHt0VDn8q06iLm5rYj1AXUo3qkV5p1Idx_25elWHYGG8yengBrQV1MYVM9LMdQqv44PXu69FZvNkgv.d6blCKyneJnoLkw4LHAccu.QRPbFwWqqTDyO9YTLRQW9w29bKghD3_JVxkz.qxpg5FbocJ3i6tJJy74SvROpYdpVUOn0fW1YgQ7RxYwhNoHpdTKy8pvmQJGRuSVW1GjO_k", + Referer: "https://m3.protonmovies.top/download/", + "Referrer-Policy": "strict-origin-when-cross-origin", + }, + body: `downloadid=${id.id}&msg=${messageToken}&uid=${uid}&token=ok`, + method: "POST", + }); + const idData = yield idRes.text(); + secondIdList.push({ + quality: id.quality, + id: idData, + }); + console.log("idData", idData); + }))); + yield Promise.all(secondIdList.map((id) => __awaiter(this, void 0, void 0, function* () { + const idRes = yield axios.post(`${baseUrl}/tmp/${id.id}`); + if (idRes.data.ppd["gofile.io"]) { + const goRes = yield gofileExtracter(idRes.data.ppd["gofile.io"].link.split("/").pop()); + console.log("link", goRes.link); + if (goRes.link) { + streamLinks.push({ + link: goRes.link, + server: "gofile " + id.quality, + type: "mkv", + headers: { + referer: "https://gofile.io", + connection: "keep-alive", + contentType: "video/x-matroska", + cookie: "accountToken=" + goRes.token, + }, + }); + } + } + }))); + return streamLinks; + } + catch (e) { + console.log("proton get stream err", e); + return []; + } + }); }; exports.getStream = getStream; diff --git a/dist/ridoMovies/meta.js b/dist/ridoMovies/meta.js index 2224b7d..c89697c 100644 --- a/dist/ridoMovies/meta.js +++ b/dist/ridoMovies/meta.js @@ -1,85 +1,94 @@ "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 getMeta = async function ({ link, providerContext, }) { - try { - const { getBaseUrl, axios } = providerContext; - const res = await axios.get(link); - const data = res.data; - const meta = { - title: "", - synopsis: "", - image: "", - imdbId: data?.meta?.imdb_id || "", - type: data?.meta?.type || "movie", - }; - const baseUrl = await getBaseUrl("ridomovies"); - let slug = ""; +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { + var _b, _c, _d, _e, _f, _g, _h; try { - const res2 = await axios.get(baseUrl + "/core/api/search?q=" + meta.imdbId); - const data2 = res2.data; - slug = data2?.data?.items[0]?.fullSlug; - if (!slug || meta?.type === "series") { + const { getBaseUrl, axios } = providerContext; + const res = yield axios.get(link); + const data = res.data; + const meta = { + title: "", + synopsis: "", + image: "", + imdbId: ((_b = data === null || data === void 0 ? void 0 : data.meta) === null || _b === void 0 ? void 0 : _b.imdb_id) || "", + type: ((_c = data === null || data === void 0 ? void 0 : data.meta) === null || _c === void 0 ? void 0 : _c.type) || "movie", + }; + const baseUrl = yield getBaseUrl("ridomovies"); + let slug = ""; + try { + const res2 = yield axios.get(baseUrl + "/core/api/search?q=" + meta.imdbId); + const data2 = res2.data; + slug = (_e = (_d = data2 === null || data2 === void 0 ? void 0 : data2.data) === null || _d === void 0 ? void 0 : _d.items[0]) === null || _e === void 0 ? void 0 : _e.fullSlug; + if (!slug || (meta === null || meta === void 0 ? void 0 : meta.type) === "series") { + return { + title: "", + synopsis: "", + image: "", + imdbId: ((_f = data === null || data === void 0 ? void 0 : data.meta) === null || _f === void 0 ? void 0 : _f.imdb_id) || "", + type: (meta === null || meta === void 0 ? void 0 : meta.type) || "movie", + linkList: [], + }; + } + } + catch (err) { return { title: "", synopsis: "", image: "", - imdbId: data?.meta?.imdb_id || "", - type: meta?.type || "movie", + imdbId: (meta === null || meta === void 0 ? void 0 : meta.imdbId) || "", + type: (meta === null || meta === void 0 ? void 0 : meta.type) || "movie", linkList: [], }; } + const links = []; + let directLinks = []; + let season = new Map(); + if (meta.type === "series") { + (_h = (_g = data === null || data === void 0 ? void 0 : data.meta) === null || _g === void 0 ? void 0 : _g.videos) === null || _h === void 0 ? void 0 : _h.map((video) => { + if ((video === null || video === void 0 ? void 0 : video.season) <= 0) + return; + if (!season.has(video === null || video === void 0 ? void 0 : video.season)) { + season.set(video === null || video === void 0 ? void 0 : video.season, []); + } + season.get(video === null || video === void 0 ? void 0 : video.season).push({ + title: "Episode " + (video === null || video === void 0 ? void 0 : video.episode), + link: "", + }); + }); + for (const [seasonNum, episodes] of season.entries()) { + links.push({ + title: "Season " + seasonNum, + directLinks: episodes, + }); + } + } + else { + directLinks.push({ title: "Movie", link: link }); + links.push({ title: "Movie", directLinks: directLinks }); + } + return Object.assign(Object.assign({}, meta), { linkList: links }); } catch (err) { return { title: "", synopsis: "", image: "", - imdbId: meta?.imdbId || "", - type: meta?.type || "movie", + imdbId: "", + type: "movie", linkList: [], }; } - const links = []; - let directLinks = []; - let season = new Map(); - if (meta.type === "series") { - data?.meta?.videos?.map((video) => { - if (video?.season <= 0) - return; - if (!season.has(video?.season)) { - season.set(video?.season, []); - } - season.get(video?.season).push({ - title: "Episode " + video?.episode, - link: "", - }); - }); - for (const [seasonNum, episodes] of season.entries()) { - links.push({ - title: "Season " + seasonNum, - directLinks: episodes, - }); - } - } - else { - directLinks.push({ title: "Movie", link: link }); - links.push({ title: "Movie", directLinks: directLinks }); - } - return { - ...meta, - linkList: links, - }; - } - catch (err) { - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "movie", - linkList: [], - }; - } + }); }; exports.getMeta = getMeta; diff --git a/dist/ridoMovies/posts.js b/dist/ridoMovies/posts.js index 3fddbf2..2fb59be 100644 --- a/dist/ridoMovies/posts.js +++ b/dist/ridoMovies/posts.js @@ -1,66 +1,79 @@ "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 getPosts = async function ({ filter, signal, providerContext, }) { - try { - const catalog = []; - const url = "https://cinemeta-catalogs.strem.io" + filter; - console.log("allGetPostUrl", url); - const res = await providerContext.axios.get(url, { - headers: providerContext.commonHeaders, - signal, - }); - const data = res.data; - data?.metas.map((result) => { - const title = result?.name; - const id = result?.imdb_id || result?.id; - const type = result?.type; - const image = result?.poster; - if (id) { - catalog.push({ - title: title, - link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`, - image: image, - }); - } - }); - console.log("catalog", catalog.length); - return catalog; - } - catch (err) { - console.error("AutoEmbed error ", err); - return []; - } -}; -exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) { - try { - const { axios, commonHeaders: headers } = providerContext; - if (page > 1) { +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, signal, providerContext, }) { + try { + const catalog = []; + const url = "https://cinemeta-catalogs.strem.io" + filter; + console.log("allGetPostUrl", url); + const res = yield providerContext.axios.get(url, { + headers: providerContext.commonHeaders, + signal, + }); + const data = res.data; + data === null || data === void 0 ? void 0 : data.metas.map((result) => { + const title = result === null || result === void 0 ? void 0 : result.name; + const id = (result === null || result === void 0 ? void 0 : result.imdb_id) || (result === null || result === void 0 ? void 0 : result.id); + const type = result === null || result === void 0 ? void 0 : result.type; + const image = result === null || result === void 0 ? void 0 : result.poster; + if (id) { + catalog.push({ + title: title, + link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`, + image: image, + }); + } + }); + console.log("catalog", catalog.length); + return catalog; + } + catch (err) { + console.error("AutoEmbed error ", err); return []; } - const catalog = []; - const url2 = `https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(searchQuery)}.json`; - const res2 = await axios.get(url2, { headers, signal }); - const data2 = res2.data; - data2?.metas.map((result) => { - const title = result?.name || ""; - const id = result?.imdb_id || result?.id; - const image = result?.poster; - const type = result?.type; - if (id) { - catalog.push({ - title: title, - link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`, - image: image, - }); + }); +}; +exports.getPosts = getPosts; +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) { + try { + const { axios, commonHeaders: headers } = providerContext; + if (page > 1) { + return []; } - }); - return catalog; - } - catch (err) { - console.error("AutoEmbed error ", err); - return []; - } + const catalog = []; + const url2 = `https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(searchQuery)}.json`; + const res2 = yield axios.get(url2, { headers, signal }); + const data2 = res2.data; + data2 === null || data2 === void 0 ? void 0 : data2.metas.map((result) => { + const title = (result === null || result === void 0 ? void 0 : result.name) || ""; + const id = (result === null || result === void 0 ? void 0 : result.imdb_id) || (result === null || result === void 0 ? void 0 : result.id); + const image = result === null || result === void 0 ? void 0 : result.poster; + const type = result === null || result === void 0 ? void 0 : result.type; + if (id) { + catalog.push({ + title: title, + link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + console.error("AutoEmbed error ", err); + return []; + } + }); }; exports.getSearchPosts = getSearchPosts; diff --git a/dist/ridoMovies/stream.js b/dist/ridoMovies/stream.js index d3aa161..916304e 100644 --- a/dist/ridoMovies/stream.js +++ b/dist/ridoMovies/stream.js @@ -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]; diff --git a/dist/ringz/meta.js b/dist/ringz/meta.js index 4a64c73..f848322 100644 --- a/dist/ringz/meta.js +++ b/dist/ringz/meta.js @@ -1,85 +1,95 @@ "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 getMeta = async function ({ link: data, }) { - try { - const dataJson = JSON.parse(data); - const title = dataJson?.kn || dataJson?.mn; - const image = dataJson?.IH || dataJson?.IV; - const tags = dataJson?.gn - .split(",") - .slice(0, 3) - .map((tag) => tag.trim()); - const type = dataJson?.cg === "webSeries" ? "series" : "movie"; - const linkList = []; - if (dataJson?.cg === "webSeries") { - ["1", "2", "3", "4"]?.forEach((item) => { +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link: data, }) { + var _b, _c; + try { + const dataJson = JSON.parse(data); + const title = (dataJson === null || dataJson === void 0 ? void 0 : dataJson.kn) || (dataJson === null || dataJson === void 0 ? void 0 : dataJson.mn); + const image = (dataJson === null || dataJson === void 0 ? void 0 : dataJson.IH) || (dataJson === null || dataJson === void 0 ? void 0 : dataJson.IV); + const tags = dataJson === null || dataJson === void 0 ? void 0 : dataJson.gn.split(",").slice(0, 3).map((tag) => tag.trim()); + const type = (dataJson === null || dataJson === void 0 ? void 0 : dataJson.cg) === "webSeries" ? "series" : "movie"; + const linkList = []; + if ((dataJson === null || dataJson === void 0 ? void 0 : dataJson.cg) === "webSeries") { + (_b = ["1", "2", "3", "4"]) === null || _b === void 0 ? void 0 : _b.forEach((item) => { + var _a; + const directLinks = []; + if (typeof (dataJson === null || dataJson === void 0 ? void 0 : dataJson["eServer" + item]) === "object" && + ((_a = Object === null || Object === void 0 ? void 0 : Object.keys(dataJson === null || dataJson === void 0 ? void 0 : dataJson["eServer" + item])) === null || _a === void 0 ? void 0 : _a.length) > 0) { + Object.keys(dataJson === null || dataJson === void 0 ? void 0 : dataJson["eServer" + item]).forEach((key) => { + directLinks.push({ + title: "Episode " + key, + link: JSON.stringify({ + url: dataJson === null || dataJson === void 0 ? void 0 : dataJson["eServer" + item][key], + server: "Server " + item, + }), + }); + }); + linkList.push({ + title: (dataJson === null || dataJson === void 0 ? void 0 : dataJson.pn) + " (Server " + item + ")", + directLinks, + }); + } + }); + } + else { const directLinks = []; - if (typeof dataJson?.["eServer" + item] === "object" && - Object?.keys(dataJson?.["eServer" + item])?.length > 0) { - Object.keys(dataJson?.["eServer" + item]).forEach((key) => { + (_c = ["1", "2", "3", "4"]) === null || _c === void 0 ? void 0 : _c.forEach((item) => { + if (dataJson === null || dataJson === void 0 ? void 0 : dataJson["s" + item]) { directLinks.push({ - title: "Episode " + key, + title: "Server " + item + " (HD)", link: JSON.stringify({ - url: dataJson?.["eServer" + item][key], + url: dataJson === null || dataJson === void 0 ? void 0 : dataJson.s1, server: "Server " + item, }), }); - }); - linkList.push({ - title: dataJson?.pn + " (Server " + item + ")", - directLinks, - }); - } - }); + } + if (dataJson === null || dataJson === void 0 ? void 0 : dataJson["4s" + item]) { + directLinks.push({ + title: "Server " + item + " (480p)", + link: JSON.stringify({ + url: dataJson === null || dataJson === void 0 ? void 0 : dataJson["4s" + item], + server: "Server " + item, + }), + }); + } + }); + linkList.push({ + title: dataJson === null || dataJson === void 0 ? void 0 : dataJson.pn, + directLinks, + }); + } + return { + title, + image, + imdbId: "", + synopsis: "", + type, + linkList, + tags, + }; } - else { - const directLinks = []; - ["1", "2", "3", "4"]?.forEach((item) => { - if (dataJson?.["s" + item]) { - directLinks.push({ - title: "Server " + item + " (HD)", - link: JSON.stringify({ - url: dataJson?.s1, - server: "Server " + item, - }), - }); - } - if (dataJson?.["4s" + item]) { - directLinks.push({ - title: "Server " + item + " (480p)", - link: JSON.stringify({ - url: dataJson?.["4s" + item], - server: "Server " + item, - }), - }); - } - }); - linkList.push({ - title: dataJson?.pn, - directLinks, - }); + catch (err) { + return { + title: "", + image: "", + imdbId: "", + synopsis: "", + type: "movie", + linkList: [], + tags: [], + }; } - return { - title, - image, - imdbId: "", - synopsis: "", - type, - linkList, - tags, - }; - } - catch (err) { - return { - title: "", - image: "", - imdbId: "", - synopsis: "", - type: "movie", - linkList: [], - tags: [], - }; - } + }); }; exports.getMeta = getMeta; diff --git a/dist/ringz/posts.js b/dist/ringz/posts.js index 972f127..89781dd 100644 --- a/dist/ringz/posts.js +++ b/dist/ringz/posts.js @@ -1,38 +1,88 @@ "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.ringzData = exports.headers = exports.getSearchPosts = exports.getPosts = void 0; exports.getRingzMovies = getRingzMovies; exports.getRingzShows = getRingzShows; exports.getRingzAnime = getRingzAnime; exports.getRingzAdult = getRingzAdult; -const getPosts = async function ({ filter, signal, providerContext, }) { - return posts({ filter, signal, providerContext }); +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, signal, providerContext, }) { + return posts({ filter, signal, providerContext }); + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, // providerContext, - }) { - if (page > 1) - return []; - function searchData(data, query) { - // Convert query to lowercase for case-insensitive search - const searchQuery = query.toLowerCase(); - // Filter movies based on movie name (mn) - return data.filter((movie) => { - // Convert movie name to lowercase and check if it includes the search query - const movieName = movie.mn.toLowerCase(); - return movieName.includes(searchQuery); - }); - } - try { - const catalog = []; - const promises = [getRingzMovies(), getRingzShows(), getRingzAnime()]; - const responses = await Promise.all(promises); - responses.map((response) => { - const searchResults = searchData(response, searchQuery); - searchResults.map((element) => { - const title = element?.kn || element?.mn; +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, // providerContext, + }) { + if (page > 1) + return []; + function searchData(data, query) { + // Convert query to lowercase for case-insensitive search + const searchQuery = query.toLowerCase(); + // Filter movies based on movie name (mn) + return data.filter((movie) => { + // Convert movie name to lowercase and check if it includes the search query + const movieName = movie.mn.toLowerCase(); + return movieName.includes(searchQuery); + }); + } + try { + const catalog = []; + const promises = [getRingzMovies(), getRingzShows(), getRingzAnime()]; + const responses = yield Promise.all(promises); + responses.map((response) => { + const searchResults = searchData(response, searchQuery); + searchResults.map((element) => { + const title = (element === null || element === void 0 ? void 0 : element.kn) || (element === null || element === void 0 ? void 0 : element.mn); + const link = JSON.stringify(element); + const image = element === null || element === void 0 ? void 0 : element.IV; + if (title && link) { + catalog.push({ + title: title, + link: link, + image: image, + }); + } + }); + }); + return catalog; + } + catch (err) { + console.error("ringz error ", err); + return []; + } + }); +}; +exports.getSearchPosts = getSearchPosts; +function posts(_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, // signal, + }) { + try { + let response; + if (filter === "MOVIES") { + response = getRingzMovies(); + } + if (filter === "SERIES") { + response = getRingzShows(); + } + if (filter === "ANIME") { + response = getRingzAnime(); + } + const data = yield response; + const catalog = []; + data.map((element) => { + const title = (element === null || element === void 0 ? void 0 : element.kn) || (element === null || element === void 0 ? void 0 : element.mn); const link = JSON.stringify(element); - const image = element?.IV; + const image = element === null || element === void 0 ? void 0 : element.IV; if (title && link) { catalog.push({ title: title, @@ -41,109 +91,74 @@ const getSearchPosts = async function ({ searchQuery, page, // providerContext, }); } }); - }); - return catalog; - } - catch (err) { - console.error("ringz error ", err); - return []; - } -}; -exports.getSearchPosts = getSearchPosts; -async function posts({ filter, // signal, - }) { - try { - let response; - if (filter === "MOVIES") { - response = getRingzMovies(); + return catalog; } - if (filter === "SERIES") { - response = getRingzShows(); + catch (err) { + console.error("ringz error ", err); + return []; } - if (filter === "ANIME") { - response = getRingzAnime(); - } - const data = await response; - const catalog = []; - data.map((element) => { - const title = element?.kn || element?.mn; - const link = JSON.stringify(element); - const image = element?.IV; - if (title && link) { - catalog.push({ - title: title, - link: link, - image: image, - }); - } - }); - return catalog; - } - catch (err) { - console.error("ringz error ", err); - return []; - } + }); } exports.headers = { "cf-access-client-id": "833049b087acf6e787cedfd85d1ccdb8.access", "cf-access-client-secret": "02db296a961d7513c3102d7785df4113eff036b2d57d060ffcc2ba3ba820c6aa", }; const BASE_URL = "https://privatereporz.pages.dev"; -async function getRingzMovies() { - try { - const response = await fetch(`${BASE_URL}/test.json`, { - headers: { - ...exports.headers, - }, - }); - const data = await response.json(); - return data.AllMovieDataList; - } - catch (error) { - console.error(error); - } +function getRingzMovies() { + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield fetch(`${BASE_URL}/test.json`, { + headers: Object.assign({}, exports.headers), + }); + const data = yield response.json(); + return data.AllMovieDataList; + } + catch (error) { + console.error(error); + } + }); } -async function getRingzShows() { - try { - const response = await fetch(`${BASE_URL}/srs.json`, { - headers: { - ...exports.headers, - }, - }); - const data = await response.json(); - return data.webSeriesDataList; - } - catch (error) { - console.error(error); - } +function getRingzShows() { + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield fetch(`${BASE_URL}/srs.json`, { + headers: Object.assign({}, exports.headers), + }); + const data = yield response.json(); + return data.webSeriesDataList; + } + catch (error) { + console.error(error); + } + }); } -async function getRingzAnime() { - try { - const response = await fetch(`${BASE_URL}/anime.json`, { - headers: { - ...exports.headers, - }, - }); - const data = await response.json(); - return data.webSeriesDataList; - } - catch (error) { - console.error(error); - } +function getRingzAnime() { + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield fetch(`${BASE_URL}/anime.json`, { + headers: Object.assign({}, exports.headers), + }); + const data = yield response.json(); + return data.webSeriesDataList; + } + catch (error) { + console.error(error); + } + }); } -async function getRingzAdult() { - try { - const response = await fetch(`${BASE_URL}/desihub.json`, { - headers: { - ...exports.headers, - }, - }); - const data = await response.json(); - return data.webSeriesDataList; - } - catch (error) { - console.error(error); - } +function getRingzAdult() { + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield fetch(`${BASE_URL}/desihub.json`, { + headers: Object.assign({}, exports.headers), + }); + const data = yield response.json(); + return data.webSeriesDataList; + } + catch (error) { + console.error(error); + } + }); } exports.ringzData = { getRingzMovies, diff --git a/dist/ringz/stream.js b/dist/ringz/stream.js index c060210..eebb36f 100644 --- a/dist/ringz/stream.js +++ b/dist/ringz/stream.js @@ -1,14 +1,25 @@ "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 function ({ link: data, }) { - const streamLinks = []; - const dataJson = JSON.parse(data); - streamLinks.push({ - link: dataJson.url, - server: dataJson.server, - type: "mkv", +const getStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link: data, }) { + const streamLinks = []; + const dataJson = JSON.parse(data); + streamLinks.push({ + link: dataJson.url, + server: dataJson.server, + type: "mkv", + }); + return streamLinks; }); - return streamLinks; }; exports.getStream = getStream; diff --git a/dist/showbox/episodes.js b/dist/showbox/episodes.js index 5a3c2c3..868273f 100644 --- a/dist/showbox/episodes.js +++ b/dist/showbox/episodes.js @@ -1,32 +1,43 @@ "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.getEpisodes = void 0; -const getEpisodes = async function ({ url: id, providerContext, }) { - const { axios } = providerContext; - try { - const [fileId, febboxId] = id.split("&"); - const febLink = febboxId - ? `https://www.febbox.com/file/file_share_list?share_key=${fileId}&pwd=&parent_id=${febboxId}&is_html=0` - : `https://www.febbox.com/file/file_share_list?share_key=${fileId}&pwd=&is_html=0`; - const res = await axios.get(febLink); - const data = res.data; - const fileList = data.data.file_list; - const episodeLinks = []; - fileList?.map((file) => { - const fileName = formatEpisodeName(file.file_name); - const epId = file?.fid; - if (!file.is_dir && fileName && epId) { - episodeLinks.push({ - title: fileName, - link: `${fileId}&${epId}`, - }); - } - }); - return episodeLinks; - } - catch (err) { - return []; - } +const getEpisodes = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ url: id, providerContext, }) { + const { axios } = providerContext; + try { + const [fileId, febboxId] = id.split("&"); + const febLink = febboxId + ? `https://www.febbox.com/file/file_share_list?share_key=${fileId}&pwd=&parent_id=${febboxId}&is_html=0` + : `https://www.febbox.com/file/file_share_list?share_key=${fileId}&pwd=&is_html=0`; + const res = yield axios.get(febLink); + const data = res.data; + const fileList = data.data.file_list; + const episodeLinks = []; + fileList === null || fileList === void 0 ? void 0 : fileList.map((file) => { + const fileName = formatEpisodeName(file.file_name); + const epId = file === null || file === void 0 ? void 0 : file.fid; + if (!file.is_dir && fileName && epId) { + episodeLinks.push({ + title: fileName, + link: `${fileId}&${epId}`, + }); + } + }); + return episodeLinks; + } + catch (err) { + return []; + } + }); }; exports.getEpisodes = getEpisodes; function formatEpisodeName(title) { diff --git a/dist/showbox/meata.js b/dist/showbox/meata.js index 5e6a995..4bfb71d 100644 --- a/dist/showbox/meata.js +++ b/dist/showbox/meata.js @@ -1,65 +1,74 @@ "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 getMeta = async function ({ link, providerContext, }) { - try { - const { axios, cheerio } = providerContext; - const url = link; - const res = await axios.get(url); - const data = res.data; - const $ = cheerio.load(data); - const type = url.includes("tv") ? "series" : "movie"; - const imdbId = ""; - const title = $(".heading-name").text(); - const rating = $(".btn-imdb") - .text() - ?.match(/\d+(\.\d+)?/g)?.[0] || ""; - const image = $(".cover_follow").attr("style")?.split("url(")[1]?.split(")")[0] || ""; - const synopsis = $(".description") - .text() - ?.replace(/[\n\t]/g, "") - ?.trim(); - const febID = $(".heading-name").find("a").attr("href")?.split("/")?.pop(); - const baseUrl = url.split("/").slice(0, 3).join("/"); - const indexUrl = `${baseUrl}/index/share_link?id=${febID}&type=${type === "movie" ? "1" : "2"}`; - const indexRes = await axios.get(indexUrl); - const indexData = indexRes.data; - const febKey = indexData.data.link.split("/").pop(); - const febLink = `https://www.febbox.com/file/file_share_list?share_key=${febKey}&is_html=0`; - const febRes = await axios.get(febLink); - const febData = febRes.data; - const fileList = febData?.data?.file_list; - const links = []; - if (fileList) { - fileList.map((file) => { - const fileName = `${file.file_name} (${file.file_size})`; - const fileId = file.fid; - links.push({ - title: fileName, - episodesLink: file.is_dir ? `${febKey}&${fileId}` : `${febKey}&`, +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { + var _b, _c, _d, _e, _f, _g, _h, _j, _k; + try { + const { axios, cheerio } = providerContext; + const url = link; + const res = yield axios.get(url); + const data = res.data; + const $ = cheerio.load(data); + const type = url.includes("tv") ? "series" : "movie"; + const imdbId = ""; + const title = $(".heading-name").text(); + const rating = ((_c = (_b = $(".btn-imdb") + .text()) === null || _b === void 0 ? void 0 : _b.match(/\d+(\.\d+)?/g)) === null || _c === void 0 ? void 0 : _c[0]) || ""; + const image = ((_e = (_d = $(".cover_follow").attr("style")) === null || _d === void 0 ? void 0 : _d.split("url(")[1]) === null || _e === void 0 ? void 0 : _e.split(")")[0]) || ""; + const synopsis = (_g = (_f = $(".description") + .text()) === null || _f === void 0 ? void 0 : _f.replace(/[\n\t]/g, "")) === null || _g === void 0 ? void 0 : _g.trim(); + const febID = (_j = (_h = $(".heading-name").find("a").attr("href")) === null || _h === void 0 ? void 0 : _h.split("/")) === null || _j === void 0 ? void 0 : _j.pop(); + const baseUrl = url.split("/").slice(0, 3).join("/"); + const indexUrl = `${baseUrl}/index/share_link?id=${febID}&type=${type === "movie" ? "1" : "2"}`; + const indexRes = yield axios.get(indexUrl); + const indexData = indexRes.data; + const febKey = indexData.data.link.split("/").pop(); + const febLink = `https://www.febbox.com/file/file_share_list?share_key=${febKey}&is_html=0`; + const febRes = yield axios.get(febLink); + const febData = febRes.data; + const fileList = (_k = febData === null || febData === void 0 ? void 0 : febData.data) === null || _k === void 0 ? void 0 : _k.file_list; + const links = []; + if (fileList) { + fileList.map((file) => { + const fileName = `${file.file_name} (${file.file_size})`; + const fileId = file.fid; + links.push({ + title: fileName, + episodesLink: file.is_dir ? `${febKey}&${fileId}` : `${febKey}&`, + }); }); - }); + } + return { + title, + rating, + synopsis, + image, + imdbId, + type, + linkList: links, + }; } - return { - title, - rating, - synopsis, - image, - imdbId, - type, - linkList: links, - }; - } - catch (err) { - return { - title: "", - rating: "", - synopsis: "", - image: "", - imdbId: "", - type: "", - linkList: [], - }; - } + catch (err) { + return { + title: "", + rating: "", + synopsis: "", + image: "", + imdbId: "", + type: "", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/showbox/posts.js b/dist/showbox/posts.js index cd2e9a3..18790b8 100644 --- a/dist/showbox/posts.js +++ b/dist/showbox/posts.js @@ -1,47 +1,62 @@ "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 getPosts = async function ({ filter, page, -// providerValue, -signal, providerContext, }) { - const { getBaseUrl, axios, cheerio } = providerContext; - const baseUrl = await getBaseUrl("showbox"); - const url = `${baseUrl + filter}?page=${page}/`; - return posts({ url, signal, baseUrl, axios, cheerio }); +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, + // providerValue, + signal, providerContext, }) { + const { getBaseUrl, axios, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("showbox"); + const url = `${baseUrl + filter}?page=${page}/`; + return posts({ url, signal, baseUrl, axios, cheerio }); + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, -// providerValue, -signal, providerContext, }) { - const { getBaseUrl, axios, cheerio } = providerContext; - const baseUrl = await getBaseUrl("showbox"); - const url = `${baseUrl}/search?keyword=${searchQuery}&page=${page}`; - return posts({ url, signal, baseUrl, axios, cheerio }); +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, + // providerValue, + signal, providerContext, }) { + const { getBaseUrl, axios, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("showbox"); + const url = `${baseUrl}/search?keyword=${searchQuery}&page=${page}`; + return posts({ url, signal, baseUrl, axios, cheerio }); + }); }; exports.getSearchPosts = getSearchPosts; -async function posts({ url, signal, -// baseUrl, -axios, cheerio, }) { - try { - const res = await axios.get(url, { signal }); - const data = res.data; - const $ = cheerio.load(data); - const catalog = []; - $(".movie-item").map((i, element) => { - const title = $(element).find(".movie-title").text(); - const link = $(element).find("a").attr("href"); - const image = $(element).find("img").attr("src"); - if (title && link && image) { - catalog.push({ - title: title, - link: link, - image: image, - }); - } - }); - return catalog; - } - catch (err) { - return []; - } +function posts(_a) { + return __awaiter(this, arguments, void 0, function* ({ url, signal, + // baseUrl, + axios, cheerio, }) { + try { + const res = yield axios.get(url, { signal }); + const data = res.data; + const $ = cheerio.load(data); + const catalog = []; + $(".movie-item").map((i, element) => { + const title = $(element).find(".movie-title").text(); + const link = $(element).find("a").attr("href"); + const image = $(element).find("img").attr("src"); + if (title && link && image) { + catalog.push({ + title: title, + link: link, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + return []; + } + }); } diff --git a/dist/showbox/stream.js b/dist/showbox/stream.js index d5efe4a..679c388 100644 --- a/dist/showbox/stream.js +++ b/dist/showbox/stream.js @@ -32,39 +32,50 @@ var __importStar = (this && this.__importStar) || (function () { return result; }; })(); +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 cheerio = __importStar(require("cheerio")); -const getStream = async function ({ link: id, -// type, -signal, providerContext, }) { - try { - const { axios } = providerContext; - const stream = []; - const [, epId] = id.split("&"); - const url = `https://febbox.vercel.app/api/video-quality?fid=${epId}`; - const res = await axios.get(url, { signal }); - const data = res.data; - const $ = cheerio.load(data.html); - $(".file_quality").each((i, el) => { - const server = $(el).find("p.name").text() + - " - " + - $(el).find("p.size").text() + - " - " + - $(el).find("p.speed").text(); - const link = $(el).attr("data-url"); - if (link) { - stream.push({ - server: server, - type: "mkv", - link: link, - }); - } - }); - return stream; - } - catch (err) { - return []; - } +const getStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link: id, + // type, + signal, providerContext, }) { + try { + const { axios } = providerContext; + const stream = []; + const [, epId] = id.split("&"); + const url = `https://febbox.vercel.app/api/video-quality?fid=${epId}`; + const res = yield axios.get(url, { signal }); + const data = res.data; + const $ = cheerio.load(data.html); + $(".file_quality").each((i, el) => { + const server = $(el).find("p.name").text() + + " - " + + $(el).find("p.size").text() + + " - " + + $(el).find("p.speed").text(); + const link = $(el).attr("data-url"); + if (link) { + stream.push({ + server: server, + type: "mkv", + link: link, + }); + } + }); + return stream; + } + catch (err) { + return []; + } + }); }; exports.getStream = getStream; diff --git a/dist/superVideoExtractor.js b/dist/superVideoExtractor.js index 27dc0e0..79f0660 100644 --- a/dist/superVideoExtractor.js +++ b/dist/superVideoExtractor.js @@ -1,38 +1,50 @@ "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.superVideoExtractor = superVideoExtractor; -async function superVideoExtractor(data) { - try { - // Step 1: Extract the function parameters and the encoded string - var functionRegex = /eval\(function\((.*?)\)\{.*?return p\}.*?\('(.*?)'\.split/; - var match = functionRegex.exec(data); - let p = ''; - if (match) { - // var params = match[1].split(',').map(param => param.trim()); - var encodedString = match[2]; - // console.log('Parameters:', params); - // console.log('Encoded String:', encodedString.split("',36,")[0], '🔥🔥'); - p = encodedString.split("',36,")?.[0].trim(); - let a = 36; - let c = encodedString.split("',36,")[1].slice(2).split('|').length; - let k = encodedString.split("',36,")[1].slice(2).split('|'); - while (c--) { - if (k[c]) { - var regex = new RegExp('\\b' + c.toString(a) + '\\b', 'g'); - p = p.replace(regex, k[c]); +function superVideoExtractor(data) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b; + try { + // Step 1: Extract the function parameters and the encoded string + var functionRegex = /eval\(function\((.*?)\)\{.*?return p\}.*?\('(.*?)'\.split/; + var match = functionRegex.exec(data); + let p = ''; + if (match) { + // var params = match[1].split(',').map(param => param.trim()); + var encodedString = match[2]; + // console.log('Parameters:', params); + // console.log('Encoded String:', encodedString.split("',36,")[0], '🔥🔥'); + p = (_a = encodedString.split("',36,")) === null || _a === void 0 ? void 0 : _a[0].trim(); + let a = 36; + let c = encodedString.split("',36,")[1].slice(2).split('|').length; + let k = encodedString.split("',36,")[1].slice(2).split('|'); + while (c--) { + if (k[c]) { + var regex = new RegExp('\\b' + c.toString(a) + '\\b', 'g'); + p = p.replace(regex, k[c]); + } } + // console.log('Decoded String:', p); } - // console.log('Decoded String:', p); + else { + console.log('No match found'); + } + const streamUrl = (_b = p === null || p === void 0 ? void 0 : p.match(/file:\s*"([^"]+\.m3u8[^"]*)"/)) === null || _b === void 0 ? void 0 : _b[1]; + console.log('streamUrl:', streamUrl); + return streamUrl || ''; } - else { - console.log('No match found'); + catch (err) { + console.error('SuperVideoExtractor Error:', err); + return ''; } - const streamUrl = p?.match(/file:\s*"([^"]+\.m3u8[^"]*)"/)?.[1]; - console.log('streamUrl:', streamUrl); - return streamUrl || ''; - } - catch (err) { - console.error('SuperVideoExtractor Error:', err); - return ''; - } + }); } diff --git a/dist/tokyoInsider/meta.js b/dist/tokyoInsider/meta.js index 6720ce6..99f1bd9 100644 --- a/dist/tokyoInsider/meta.js +++ b/dist/tokyoInsider/meta.js @@ -1,60 +1,68 @@ "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 getMeta = async function ({ link, providerContext, }) { - try { - const { cheerio } = providerContext; - const url = link; - const res = await fetch(url); - const data = await res.text(); - const $ = cheerio.load(data); - const meta = { - title: $('.c_h2:contains("Title(s):")') - .text() - .replace("Title(s):", "") - .trim() - .split("\n")[0], - synopsis: $('.c_h2b:contains("Summary:"),.c_h2:contains("Summary:")') - .text() - .replace("Summary:", "") - .trim(), - image: $(".a_img").attr("src") || "", - imdbId: "", - type: "series", - }; - const episodesList = []; - $(".episode").map((i, element) => { - const link = "https://www.tokyoinsider.com" + $(element).find("a").attr("href") || - $(".download-link").attr("href"); - let title = $(element).find("a").find("em").text() + - " " + - $(element).find("a").find("strong").text(); - if (!title.trim()) { - title = $(".download-link").text(); - } - if (link && title.trim()) { - episodesList.push({ title, link }); - } - }); - return { - ...meta, - linkList: [ - { - title: meta.title, - directLinks: episodesList, - }, - ], - }; - } - catch (err) { - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "series", - linkList: [], - }; - } +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { + try { + const { cheerio } = providerContext; + const url = link; + const res = yield fetch(url); + const data = yield res.text(); + const $ = cheerio.load(data); + const meta = { + title: $('.c_h2:contains("Title(s):")') + .text() + .replace("Title(s):", "") + .trim() + .split("\n")[0], + synopsis: $('.c_h2b:contains("Summary:"),.c_h2:contains("Summary:")') + .text() + .replace("Summary:", "") + .trim(), + image: $(".a_img").attr("src") || "", + imdbId: "", + type: "series", + }; + const episodesList = []; + $(".episode").map((i, element) => { + const link = "https://www.tokyoinsider.com" + $(element).find("a").attr("href") || + $(".download-link").attr("href"); + let title = $(element).find("a").find("em").text() + + " " + + $(element).find("a").find("strong").text(); + if (!title.trim()) { + title = $(".download-link").text(); + } + if (link && title.trim()) { + episodesList.push({ title, link }); + } + }); + return Object.assign(Object.assign({}, meta), { linkList: [ + { + title: meta.title, + directLinks: episodesList, + }, + ] }); + } + catch (err) { + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "series", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/tokyoInsider/posts.js b/dist/tokyoInsider/posts.js index 9bfea14..05a7278 100644 --- a/dist/tokyoInsider/posts.js +++ b/dist/tokyoInsider/posts.js @@ -1,50 +1,65 @@ "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 getPosts = async function ({ filter, page, -// providerValue, -signal, providerContext, }) { - const { getBaseUrl, axios, cheerio } = providerContext; - const baseURL = await getBaseUrl("tokyoinsider"); - const start = page < 2 ? 0 : (page - 1) * 20; - const url = `${baseURL}/${filter}&start=${start}`; - return posts({ baseURL, url, signal, axios, cheerio }); +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, + // providerValue, + signal, providerContext, }) { + const { getBaseUrl, axios, cheerio } = providerContext; + const baseURL = yield getBaseUrl("tokyoinsider"); + const start = page < 2 ? 0 : (page - 1) * 20; + const url = `${baseURL}/${filter}&start=${start}`; + return posts({ baseURL, url, signal, axios, cheerio }); + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, -// providerValue, -signal, providerContext, }) { - const { getBaseUrl, axios, cheerio } = providerContext; - const baseURL = await getBaseUrl("tokyoinsider"); - const start = page < 2 ? 0 : (page - 1) * 20; - const url = `${baseURL}/anime/search?k=${searchQuery}&start=${start}`; - return posts({ baseURL, url, signal, axios, cheerio }); +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, + // providerValue, + signal, providerContext, }) { + const { getBaseUrl, axios, cheerio } = providerContext; + const baseURL = yield getBaseUrl("tokyoinsider"); + const start = page < 2 ? 0 : (page - 1) * 20; + const url = `${baseURL}/anime/search?k=${searchQuery}&start=${start}`; + return posts({ baseURL, url, signal, axios, cheerio }); + }); }; exports.getSearchPosts = getSearchPosts; -async function posts({ baseURL, url, signal, axios, cheerio, }) { - try { - const res = await axios.get(url, { signal }); - const data = res.data; - const $ = cheerio.load(data); - const catalog = []; - $('td.c_h2[width="40"]').map((i, element) => { - const image = $(element) - .find(".a_img") - .attr("src") - ?.replace("small", "default"); - const title = $(element).find("a").attr("title"); - const link = baseURL + $(element).find("a").attr("href"); - if (title && link && image) { - catalog.push({ - title: title, - link: link, - image: image, - }); - } - }); - return catalog; - } - catch (err) { - return []; - } +function posts(_a) { + return __awaiter(this, arguments, void 0, function* ({ baseURL, url, signal, axios, cheerio, }) { + try { + const res = yield axios.get(url, { signal }); + const data = res.data; + const $ = cheerio.load(data); + const catalog = []; + $('td.c_h2[width="40"]').map((i, element) => { + var _a; + const image = (_a = $(element) + .find(".a_img") + .attr("src")) === null || _a === void 0 ? void 0 : _a.replace("small", "default"); + const title = $(element).find("a").attr("title"); + const link = baseURL + $(element).find("a").attr("href"); + if (title && link && image) { + catalog.push({ + title: title, + link: link, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + return []; + } + }); } diff --git a/dist/tokyoInsider/stream.js b/dist/tokyoInsider/stream.js index 09a61d6..bed2669 100644 --- a/dist/tokyoInsider/stream.js +++ b/dist/tokyoInsider/stream.js @@ -1,30 +1,41 @@ "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 function ({ link, providerContext, }) { - try { - const { cheerio } = providerContext; - const url = link; - const res = await fetch(url); - const data = await res.text(); - const $ = cheerio.load(data); - const streamLinks = []; - $(".c_h1,.c_h2").map((i, element) => { - $(element).find("span").remove(); - const title = $(element).find("a").text() || ""; - const link = $(element).find("a").attr("href") || ""; - if (title && link.includes("media")) { - streamLinks.push({ - server: title, - link, - type: link.split(".").pop() || "mkv", - }); - } - }); - return streamLinks; - } - catch (err) { - return []; - } +const getStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { + try { + const { cheerio } = providerContext; + const url = link; + const res = yield fetch(url); + const data = yield res.text(); + const $ = cheerio.load(data); + const streamLinks = []; + $(".c_h1,.c_h2").map((i, element) => { + $(element).find("span").remove(); + const title = $(element).find("a").text() || ""; + const link = $(element).find("a").attr("href") || ""; + if (title && link.includes("media")) { + streamLinks.push({ + server: title, + link, + type: link.split(".").pop() || "mkv", + }); + } + }); + return streamLinks; + } + catch (err) { + return []; + } + }); }; exports.getStream = getStream; diff --git a/dist/topmovies/episodes.js b/dist/topmovies/episodes.js index b1236e3..437d18d 100644 --- a/dist/topmovies/episodes.js +++ b/dist/topmovies/episodes.js @@ -1,49 +1,60 @@ "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.getEpisodes = void 0; -const getEpisodes = async function ({ url, providerContext, }) { - const { axios, cheerio } = providerContext; - try { - if (url.includes("url=")) { - url = atob(url.split("url=")[1]); - } - const res = await axios.get(url); - const html = res.data; - let $ = cheerio.load(html); - if (url.includes("url=")) { - const newUrl = $("meta[http-equiv='refresh']") - .attr("content") - ?.split("url=")[1]; - const res2 = await axios.get(newUrl || url); - const html2 = res2.data; - $ = cheerio.load(html2); - } - const episodeLinks = []; - $("h3,h4").map((i, element) => { - const seriesTitle = $(element).text(); - const episodesLink = $(element).find("a").attr("href"); - if (episodesLink && episodesLink !== "#") { - episodeLinks.push({ - title: seriesTitle.trim() || "No title found", - link: episodesLink || "", - }); +const getEpisodes = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) { + var _b; + const { axios, cheerio } = providerContext; + try { + if (url.includes("url=")) { + url = atob(url.split("url=")[1]); } - }); - $("a.maxbutton").map((i, element) => { - const seriesTitle = $(element).children("span").text(); - const episodesLink = $(element).attr("href"); - if (episodesLink && episodesLink !== "#") { - episodeLinks.push({ - title: seriesTitle.trim() || "No title found", - link: episodesLink || "", - }); + const res = yield axios.get(url); + const html = res.data; + let $ = cheerio.load(html); + if (url.includes("url=")) { + const newUrl = (_b = $("meta[http-equiv='refresh']") + .attr("content")) === null || _b === void 0 ? void 0 : _b.split("url=")[1]; + const res2 = yield axios.get(newUrl || url); + const html2 = res2.data; + $ = cheerio.load(html2); } - }); - return episodeLinks; - } - catch (err) { - console.error(err); - return []; - } + const episodeLinks = []; + $("h3,h4").map((i, element) => { + const seriesTitle = $(element).text(); + const episodesLink = $(element).find("a").attr("href"); + if (episodesLink && episodesLink !== "#") { + episodeLinks.push({ + title: seriesTitle.trim() || "No title found", + link: episodesLink || "", + }); + } + }); + $("a.maxbutton").map((i, element) => { + const seriesTitle = $(element).children("span").text(); + const episodesLink = $(element).attr("href"); + if (episodesLink && episodesLink !== "#") { + episodeLinks.push({ + title: seriesTitle.trim() || "No title found", + link: episodesLink || "", + }); + } + }); + return episodeLinks; + } + catch (err) { + console.error(err); + return []; + } + }); }; exports.getEpisodes = getEpisodes; diff --git a/dist/topmovies/meta.js b/dist/topmovies/meta.js index a2c4c23..43ca4ca 100644 --- a/dist/topmovies/meta.js +++ b/dist/topmovies/meta.js @@ -1,62 +1,75 @@ "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 getMeta = async function ({ link, providerContext, }) { - try { - const { axios, cheerio } = providerContext; - const url = link; - const res = await axios.get(url); - const data = res.data; - const $ = cheerio.load(data); - const meta = { - title: $(".imdbwp__title").text(), - synopsis: $(".imdbwp__teaser").text(), - image: $(".imdbwp__thumb").find("img").attr("src") || "", - imdbId: $(".imdbwp__link").attr("href")?.split("/")[4] || "", - type: $(".thecontent").text().toLocaleLowerCase().includes("season") - ? "series" - : "movie", - }; - const links = []; - $("h3,h4").map((i, element) => { - const seriesTitle = $(element).text(); - // const batchZipLink = $(element) - // .next("p") - // .find(".maxbutton-batch-zip,.maxbutton-zip-download") - // .attr("href"); - const episodesLink = $(element) - .next("p") - .find(".maxbutton-episode-links,.maxbutton-g-drive,.maxbutton-af-download") - .attr("href"); - const movieLink = $(element) - .next("p") - .find(".maxbutton-download-links") - .attr("href"); - if (movieLink || - (episodesLink && episodesLink !== "javascript:void(0);")) { - links.push({ - title: seriesTitle.replace("Download ", "").trim() || "Download", - episodesLink: episodesLink || "", - directLinks: movieLink - ? [{ link: movieLink, title: "Movie", type: "movie" }] - : [], - quality: seriesTitle?.match(/\d+p\b/)?.[0] || "", - }); - } - }); - // console.log('mod meta', links); - return { ...meta, linkList: links }; - } - catch (err) { - console.error(err); - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "movie", - linkList: [], - }; - } +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); + const data = res.data; + const $ = cheerio.load(data); + const meta = { + title: $(".imdbwp__title").text(), + synopsis: $(".imdbwp__teaser").text(), + image: $(".imdbwp__thumb").find("img").attr("src") || "", + imdbId: ((_b = $(".imdbwp__link").attr("href")) === null || _b === void 0 ? void 0 : _b.split("/")[4]) || "", + type: $(".thecontent").text().toLocaleLowerCase().includes("season") + ? "series" + : "movie", + }; + const links = []; + $("h3,h4").map((i, element) => { + var _a; + const seriesTitle = $(element).text(); + // const batchZipLink = $(element) + // .next("p") + // .find(".maxbutton-batch-zip,.maxbutton-zip-download") + // .attr("href"); + const episodesLink = $(element) + .next("p") + .find(".maxbutton-episode-links,.maxbutton-g-drive,.maxbutton-af-download") + .attr("href"); + const movieLink = $(element) + .next("p") + .find(".maxbutton-download-links") + .attr("href"); + if (movieLink || + (episodesLink && episodesLink !== "javascript:void(0);")) { + links.push({ + title: seriesTitle.replace("Download ", "").trim() || "Download", + episodesLink: episodesLink || "", + directLinks: movieLink + ? [{ link: movieLink, title: "Movie", type: "movie" }] + : [], + quality: ((_a = seriesTitle === null || seriesTitle === void 0 ? void 0 : seriesTitle.match(/\d+p\b/)) === null || _a === void 0 ? void 0 : _a[0]) || "", + }); + } + }); + // console.log('mod meta', links); + return Object.assign(Object.assign({}, meta), { linkList: links }); + } + catch (err) { + console.error(err); + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/topmovies/posts.js b/dist/topmovies/posts.js index b5e989b..29007ec 100644 --- a/dist/topmovies/posts.js +++ b/dist/topmovies/posts.js @@ -1,4 +1,13 @@ "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 headers = { @@ -17,48 +26,54 @@ const headers = { "Upgrade-Insecure-Requests": "1", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0", }; -const getPosts = async function ({ filter, page, signal, providerContext, }) { - const { getBaseUrl } = providerContext; - const baseUrl = await getBaseUrl("Topmovies"); - const url = `${baseUrl + filter}/page/${page}/`; - return posts(url, signal, providerContext); +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, signal, providerContext, }) { + const { getBaseUrl } = providerContext; + const baseUrl = yield getBaseUrl("Topmovies"); + const url = `${baseUrl + filter}/page/${page}/`; + return posts(url, signal, providerContext); + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) { - const { getBaseUrl } = providerContext; - const baseUrl = await getBaseUrl("Topmovies"); - const url = `${baseUrl}/search/${searchQuery}/page/${page}/`; - return posts(url, signal, providerContext); +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) { + const { getBaseUrl } = providerContext; + const baseUrl = yield getBaseUrl("Topmovies"); + const url = `${baseUrl}/search/${searchQuery}/page/${page}/`; + return posts(url, signal, providerContext); + }); }; exports.getSearchPosts = getSearchPosts; -async function posts(url, signal, providerContext) { - try { - const { axios, cheerio } = providerContext; - const res = await axios.get(url, { headers, signal }); - const data = res.data; - const $ = cheerio.load(data); - const catalog = []; - $(".post-cards") - .find("article") - .map((i, element) => { - const title = $(element).find("a").attr("title"); - const link = $(element).find("a").attr("href"); - const image = $(element).find("img").attr("data-src") || - $(element).find("img").attr("src") || - ""; - if (title && link) { - catalog.push({ - title: title.replace("Download", "").trim(), - link: link, - image: image, - }); - } - }); - // console.log(catalog); - return catalog; - } - catch (err) { - console.error("mod error ", err); - return []; - } +function posts(url, signal, providerContext) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { axios, cheerio } = providerContext; + const res = yield axios.get(url, { headers, signal }); + const data = res.data; + const $ = cheerio.load(data); + const catalog = []; + $(".post-cards") + .find("article") + .map((i, element) => { + const title = $(element).find("a").attr("title"); + const link = $(element).find("a").attr("href"); + const image = $(element).find("img").attr("data-src") || + $(element).find("img").attr("src") || + ""; + if (title && link) { + catalog.push({ + title: title.replace("Download", "").trim(), + link: link, + image: image, + }); + } + }); + // console.log(catalog); + return catalog; + } + catch (err) { + console.error("mod error ", err); + return []; + } + }); } diff --git a/dist/topmovies/stream.js b/dist/topmovies/stream.js index f7076c2..3dea75c 100644 --- a/dist/topmovies/stream.js +++ b/dist/topmovies/stream.js @@ -1,4 +1,13 @@ "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 headers = { @@ -17,192 +26,199 @@ const headers = { "Upgrade-Insecure-Requests": "1", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0", }; -const getStream = async function ({ link: url, type, providerContext, }) { - const { axios, cheerio } = providerContext; - try { - const modGetEpisodeLinks = async function ({ url, providerContext, }) { - const { axios, cheerio } = providerContext; +const getStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link: url, type, providerContext, }) { + var _b, _c; + const { axios, cheerio } = providerContext; + try { + const modGetEpisodeLinks = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) { + var _b; + const { axios, cheerio } = providerContext; + try { + if (url.includes("url=")) { + url = atob(url.split("url=")[1]); + } + const res = yield axios.get(url); + const html = res.data; + let $ = cheerio.load(html); + if (url.includes("url=")) { + const newUrl = (_b = $("meta[http-equiv='refresh']") + .attr("content")) === null || _b === void 0 ? void 0 : _b.split("url=")[1]; + const res2 = yield axios.get(newUrl || url); + const html2 = res2.data; + $ = cheerio.load(html2); + } + const episodeLinks = []; + $("h3,h4").map((i, element) => { + const seriesTitle = $(element).text(); + const episodesLink = $(element).find("a").attr("href"); + if (episodesLink && episodesLink !== "#") { + episodeLinks.push({ + title: seriesTitle.trim() || "No title found", + link: episodesLink || "", + }); + } + }); + $("a.maxbutton").map((i, element) => { + const seriesTitle = $(element).children("span").text(); + const episodesLink = $(element).attr("href"); + if (episodesLink && episodesLink !== "#") { + episodeLinks.push({ + title: seriesTitle.trim() || "No title found", + link: episodesLink || "", + }); + } + }); + return episodeLinks; + } + catch (err) { + console.error(err); + return []; + } + }); + }; + console.log("modGetStream", type, url); + if (type === "movie") { + const servers = yield modGetEpisodeLinks({ url, providerContext }); + url = servers[0].link || url; + } + let downloadLink = yield modExtractor(url, providerContext); + // console.log(downloadLink.data); + const ddl = ((_c = (_b = downloadLink === null || downloadLink === void 0 ? void 0 : downloadLink.data) === null || _b === void 0 ? void 0 : _b.match(/content="0;url=(.*?)"/)) === null || _c === void 0 ? void 0 : _c[1]) || url; + // console.log('ddl', url); + // console.log(ddl); + // console.log(ddl); + const servers = []; + const driveLink = yield isDriveLink(ddl); + const driveRes = yield axios.get(driveLink, { headers }); + const driveHtml = driveRes.data; + const $drive = cheerio.load(driveHtml); try { - if (url.includes("url=")) { - url = atob(url.split("url=")[1]); - } - const res = await axios.get(url); - const html = res.data; - let $ = cheerio.load(html); - if (url.includes("url=")) { - const newUrl = $("meta[http-equiv='refresh']") - .attr("content") - ?.split("url=")[1]; - const res2 = await axios.get(newUrl || url); - const html2 = res2.data; - $ = cheerio.load(html2); - } - const episodeLinks = []; - $("h3,h4").map((i, element) => { - const seriesTitle = $(element).text(); - const episodesLink = $(element).find("a").attr("href"); - if (episodesLink && episodesLink !== "#") { - episodeLinks.push({ - title: seriesTitle.trim() || "No title found", - link: episodesLink || "", - }); - } + const resumeBot = $drive(".btn.btn-light").attr("href") || ""; + const resumeBotRes = yield axios.get(resumeBot, { headers }); + const resumeBotToken = resumeBotRes.data.match(/formData\.append\('token', '([a-f0-9]+)'\)/)[1]; + const resumeBotBody = new FormData(); + resumeBotBody.append("token", resumeBotToken); + const resumeBotPath = resumeBotRes.data.match(/fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/)[1]; + const resumeBotBaseUrl = resumeBot.split("/download")[0]; + // console.log( + // 'resumeBotPath', + // resumeBotBaseUrl + '/download?id=' + resumeBotPath, + // ); + // console.log('resumeBotBody', resumeBotToken); + const resumeBotDownload = yield fetch(resumeBotBaseUrl + "/download?id=" + resumeBotPath, { + method: "POST", + body: resumeBotBody, + headers: { + Referer: resumeBot, + Cookie: "PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308", + }, }); - $("a.maxbutton").map((i, element) => { - const seriesTitle = $(element).children("span").text(); - const episodesLink = $(element).attr("href"); - if (episodesLink && episodesLink !== "#") { - episodeLinks.push({ - title: seriesTitle.trim() || "No title found", - link: episodesLink || "", - }); - } - }); - return episodeLinks; - } - catch (err) { - console.error(err); - return []; - } - }; - console.log("modGetStream", type, url); - if (type === "movie") { - const servers = await modGetEpisodeLinks({ url, providerContext }); - url = servers[0].link || url; - } - let downloadLink = await modExtractor(url, providerContext); - // console.log(downloadLink.data); - const ddl = downloadLink?.data?.match(/content="0;url=(.*?)"/)?.[1] || url; - // console.log('ddl', url); - // console.log(ddl); - // console.log(ddl); - const servers = []; - const driveLink = await isDriveLink(ddl); - const driveRes = await axios.get(driveLink, { headers }); - const driveHtml = driveRes.data; - const $drive = cheerio.load(driveHtml); - try { - const resumeBot = $drive(".btn.btn-light").attr("href") || ""; - const resumeBotRes = await axios.get(resumeBot, { headers }); - const resumeBotToken = resumeBotRes.data.match(/formData\.append\('token', '([a-f0-9]+)'\)/)[1]; - const resumeBotBody = new FormData(); - resumeBotBody.append("token", resumeBotToken); - const resumeBotPath = resumeBotRes.data.match(/fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/)[1]; - const resumeBotBaseUrl = resumeBot.split("/download")[0]; - // console.log( - // 'resumeBotPath', - // resumeBotBaseUrl + '/download?id=' + resumeBotPath, - // ); - // console.log('resumeBotBody', resumeBotToken); - const resumeBotDownload = await fetch(resumeBotBaseUrl + "/download?id=" + resumeBotPath, { - method: "POST", - body: resumeBotBody, - headers: { - Referer: resumeBot, - Cookie: "PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308", - }, - }); - const resumeBotDownloadData = await resumeBotDownload.json(); - console.log("resumeBotDownloadData", resumeBotDownloadData.url); - servers.push({ - server: "ResumeBot", - link: resumeBotDownloadData.url, - type: "mkv", - }); - } - catch (err) { - console.log("ResumeBot link not found", err); - } - // CF workers type 1 - try { - const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=1"; - const cfWorkersRes = await axios.get(cfWorkersLink, { headers }); - const cfWorkersHtml = cfWorkersRes.data; - const $cfWorkers = cheerio.load(cfWorkersHtml); - const cfWorkersStream = $cfWorkers(".btn-success"); - cfWorkersStream.each((i, el) => { - const link = el.attribs?.href; - if (link) { - servers.push({ - server: "Cf Worker 1." + i, - link: link, - type: "mkv", - }); - } - }); - } - catch (err) { - console.log("CF workers link not found", err); - } - // CF workers type 2 - try { - const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=2"; - const cfWorkersRes = await axios.get(cfWorkersLink, { headers }); - const cfWorkersHtml = cfWorkersRes.data; - const $cfWorkers = cheerio.load(cfWorkersHtml); - const cfWorkersStream = $cfWorkers(".btn-success"); - cfWorkersStream.each((i, el) => { - const link = el.attribs?.href; - if (link) { - servers.push({ - server: "Cf Worker 2." + i, - link: link, - type: "mkv", - }); - } - }); - } - catch (err) { - console.log("CF workers link not found", err); - } - // gdrive - //instant link - try { - 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 = await fetch(videoSeedUrl, { - method: "POST", - body: InstantFromData, - headers: { - "x-token": videoSeedUrl, - }, - }); - const instantLinkData = await instantLinkRes.json(); - // console.log('instantLinkData', instantLinkData); - if (instantLinkData.error === false) { - const instantLink = instantLinkData.url; + const resumeBotDownloadData = yield resumeBotDownload.json(); + console.log("resumeBotDownloadData", resumeBotDownloadData.url); servers.push({ - server: "Gdrive-Instant", - link: instantLink, + server: "ResumeBot", + link: resumeBotDownloadData.url, type: "mkv", }); } - else { - console.log("Instant link not found", instantLinkData); + catch (err) { + console.log("ResumeBot link not found", err); } + // CF workers type 1 + try { + const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=1"; + const cfWorkersRes = yield axios.get(cfWorkersLink, { headers }); + const cfWorkersHtml = cfWorkersRes.data; + const $cfWorkers = cheerio.load(cfWorkersHtml); + const cfWorkersStream = $cfWorkers(".btn-success"); + cfWorkersStream.each((i, el) => { + var _a; + const link = (_a = el.attribs) === null || _a === void 0 ? void 0 : _a.href; + if (link) { + servers.push({ + server: "Cf Worker 1." + i, + link: link, + type: "mkv", + }); + } + }); + } + catch (err) { + console.log("CF workers link not found", err); + } + // CF workers type 2 + try { + const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=2"; + const cfWorkersRes = yield axios.get(cfWorkersLink, { headers }); + const cfWorkersHtml = cfWorkersRes.data; + const $cfWorkers = cheerio.load(cfWorkersHtml); + const cfWorkersStream = $cfWorkers(".btn-success"); + cfWorkersStream.each((i, el) => { + var _a; + const link = (_a = el.attribs) === null || _a === void 0 ? void 0 : _a.href; + if (link) { + servers.push({ + server: "Cf Worker 2." + i, + link: link, + type: "mkv", + }); + } + }); + } + catch (err) { + console.log("CF workers link not found", err); + } + // gdrive + //instant link + try { + 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; + servers.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 servers; } catch (err) { - console.log("Instant link not found", err); + console.log("getStream error", err); + return []; } - return servers; - } - catch (err) { - console.log("getStream error", err); - return []; - } + }); }; exports.getStream = getStream; -const isDriveLink = async (ddl) => { +const isDriveLink = (ddl) => __awaiter(void 0, void 0, void 0, function* () { if (ddl.includes("drive")) { - const driveLeach = await fetch(ddl); - const driveLeachData = await driveLeach.text(); + const driveLeach = yield fetch(ddl); + const driveLeachData = yield driveLeach.text(); const pathMatch = driveLeachData.match(/window\.location\.replace\("([^"]+)"\)/); - const path = pathMatch?.[1]; + const path = pathMatch === null || pathMatch === void 0 ? void 0 : pathMatch[1]; const mainUrl = ddl.split("/")[2]; console.log(`driveUrl = https://${mainUrl}${path}`); return `https://${mainUrl}${path}`; @@ -210,47 +226,49 @@ const isDriveLink = async (ddl) => { else { return ddl; } -}; -async function modExtractor(url, providerContext) { - const { axios, cheerio } = providerContext; - try { - const wpHttp = url.split("sid=")[1]; - var bodyFormData0 = new FormData(); - bodyFormData0.append("_wp_http", wpHttp); - const res = await fetch(url.split("?")[0], { - method: "POST", - body: bodyFormData0, - }); - const data = await res.text(); - // console.log('', data); - const html = data; - const $ = cheerio.load(html); - // find input with name="_wp_http2" - const wpHttp2 = $("input").attr("name", "_wp_http2").val(); - // console.log('wpHttp2', wpHttp2); - // form data - var bodyFormData = new FormData(); - bodyFormData.append("_wp_http2", wpHttp2); - const formUrl1 = $("form").attr("action"); - const formUrl = formUrl1 || url.split("?")[0]; - const res2 = await fetch(formUrl, { - method: "POST", - body: bodyFormData, - }); - const html2 = await res2.text(); - const link = html2.match(/setAttribute\("href",\s*"(.*?)"/)[1]; - console.log(link); - const cookie = link.split("=")[1]; - console.log("cookie", cookie); - const downloadLink = await axios.get(link, { - headers: { - Referer: formUrl, - Cookie: `${cookie}=${wpHttp2}`, - }, - }); - return downloadLink; - } - catch (err) { - console.log("modGetStream error", err); - } +}); +function modExtractor(url, providerContext) { + return __awaiter(this, void 0, void 0, function* () { + const { axios, cheerio } = providerContext; + try { + const wpHttp = url.split("sid=")[1]; + var bodyFormData0 = new FormData(); + bodyFormData0.append("_wp_http", wpHttp); + const res = yield fetch(url.split("?")[0], { + method: "POST", + body: bodyFormData0, + }); + const data = yield res.text(); + // console.log('', data); + const html = data; + const $ = cheerio.load(html); + // find input with name="_wp_http2" + const wpHttp2 = $("input").attr("name", "_wp_http2").val(); + // console.log('wpHttp2', wpHttp2); + // form data + var bodyFormData = new FormData(); + bodyFormData.append("_wp_http2", wpHttp2); + const formUrl1 = $("form").attr("action"); + const formUrl = formUrl1 || url.split("?")[0]; + const res2 = yield fetch(formUrl, { + method: "POST", + body: bodyFormData, + }); + const html2 = yield res2.text(); + const link = html2.match(/setAttribute\("href",\s*"(.*?)"/)[1]; + console.log(link); + const cookie = link.split("=")[1]; + console.log("cookie", cookie); + const downloadLink = yield axios.get(link, { + headers: { + Referer: formUrl, + Cookie: `${cookie}=${wpHttp2}`, + }, + }); + return downloadLink; + } + catch (err) { + console.log("modGetStream error", err); + } + }); } diff --git a/dist/uhd/meta.js b/dist/uhd/meta.js index 6d2416d..ab52730 100644 --- a/dist/uhd/meta.js +++ b/dist/uhd/meta.js @@ -1,4 +1,13 @@ "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 headers = { @@ -16,93 +25,96 @@ const headers = { "Upgrade-Insecure-Requests": "1", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0", }; -const getMeta = async function ({ link, providerContext, }) { - try { - const { axios, cheerio } = providerContext; - const url = link; - const res = await axios.get(url, { headers }); - const html = await res.data; - const $ = cheerio.load(html); - const title = $("h2:first").text() || ""; - const image = $("h2").siblings().find("img").attr("src") || ""; - // const trailer = $('iframe').attr('src') || ''; - // console.log({ title, image, trailer }); - // Links - const episodes = []; - // new structure - $(".mks_separator").each((index, element) => { - $(element) - .nextUntil(".mks_separator") - .each((index, element) => { - const title = $(element).text(); - const episodesList = []; +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 }); + const html = yield res.data; + const $ = cheerio.load(html); + const title = $("h2:first").text() || ""; + const image = $("h2").siblings().find("img").attr("src") || ""; + // const trailer = $('iframe').attr('src') || ''; + // console.log({ title, image, trailer }); + // Links + const episodes = []; + // new structure + $(".mks_separator").each((index, element) => { $(element) - .next("p") - .find("a") + .nextUntil(".mks_separator") .each((index, element) => { const title = $(element).text(); - const link = $(element).attr("href"); - if (title && link && !title.toLocaleLowerCase().includes("zip")) { - episodesList.push({ title, link }); - // console.log({ title, link }); + const episodesList = []; + $(element) + .next("p") + .find("a") + .each((index, element) => { + const title = $(element).text(); + const link = $(element).attr("href"); + if (title && link && !title.toLocaleLowerCase().includes("zip")) { + episodesList.push({ title, link }); + // console.log({ title, link }); + } + }); + if (title && episodesList.length > 0) { + episodes.push({ + title, + directLinks: episodesList, + }); } }); - if (title && episodesList.length > 0) { - episodes.push({ - title, - directLinks: episodesList, - }); - } }); - }); - // old structure - $("hr").each((index, element) => { - $(element) - .nextUntil("hr") - .each((index, element) => { - const title = $(element).text(); - const episodesList = []; + // old structure + $("hr").each((index, element) => { $(element) - .next("p") - .find("a") + .nextUntil("hr") .each((index, element) => { const title = $(element).text(); - const link = $(element).attr("href"); - if (title && link && !title.toLocaleLowerCase().includes("zip")) { - episodesList.push({ title, link }); - // console.log({ title, link }); + const episodesList = []; + $(element) + .next("p") + .find("a") + .each((index, element) => { + const title = $(element).text(); + const link = $(element).attr("href"); + if (title && link && !title.toLocaleLowerCase().includes("zip")) { + episodesList.push({ title, link }); + // console.log({ title, link }); + } + }); + if (title && episodesList.length > 0) { + episodes.push({ + title, + directLinks: episodesList, + }); } }); - if (title && episodesList.length > 0) { - episodes.push({ - title, - directLinks: episodesList, - }); - } }); - }); - // console.log(episodes); - return { - title: title.match(/^Download\s+([^(\[]+)/i) - ? title?.match(/^Download\s+([^(\[]+)/i)?.[1] || "" - : title.replace("Download", "") || "", - image, - imdbId: "", - synopsis: title, - type: "", - linkList: episodes, - }; - } - catch (error) { - console.error(error); - return { - title: "", - image: "", - imdbId: "", - synopsis: "", - linkList: [], - type: "uhd", - }; - } + // console.log(episodes); + return { + title: title.match(/^Download\s+([^(\[]+)/i) + ? ((_b = title === null || title === void 0 ? void 0 : title.match(/^Download\s+([^(\[]+)/i)) === null || _b === void 0 ? void 0 : _b[1]) || "" + : title.replace("Download", "") || "", + image, + imdbId: "", + synopsis: title, + type: "", + linkList: episodes, + }; + } + catch (error) { + console.error(error); + return { + title: "", + image: "", + imdbId: "", + synopsis: "", + linkList: [], + type: "uhd", + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/uhd/posts.js b/dist/uhd/posts.js index e4c39af..38acb6f 100644 --- a/dist/uhd/posts.js +++ b/dist/uhd/posts.js @@ -1,4 +1,13 @@ "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 headers = { @@ -16,50 +25,52 @@ const headers = { "Upgrade-Insecure-Requests": "1", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0", }; -const getPosts = async ({ filter, page, +const getPosts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ filter, page, // providerValue, -signal, providerContext, }) => { +signal, providerContext, }) { const { getBaseUrl } = providerContext; - const baseUrl = await getBaseUrl("UhdMovies"); + const baseUrl = yield getBaseUrl("UhdMovies"); const url = page === 1 ? `${baseUrl}/${filter}/` : `${baseUrl + filter}/page/${page}/`; console.log("url", url); return posts(baseUrl, url, signal, providerContext); -}; +}); exports.getPosts = getPosts; -const getSearchPosts = async ({ searchQuery, page, +const getSearchPosts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ searchQuery, page, // providerValue, -signal, providerContext, }) => { +signal, providerContext, }) { const { getBaseUrl } = providerContext; - const baseUrl = await getBaseUrl("UhdMovies"); + const baseUrl = yield getBaseUrl("UhdMovies"); const url = `${baseUrl}/search/${searchQuery}/page/${page}/`; return posts(baseUrl, url, signal, providerContext); -}; +}); exports.getSearchPosts = getSearchPosts; -async function posts(baseURL, url, signal, providerContext) { - try { - const { axios, cheerio } = providerContext; - const res = await axios.get(url, { headers, signal }); - const html = res.data; - const $ = cheerio.load(html); - const uhdCatalog = []; - $(".gridlove-posts") - .find(".layout-masonry") - .each((index, element) => { - const title = $(element).find("a").attr("title"); - const link = $(element).find("a").attr("href"); - const image = $(element).find("a").find("img").attr("src"); - if (title && link && image) { - uhdCatalog.push({ - title: title.replace("Download", "").trim(), - link: link, - image: image, - }); - } - }); - return uhdCatalog; - } - catch (err) { - console.error("uhd error ", err); - return []; - } +function posts(baseURL, url, signal, providerContext) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { axios, cheerio } = providerContext; + const res = yield axios.get(url, { headers, signal }); + const html = res.data; + const $ = cheerio.load(html); + const uhdCatalog = []; + $(".gridlove-posts") + .find(".layout-masonry") + .each((index, element) => { + const title = $(element).find("a").attr("title"); + const link = $(element).find("a").attr("href"); + const image = $(element).find("a").find("img").attr("src"); + if (title && link && image) { + uhdCatalog.push({ + title: title.replace("Download", "").trim(), + link: link, + image: image, + }); + } + }); + return uhdCatalog; + } + catch (err) { + console.error("uhd error ", err); + return []; + } + }); } diff --git a/dist/uhd/stream.js b/dist/uhd/stream.js index 6281ff9..f66b93b 100644 --- a/dist/uhd/stream.js +++ b/dist/uhd/stream.js @@ -1,4 +1,13 @@ "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 headers = { @@ -16,17 +25,18 @@ const headers = { "Upgrade-Insecure-Requests": "1", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0", }; -const getStream = async ({ link: url, providerContext, }) => { +const getStream = (_a) => __awaiter(void 0, [_a], void 0, function* ({ link: url, providerContext, }) { + var _b, _c; try { const { axios, cheerio } = providerContext; - let downloadLink = await modExtractor(url, providerContext); + let downloadLink = yield modExtractor(url, providerContext); // console.log(downloadLink.data); - const ddl = downloadLink?.data?.match(/content="0;url=(.*?)"/)?.[1] || url; + const ddl = ((_c = (_b = downloadLink === null || downloadLink === void 0 ? void 0 : downloadLink.data) === null || _b === void 0 ? void 0 : _b.match(/content="0;url=(.*?)"/)) === null || _c === void 0 ? void 0 : _c[1]) || url; console.log("ddl", ddl); // console.log(ddl); - const driveLink = await isDriveLink(ddl); + const driveLink = yield isDriveLink(ddl); const ServerLinks = []; - const driveRes = await axios.get(driveLink, { headers }); + const driveRes = yield axios.get(driveLink, { headers }); const driveHtml = driveRes.data; const $drive = cheerio.load(driveHtml); //instant link @@ -38,14 +48,14 @@ const getStream = async ({ link: url, providerContext, }) => { InstantFromData.append("keys", instantToken); const videoSeedUrl = seed.split("/").slice(0, 3).join("/") + "/api"; // console.log('videoSeedUrl', videoSeedUrl); - const instantLinkRes = await fetch(videoSeedUrl, { + const instantLinkRes = yield fetch(videoSeedUrl, { method: "POST", body: InstantFromData, headers: { "x-token": videoSeedUrl, }, }); - const instantLinkData = await instantLinkRes.json(); + const instantLinkData = yield instantLinkRes.json(); // console.log('instantLinkData', instantLinkData); if (instantLinkData.error === false) { const instantLink = instantLinkData.url; @@ -66,7 +76,7 @@ const getStream = async ({ link: url, providerContext, }) => { try { const resumeDrive = driveLink.replace("/file", "/zfile"); // console.log('resumeDrive', resumeDrive); - const resumeDriveRes = await axios.get(resumeDrive, { headers }); + const resumeDriveRes = yield axios.get(resumeDrive, { headers }); const resumeDriveHtml = resumeDriveRes.data; const $resumeDrive = cheerio.load(resumeDriveHtml); const resumeLink = $resumeDrive(".btn-success").attr("href"); @@ -85,12 +95,13 @@ const getStream = async ({ link: url, providerContext, }) => { // CF workers type 1 try { const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=1"; - const cfWorkersRes = await axios.get(cfWorkersLink, { headers }); + const cfWorkersRes = yield axios.get(cfWorkersLink, { headers }); const cfWorkersHtml = cfWorkersRes.data; const $cfWorkers = cheerio.load(cfWorkersHtml); const cfWorkersStream = $cfWorkers(".btn-success"); cfWorkersStream.each((i, el) => { - const link = el.attribs?.href; + var _a; + const link = (_a = el.attribs) === null || _a === void 0 ? void 0 : _a.href; if (link) { ServerLinks.push({ server: "Cf Worker 1." + i, @@ -106,12 +117,13 @@ const getStream = async ({ link: url, providerContext, }) => { // CF workers type 2 try { const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=2"; - const cfWorkersRes = await axios.get(cfWorkersLink, { headers }); + const cfWorkersRes = yield axios.get(cfWorkersLink, { headers }); const cfWorkersHtml = cfWorkersRes.data; const $cfWorkers = cheerio.load(cfWorkersHtml); const cfWorkersStream = $cfWorkers(".btn-success"); cfWorkersStream.each((i, el) => { - const link = el.attribs?.href; + var _a; + const link = (_a = el.attribs) === null || _a === void 0 ? void 0 : _a.href; if (link) { ServerLinks.push({ server: "Cf Worker 2." + i, @@ -131,14 +143,14 @@ const getStream = async ({ link: url, providerContext, }) => { console.log("getStream error", err); return []; } -}; +}); exports.getStream = getStream; -const isDriveLink = async (ddl) => { +const isDriveLink = (ddl) => __awaiter(void 0, void 0, void 0, function* () { if (ddl.includes("drive")) { - const driveLeach = await fetch(ddl); - const driveLeachData = await driveLeach.text(); + const driveLeach = yield fetch(ddl); + const driveLeachData = yield driveLeach.text(); const pathMatch = driveLeachData.match(/window\.location\.replace\("([^"]+)"\)/); - const path = pathMatch?.[1]; + const path = pathMatch === null || pathMatch === void 0 ? void 0 : pathMatch[1]; const mainUrl = ddl.split("/")[2]; console.log(`driveUrl = https://${mainUrl}${path}`); return `https://${mainUrl}${path}`; @@ -146,47 +158,49 @@ const isDriveLink = async (ddl) => { else { return ddl; } -}; -async function modExtractor(url, providerContext) { - const { axios, cheerio } = providerContext; - try { - const wpHttp = url.split("sid=")[1]; - var bodyFormData0 = new FormData(); - bodyFormData0.append("_wp_http", wpHttp); - const res = await fetch(url.split("?")[0], { - method: "POST", - body: bodyFormData0, - }); - const data = await res.text(); - // console.log('', data); - const html = data; - const $ = cheerio.load(html); - // find input with name="_wp_http2" - const wpHttp2 = $("input").attr("name", "_wp_http2").val(); - // console.log('wpHttp2', wpHttp2); - // form data - var bodyFormData = new FormData(); - bodyFormData.append("_wp_http2", wpHttp2); - const formUrl1 = $("form").attr("action"); - const formUrl = formUrl1 || url.split("?")[0]; - const res2 = await fetch(formUrl, { - method: "POST", - body: bodyFormData, - }); - const html2 = await res2.text(); - const link = html2.match(/setAttribute\("href",\s*"(.*?)"/)[1]; - console.log(link); - const cookie = link.split("=")[1]; - console.log("cookie", cookie); - const downloadLink = await axios.get(link, { - headers: { - Referer: formUrl, - Cookie: `${cookie}=${wpHttp2}`, - }, - }); - return downloadLink; - } - catch (err) { - console.log("modGetStream error", err); - } +}); +function modExtractor(url, providerContext) { + return __awaiter(this, void 0, void 0, function* () { + const { axios, cheerio } = providerContext; + try { + const wpHttp = url.split("sid=")[1]; + var bodyFormData0 = new FormData(); + bodyFormData0.append("_wp_http", wpHttp); + const res = yield fetch(url.split("?")[0], { + method: "POST", + body: bodyFormData0, + }); + const data = yield res.text(); + // console.log('', data); + const html = data; + const $ = cheerio.load(html); + // find input with name="_wp_http2" + const wpHttp2 = $("input").attr("name", "_wp_http2").val(); + // console.log('wpHttp2', wpHttp2); + // form data + var bodyFormData = new FormData(); + bodyFormData.append("_wp_http2", wpHttp2); + const formUrl1 = $("form").attr("action"); + const formUrl = formUrl1 || url.split("?")[0]; + const res2 = yield fetch(formUrl, { + method: "POST", + body: bodyFormData, + }); + const html2 = yield res2.text(); + const link = html2.match(/setAttribute\("href",\s*"(.*?)"/)[1]; + console.log(link); + const cookie = link.split("=")[1]; + console.log("cookie", cookie); + const downloadLink = yield axios.get(link, { + headers: { + Referer: formUrl, + Cookie: `${cookie}=${wpHttp2}`, + }, + }); + return downloadLink; + } + catch (err) { + console.log("modGetStream error", err); + } + }); } diff --git a/dist/vadapav/episodes.js b/dist/vadapav/episodes.js index 6c448a3..94b66da 100644 --- a/dist/vadapav/episodes.js +++ b/dist/vadapav/episodes.js @@ -1,30 +1,42 @@ "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.getEpisodes = void 0; -const getEpisodes = async function ({ url, providerContext, }) { - const { axios, cheerio } = providerContext; - try { - const baseUrl = url?.split("/").slice(0, 3).join("/"); - const res = await axios.get(url); - const html = res.data; - let $ = cheerio.load(html); - const episodeLinks = []; - $('.file-entry:not(:contains("Parent Directory"))').map((i, element) => { - const link = $(element).attr("href"); - if (link && - ($(element).text()?.includes(".mp4") || - $(element).text()?.includes(".mkv"))) { - episodeLinks.push({ - title: $(element).text()?.match(/E\d+/)?.[0]?.replace("E", "Episode ") || - i + 1 + ". " + $(element).text()?.replace(".mkv", ""), - link: baseUrl + link, - }); - } - }); - return episodeLinks; - } - catch (err) { - return []; - } +const getEpisodes = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) { + const { axios, cheerio } = providerContext; + try { + const baseUrl = url === null || url === void 0 ? void 0 : url.split("/").slice(0, 3).join("/"); + const res = yield axios.get(url); + const html = res.data; + let $ = cheerio.load(html); + const episodeLinks = []; + $('.file-entry:not(:contains("Parent Directory"))').map((i, element) => { + var _a, _b, _c, _d, _e, _f; + const link = $(element).attr("href"); + if (link && + (((_a = $(element).text()) === null || _a === void 0 ? void 0 : _a.includes(".mp4")) || + ((_b = $(element).text()) === null || _b === void 0 ? void 0 : _b.includes(".mkv")))) { + episodeLinks.push({ + title: ((_e = (_d = (_c = $(element).text()) === null || _c === void 0 ? void 0 : _c.match(/E\d+/)) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.replace("E", "Episode ")) || + i + 1 + ". " + ((_f = $(element).text()) === null || _f === void 0 ? void 0 : _f.replace(".mkv", "")), + link: baseUrl + link, + }); + } + }); + return episodeLinks; + } + catch (err) { + return []; + } + }); }; exports.getEpisodes = getEpisodes; diff --git a/dist/vadapav/meta.js b/dist/vadapav/meta.js index fbf10a6..37760d3 100644 --- a/dist/vadapav/meta.js +++ b/dist/vadapav/meta.js @@ -1,68 +1,78 @@ "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 getMeta = async function ({ link, providerContext, }) { - try { - const { axios, cheerio } = providerContext; - const baseUrl = link?.split("/").slice(0, 3).join("/"); - const url = link; - const res = await axios.get(url); - const data = res.data; - const $ = cheerio.load(data); - const title = $(".directory") - .children() - .first() - .text() - .trim() - ?.split("/") - .pop() - ?.trim() || ""; - const links = []; - $('.directory-entry:not(:contains("Parent Directory"))').map((i, element) => { - const link = $(element).attr("href"); - if (link) { - links.push({ - episodesLink: baseUrl + link, - title: $(element).text(), - }); - } - }); - const directLinks = []; - $('.file-entry:not(:contains("Parent Directory"))').map((i, element) => { - const link = $(element).attr("href"); - if (link && - ($(element).text()?.includes(".mp4") || - $(element).text()?.includes(".mkv"))) { - directLinks.push({ - title: i + 1 + ". " + $(element).text(), - link: baseUrl + link, - }); - } - }); - if (directLinks.length > 0) { - links.push({ - title: title + " DL", - directLinks: directLinks, +const getMeta = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) { + var _b, _c; + try { + const { axios, cheerio } = providerContext; + const baseUrl = link === null || link === void 0 ? void 0 : link.split("/").slice(0, 3).join("/"); + const url = link; + const res = yield axios.get(url); + const data = res.data; + const $ = cheerio.load(data); + const title = ((_c = (_b = $(".directory") + .children() + .first() + .text() + .trim()) === null || _b === void 0 ? void 0 : _b.split("/").pop()) === null || _c === void 0 ? void 0 : _c.trim()) || ""; + const links = []; + $('.directory-entry:not(:contains("Parent Directory"))').map((i, element) => { + const link = $(element).attr("href"); + if (link) { + links.push({ + episodesLink: baseUrl + link, + title: $(element).text(), + }); + } }); + const directLinks = []; + $('.file-entry:not(:contains("Parent Directory"))').map((i, element) => { + var _a, _b; + const link = $(element).attr("href"); + if (link && + (((_a = $(element).text()) === null || _a === void 0 ? void 0 : _a.includes(".mp4")) || + ((_b = $(element).text()) === null || _b === void 0 ? void 0 : _b.includes(".mkv")))) { + directLinks.push({ + title: i + 1 + ". " + $(element).text(), + link: baseUrl + link, + }); + } + }); + if (directLinks.length > 0) { + links.push({ + title: title + " DL", + directLinks: directLinks, + }); + } + return { + title: title, + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: links, + }; } - return { - title: title, - synopsis: "", - image: "", - imdbId: "", - type: "movie", - linkList: links, - }; - } - catch (err) { - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "movie", - linkList: [], - }; - } + catch (err) { + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/vadapav/posts.js b/dist/vadapav/posts.js index 40be3b2..de84f1e 100644 --- a/dist/vadapav/posts.js +++ b/dist/vadapav/posts.js @@ -1,56 +1,72 @@ "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 getPosts = async function ({ filter, page, -// providerValue, -signal, providerContext, }) { - const { getBaseUrl, axios, cheerio } = providerContext; - const baseUrl = await getBaseUrl("vadapav"); - if (page > 1) { - return []; - } - const url = `${baseUrl + filter}`; - return posts({ baseUrl, url, signal, axios, cheerio }); +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, + // providerValue, + signal, providerContext, }) { + const { getBaseUrl, axios, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("vadapav"); + if (page > 1) { + return []; + } + const url = `${baseUrl + filter}`; + return posts({ baseUrl, url, signal, axios, cheerio }); + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, -// providerValue, -signal, providerContext, }) { - const { getBaseUrl, axios, cheerio } = providerContext; - const baseUrl = await getBaseUrl("vadapav"); - if (page > 1) { - return []; - } - const url = `${baseUrl}/s/${searchQuery}`; - return posts({ baseUrl, url, signal, axios, cheerio }); +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, + // providerValue, + signal, providerContext, }) { + const { getBaseUrl, axios, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("vadapav"); + if (page > 1) { + return []; + } + const url = `${baseUrl}/s/${searchQuery}`; + return posts({ baseUrl, url, signal, axios, cheerio }); + }); }; exports.getSearchPosts = getSearchPosts; -async function posts({ -// baseUrl, -url, signal, axios, cheerio, }) { - try { - const res = await axios.get(url, { signal }); - const data = res.data; - const $ = cheerio.load(data); - const catalog = []; - $('.directory-entry:not(:contains("Parent Directory"))').map((i, element) => { - const title = $(element).text(); - const link = $(element).attr("href"); - const imageTitle = title?.length > 30 - ? title?.slice(0, 30)?.replace(/\./g, " ") - : title?.replace(/\./g, " "); - const image = `https://placehold.jp/23/000000/ffffff/200x400.png?text=${encodeURIComponent(imageTitle)}&css=%7B%22background%22%3A%22%20-webkit-gradient(linear%2C%20left%20bottom%2C%20left%20top%2C%20from(%233f3b3b)%2C%20to(%23000000))%22%2C%22text-transform%22%3A%22%20capitalize%22%7D`; - if (title && link) { - catalog.push({ - title: title, - link: link, - image: image, - }); - } - }); - return catalog; - } - catch (err) { - return []; - } +function posts(_a) { + return __awaiter(this, arguments, void 0, function* ({ + // baseUrl, + url, signal, axios, cheerio, }) { + try { + const res = yield axios.get(url, { signal }); + const data = res.data; + const $ = cheerio.load(data); + const catalog = []; + $('.directory-entry:not(:contains("Parent Directory"))').map((i, element) => { + var _a; + const title = $(element).text(); + const link = $(element).attr("href"); + const imageTitle = (title === null || title === void 0 ? void 0 : title.length) > 30 + ? (_a = title === null || title === void 0 ? void 0 : title.slice(0, 30)) === null || _a === void 0 ? void 0 : _a.replace(/\./g, " ") + : title === null || title === void 0 ? void 0 : title.replace(/\./g, " "); + const image = `https://placehold.jp/23/000000/ffffff/200x400.png?text=${encodeURIComponent(imageTitle)}&css=%7B%22background%22%3A%22%20-webkit-gradient(linear%2C%20left%20bottom%2C%20left%20top%2C%20from(%233f3b3b)%2C%20to(%23000000))%22%2C%22text-transform%22%3A%22%20capitalize%22%7D`; + if (title && link) { + catalog.push({ + title: title, + link: link, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + return []; + } + }); } diff --git a/dist/vadapav/stream.js b/dist/vadapav/stream.js index df2dc37..e111dc9 100644 --- a/dist/vadapav/stream.js +++ b/dist/vadapav/stream.js @@ -1,19 +1,30 @@ "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 function ({ link: url, // type, // providerContext, - }) { - try { - const stream = []; - stream.push({ - server: "vadapav", - link: url, - type: url?.split(".").pop() || "mkv", - }); - return stream; - } - catch (err) { - return []; - } +const getStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link: url, // type, // providerContext, + }) { + try { + const stream = []; + stream.push({ + server: "vadapav", + link: url, + type: (url === null || url === void 0 ? void 0 : url.split(".").pop()) || "mkv", + }); + return stream; + } + catch (err) { + return []; + } + }); }; exports.getStream = getStream; diff --git a/dist/vega/episodes.js b/dist/vega/episodes.js index 7d19743..e7dc86e 100644 --- a/dist/vega/episodes.js +++ b/dist/vega/episodes.js @@ -1,34 +1,45 @@ "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.getEpisodes = void 0; -const getEpisodes = async function ({ url, providerContext, }) { - const { axios, cheerio, commonHeaders: headers } = providerContext; - console.log("getEpisodeLinks", url); - try { - const res = await axios.get(url, { headers }); - const $ = cheerio.load(res.data); - const container = $(".entry-content,.entry-inner"); - $(".unili-content,.code-block-1").remove(); - const episodes = []; - container.find("h4").each((index, element) => { - const el = $(element); - const title = el.text().replaceAll("-", "").replaceAll(":", ""); - const link = el - .next("p") - .find('.btn-outline[style="background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;"]') - .parent() - .attr("href"); - if (title && link) { - episodes.push({ title, link }); - } - }); - // console.log(episodes); - return episodes; - } - catch (err) { - console.log("getEpisodeLinks error: "); - // console.error(err); - return []; - } +const getEpisodes = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) { + const { axios, cheerio, commonHeaders: headers } = providerContext; + console.log("getEpisodeLinks", url); + try { + const res = yield axios.get(url, { headers }); + const $ = cheerio.load(res.data); + const container = $(".entry-content,.entry-inner"); + $(".unili-content,.code-block-1").remove(); + const episodes = []; + container.find("h4").each((index, element) => { + const el = $(element); + const title = el.text().replaceAll("-", "").replaceAll(":", ""); + const link = el + .next("p") + .find('.btn-outline[style="background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;"]') + .parent() + .attr("href"); + if (title && link) { + episodes.push({ title, link }); + } + }); + // console.log(episodes); + return episodes; + } + catch (err) { + console.log("getEpisodeLinks error: "); + // console.error(err); + return []; + } + }); }; exports.getEpisodes = getEpisodes; diff --git a/dist/vega/meta.js b/dist/vega/meta.js index 0abf761..e34b34e 100644 --- a/dist/vega/meta.js +++ b/dist/vega/meta.js @@ -1,4 +1,13 @@ "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 headers = { @@ -17,88 +26,69 @@ const headers = { "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", }; -const getMeta = async ({ link, providerContext, }) => { +const getMeta = (_a) => __awaiter(void 0, [_a], void 0, function* ({ link, providerContext, }) { + var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v; try { const { axios, cheerio } = providerContext; const url = link; console.log("url", url); const baseUrl = url.split("/").slice(0, 3).join("/"); - const response = await axios.get(url, { - headers: { - ...headers, - Referer: baseUrl, - }, + const response = yield axios.get(url, { + headers: Object.assign(Object.assign({}, headers), { Referer: baseUrl }), }); const $ = cheerio.load(response.data); const infoContainer = $(".entry-content,.post-inner"); - const heading = infoContainer?.find("h3"); + const heading = infoContainer === null || infoContainer === void 0 ? void 0 : infoContainer.find("h3"); const imdbId = //@ts-ignore - heading?.next("p")?.find("a")?.[0]?.attribs?.href?.match(/tt\d+/g)?.[0] || - infoContainer.text().match(/tt\d+/g)?.[0] || + ((_g = (_f = (_e = (_d = (_c = (_b = heading === null || heading === void 0 ? void 0 : heading.next("p")) === null || _b === void 0 ? void 0 : _b.find("a")) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.attribs) === null || _e === void 0 ? void 0 : _e.href) === null || _f === void 0 ? void 0 : _f.match(/tt\d+/g)) === null || _g === void 0 ? void 0 : _g[0]) || + ((_h = infoContainer.text().match(/tt\d+/g)) === null || _h === void 0 ? void 0 : _h[0]) || ""; // console.log(imdbId) - const type = heading?.next("p")?.text()?.includes("Series Name") + const type = ((_k = (_j = heading === null || heading === void 0 ? void 0 : heading.next("p")) === null || _j === void 0 ? void 0 : _j.text()) === null || _k === void 0 ? void 0 : _k.includes("Series Name")) ? "series" : "movie"; // console.log(type); // title const titleRegex = /Name: (.+)/; - const title = heading?.next("p")?.text()?.match(titleRegex)?.[1] || ""; + const title = ((_o = (_m = (_l = heading === null || heading === void 0 ? void 0 : heading.next("p")) === null || _l === void 0 ? void 0 : _l.text()) === null || _m === void 0 ? void 0 : _m.match(titleRegex)) === null || _o === void 0 ? void 0 : _o[1]) || ""; // console.log(title); // synopsis const synopsisNode = //@ts-ignore - infoContainer?.find("p")?.next("h3,h4")?.next("p")?.[0]?.children?.[0]; + (_t = (_s = (_r = (_q = (_p = infoContainer === null || infoContainer === void 0 ? void 0 : infoContainer.find("p")) === null || _p === void 0 ? void 0 : _p.next("h3,h4")) === null || _q === void 0 ? void 0 : _q.next("p")) === null || _r === void 0 ? void 0 : _r[0]) === null || _s === void 0 ? void 0 : _s.children) === null || _t === void 0 ? void 0 : _t[0]; const synopsis = synopsisNode && "data" in synopsisNode ? synopsisNode.data : ""; // console.log(synopsis); // image - let image = infoContainer?.find("img[data-lazy-src]")?.attr("data-lazy-src") || ""; + let image = ((_u = infoContainer === null || infoContainer === void 0 ? void 0 : infoContainer.find("img[data-lazy-src]")) === null || _u === void 0 ? void 0 : _u.attr("data-lazy-src")) || ""; if (image.startsWith("//")) { image = "https:" + image; } // console.log(image); // console.log({title, synopsis, image, imdbId, type}); /// Links - const hr = infoContainer?.first()?.find("hr"); - const list = hr?.nextUntil("hr"); + const hr = (_v = infoContainer === null || infoContainer === void 0 ? void 0 : infoContainer.first()) === null || _v === void 0 ? void 0 : _v.find("hr"); + const list = hr === null || hr === void 0 ? void 0 : hr.nextUntil("hr"); const links = []; list.each((index, element) => { + var _a, _b, _c, _d, _e, _f, _g, _h, _j; element = $(element); // title - const title = element?.text() || ""; - const quality = element?.text().match(/\d+p\b/)?.[0] || ""; + const title = (element === null || element === void 0 ? void 0 : element.text()) || ""; + const quality = ((_a = element === null || element === void 0 ? void 0 : element.text().match(/\d+p\b/)) === null || _a === void 0 ? void 0 : _a[0]) || ""; // console.log(title); // movieLinks - const movieLinks = element - ?.next() - .find(".dwd-button") - .text() - .toLowerCase() - .includes("download") - ? element?.next().find(".dwd-button")?.parent()?.attr("href") + const movieLinks = (element === null || element === void 0 ? void 0 : element.next().find(".dwd-button").text().toLowerCase().includes("download")) + ? (_c = (_b = element === null || element === void 0 ? void 0 : element.next().find(".dwd-button")) === null || _b === void 0 ? void 0 : _b.parent()) === null || _c === void 0 ? void 0 : _c.attr("href") : ""; // episode links - const vcloudLinks = element - ?.next() - .find(".btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;'],.btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: #fdf8f2;']") - ?.parent() - ?.attr("href"); + const vcloudLinks = (_e = (_d = element === null || element === void 0 ? void 0 : element.next().find(".btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;'],.btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: #fdf8f2;']")) === null || _d === void 0 ? void 0 : _d.parent()) === null || _e === void 0 ? void 0 : _e.attr("href"); console.log(title); const episodesLink = (vcloudLinks ? vcloudLinks - : element - ?.next() - .find(".dwd-button") - .text() - .toLowerCase() - .includes("episode") - ? element?.next().find(".dwd-button")?.parent()?.attr("href") + : (element === null || element === void 0 ? void 0 : element.next().find(".dwd-button").text().toLowerCase().includes("episode")) + ? (_g = (_f = element === null || element === void 0 ? void 0 : element.next().find(".dwd-button")) === null || _f === void 0 ? void 0 : _f.parent()) === null || _g === void 0 ? void 0 : _g.attr("href") : "") || - element - ?.next() - .find(".btn-outline[style='background:linear-gradient(135deg,#0ebac3,#09d261); color: white;']") - ?.parent() - ?.attr("href"); + ((_j = (_h = element === null || element === void 0 ? void 0 : element.next().find(".btn-outline[style='background:linear-gradient(135deg,#0ebac3,#09d261); color: white;']")) === null || _h === void 0 ? void 0 : _h.parent()) === null || _j === void 0 ? void 0 : _j.attr("href")); if (movieLinks || episodesLink) { links.push({ title, @@ -133,5 +123,5 @@ const getMeta = async ({ link, providerContext, }) => { linkList: [], }; } -}; +}); exports.getMeta = getMeta; diff --git a/dist/vega/posts.js b/dist/vega/posts.js index 12c5e13..6fd8591 100644 --- a/dist/vega/posts.js +++ b/dist/vega/posts.js @@ -1,4 +1,13 @@ "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 headers = { @@ -17,63 +26,58 @@ const headers = { "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", }; -const getPosts = async ({ filter, page, providerValue, signal, providerContext, }) => { +const getPosts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ filter, page, providerValue, signal, providerContext, }) { const { getBaseUrl, axios, cheerio } = providerContext; - const baseUrl = await getBaseUrl("Vega"); + const baseUrl = yield getBaseUrl("Vega"); console.log("vegaGetPosts baseUrl:", providerValue, baseUrl); const url = `${baseUrl}/${filter}/page/${page}/`; console.log("vegaGetPosts url:", url); return posts(baseUrl, url, signal, headers, axios, cheerio); -}; +}); exports.getPosts = getPosts; -const getSearchPosts = async ({ searchQuery, page, providerValue, signal, providerContext, }) => { +const getSearchPosts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ searchQuery, page, providerValue, signal, providerContext, }) { const { getBaseUrl, axios, commonHeaders, cheerio } = providerContext; - const baseUrl = await getBaseUrl("Vega"); + const baseUrl = yield getBaseUrl("Vega"); console.log("vegaGetPosts baseUrl:", providerValue, baseUrl); const url = `${baseUrl}/page/${page}/?s=${searchQuery}`; console.log("vegaGetPosts url:", url); return posts(baseUrl, url, signal, commonHeaders, axios, cheerio); -}; +}); exports.getSearchPosts = getSearchPosts; -async function posts(baseUrl, url, signal, headers = {}, axios, cheerio) { - try { - const urlRes = await axios.get(url, { - headers: { - ...headers, - Referer: baseUrl, - }, - signal, - }); - const $ = cheerio.load(urlRes.data); - const posts = []; - $(".blog-items,.post-list") - ?.children("article") - ?.each((index, element) => { - const post = { - title: ($(element) - ?.find("a") - ?.attr("title") - ?.replace("Download", "") - ?.match(/^(.*?)\s*\((\d{4})\)|^(.*?)\s*\((Season \d+)\)/)?.[0] || - $(element)?.find("a")?.attr("title")?.replace("Download", "") || - $(element)?.find(".post-title").text()?.replace("Download", "") || - "").trim(), - link: $(element)?.find("a")?.attr("href") || "", - image: $(element).find("a").find("img").attr("data-lazy-src") || - $(element).find("a").find("img").attr("data-src") || - $(element).find("a").find("img").attr("src") || - "", - }; - if (post.image.startsWith("//")) { - post.image = "https:" + post.image; - } - posts.push(post); - }); - // console.log(posts); - return posts; - } - catch (error) { - console.error("vegaGetPosts error:", error); - return []; - } +function posts(baseUrl_1, url_1, signal_1) { + return __awaiter(this, arguments, void 0, function* (baseUrl, url, signal, headers = {}, axios, cheerio) { + var _a, _b; + try { + const urlRes = yield axios.get(url, { + headers: Object.assign(Object.assign({}, headers), { Referer: baseUrl }), + signal, + }); + const $ = cheerio.load(urlRes.data); + const posts = []; + (_b = (_a = $(".blog-items,.post-list")) === null || _a === void 0 ? void 0 : _a.children("article")) === null || _b === void 0 ? void 0 : _b.each((index, element) => { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; + const post = { + title: (((_e = (_d = (_c = (_b = (_a = $(element)) === null || _a === void 0 ? void 0 : _a.find("a")) === null || _b === void 0 ? void 0 : _b.attr("title")) === null || _c === void 0 ? void 0 : _c.replace("Download", "")) === null || _d === void 0 ? void 0 : _d.match(/^(.*?)\s*\((\d{4})\)|^(.*?)\s*\((Season \d+)\)/)) === null || _e === void 0 ? void 0 : _e[0]) || + ((_h = (_g = (_f = $(element)) === null || _f === void 0 ? void 0 : _f.find("a")) === null || _g === void 0 ? void 0 : _g.attr("title")) === null || _h === void 0 ? void 0 : _h.replace("Download", "")) || + ((_k = (_j = $(element)) === null || _j === void 0 ? void 0 : _j.find(".post-title").text()) === null || _k === void 0 ? void 0 : _k.replace("Download", "")) || + "").trim(), + link: ((_m = (_l = $(element)) === null || _l === void 0 ? void 0 : _l.find("a")) === null || _m === void 0 ? void 0 : _m.attr("href")) || "", + image: $(element).find("a").find("img").attr("data-lazy-src") || + $(element).find("a").find("img").attr("data-src") || + $(element).find("a").find("img").attr("src") || + "", + }; + if (post.image.startsWith("//")) { + post.image = "https:" + post.image; + } + posts.push(post); + }); + // console.log(posts); + return posts; + } + catch (error) { + console.error("vegaGetPosts error:", error); + return []; + } + }); } diff --git a/dist/vega/stream.js b/dist/vega/stream.js index 42f0062..71a2787 100644 --- a/dist/vega/stream.js +++ b/dist/vega/stream.js @@ -1,4 +1,13 @@ "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 = { @@ -17,49 +26,35 @@ const headers = { "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", }; -async function getStream({ link, type, signal, providerContext, }) { - const { axios, cheerio, extractors } = providerContext; - const { hubcloudExtracter } = extractors; - try { - const streamLinks = []; - console.log("dotlink", link); - if (type === "movie") { - // vlink - const dotlinkRes = await axios(`${link}`, { headers }); - const dotlinkText = dotlinkRes.data; - // console.log('dotlinkText', dotlinkText); - const vlink = dotlinkText.match(/ { - const title = $(element).text(); - const link = $(element) - .parent() - .parent() - .next("h4") - .find("a") - .attr("href"); - if (link && !title.includes("zip")) { - episodeLinks.push({ - title: title, - link, - }); - } - }); - return episodeLinks; - } - catch (err) { - return [ - { - title: "Server 1", - link: url, - }, - ]; - } +const getEpisodes = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) { + const { axios, cheerio } = providerContext; + try { + const res = yield axios.get(url); + const html = res.data; + let $ = cheerio.load(html); + const episodeLinks = []; + $('strong:contains("Episode"),strong:contains("1080"),strong:contains("720"),strong:contains("480")').map((i, element) => { + const title = $(element).text(); + const link = $(element) + .parent() + .parent() + .next("h4") + .find("a") + .attr("href"); + if (link && !title.includes("zip")) { + episodeLinks.push({ + title: title, + link, + }); + } + }); + return episodeLinks; + } + catch (err) { + return [ + { + title: "Server 1", + link: url, + }, + ]; + } + }); }; exports.getEpisodes = getEpisodes; diff --git a/dist/world4u/meta.js b/dist/world4u/meta.js index 343c700..5e9467b 100644 --- a/dist/world4u/meta.js +++ b/dist/world4u/meta.js @@ -1,76 +1,89 @@ "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 getMeta = async function ({ link, providerContext, }) { - try { - const { axios, cheerio } = providerContext; - const url = link; - const res = await axios.get(url); - const data = res.data; - const $ = cheerio.load(data); - const type = $(".entry-content") - .text() - .toLocaleLowerCase() - .includes("movie name") - ? "movie" - : "series"; - const imdbId = $(".imdb_left").find("a").attr("href")?.split("/")[4] || ""; - const title = $(".entry-content") - .find('strong:contains("Name")') - .children() - .remove() - .end() - .text() - .replace(":", ""); - const synopsis = $(".entry-content") - .find('p:contains("Synopsis"),p:contains("Plot"),p:contains("Story")') - .children() - .remove() - .end() - .text(); - const image = $(".wp-caption").find("img").attr("data-src") || - $(".entry-content").find("img").attr("data-src") || - ""; - const links = []; - $(".my-button").map((i, element) => { - const title = $(element).parent().parent().prev().text(); - const episodesLink = $(element).attr("href"); - const quality = title.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || ""; - if (episodesLink && title) { - links.push({ - title, - episodesLink: type === "series" ? episodesLink : "", - directLinks: type === "movie" - ? [ - { - link: episodesLink, - title, - type: "movie", - }, - ] - : [], - quality, - }); - } - }); - return { - title, - synopsis, - image, - imdbId, - type, - linkList: links, - }; - } - catch (err) { - return { - title: "", - synopsis: "", - image: "", - imdbId: "", - type: "movie", - linkList: [], - }; - } +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); + const data = res.data; + const $ = cheerio.load(data); + const type = $(".entry-content") + .text() + .toLocaleLowerCase() + .includes("movie name") + ? "movie" + : "series"; + const imdbId = ((_b = $(".imdb_left").find("a").attr("href")) === null || _b === void 0 ? void 0 : _b.split("/")[4]) || ""; + const title = $(".entry-content") + .find('strong:contains("Name")') + .children() + .remove() + .end() + .text() + .replace(":", ""); + const synopsis = $(".entry-content") + .find('p:contains("Synopsis"),p:contains("Plot"),p:contains("Story")') + .children() + .remove() + .end() + .text(); + const image = $(".wp-caption").find("img").attr("data-src") || + $(".entry-content").find("img").attr("data-src") || + ""; + const links = []; + $(".my-button").map((i, element) => { + var _a; + const title = $(element).parent().parent().prev().text(); + const episodesLink = $(element).attr("href"); + const quality = ((_a = title.match(/\b(480p|720p|1080p|2160p)\b/i)) === null || _a === void 0 ? void 0 : _a[0]) || ""; + if (episodesLink && title) { + links.push({ + title, + episodesLink: type === "series" ? episodesLink : "", + directLinks: type === "movie" + ? [ + { + link: episodesLink, + title, + type: "movie", + }, + ] + : [], + quality, + }); + } + }); + return { + title, + synopsis, + image, + imdbId, + type, + linkList: links, + }; + } + catch (err) { + return { + title: "", + synopsis: "", + image: "", + imdbId: "", + type: "movie", + linkList: [], + }; + } + }); }; exports.getMeta = getMeta; diff --git a/dist/world4u/posts.js b/dist/world4u/posts.js index 21ae170..ff42fcf 100644 --- a/dist/world4u/posts.js +++ b/dist/world4u/posts.js @@ -1,48 +1,63 @@ "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 getPosts = async function ({ filter, page, -// providerValue, -signal, providerContext, }) { - const { getBaseUrl, axios, cheerio } = providerContext; - const baseUrl = await getBaseUrl("w4u"); - const url = `${baseUrl + filter}/page/${page}/`; - return posts({ url, signal, axios, cheerio }); +const getPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ filter, page, + // providerValue, + signal, providerContext, }) { + const { getBaseUrl, axios, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("w4u"); + const url = `${baseUrl + filter}/page/${page}/`; + return posts({ url, signal, axios, cheerio }); + }); }; exports.getPosts = getPosts; -const getSearchPosts = async function ({ searchQuery, page, -// providerValue, -signal, providerContext, }) { - const { getBaseUrl, axios, cheerio } = providerContext; - const baseUrl = await getBaseUrl("w4u"); - const url = `${baseUrl}/page/${page}/?s=${searchQuery}`; - return posts({ url, signal, axios, cheerio }); +const getSearchPosts = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, + // providerValue, + signal, providerContext, }) { + const { getBaseUrl, axios, cheerio } = providerContext; + const baseUrl = yield getBaseUrl("w4u"); + const url = `${baseUrl}/page/${page}/?s=${searchQuery}`; + return posts({ url, signal, axios, cheerio }); + }); }; exports.getSearchPosts = getSearchPosts; -async function posts({ url, signal, axios, cheerio, }) { - try { - const res = await axios.get(url, { signal }); - const data = res.data; - const $ = cheerio.load(data); - const catalog = []; - $(".recent-posts") - .children() - .map((i, element) => { - const title = $(element).find(".post-thumb").find("a").attr("title"); - const link = $(element).find(".post-thumb").find("a").attr("href"); - const image = $(element).find(".post-thumb").find("img").attr("data-src") || - $(element).find(".post-thumb").find("img").attr("src"); - if (title && link && image) { - catalog.push({ - title: title.replace("Download", "").trim(), - link: link, - image: image, - }); - } - }); - return catalog; - } - catch (err) { - return []; - } +function posts(_a) { + return __awaiter(this, arguments, void 0, function* ({ url, signal, axios, cheerio, }) { + try { + const res = yield axios.get(url, { signal }); + const data = res.data; + const $ = cheerio.load(data); + const catalog = []; + $(".recent-posts") + .children() + .map((i, element) => { + const title = $(element).find(".post-thumb").find("a").attr("title"); + const link = $(element).find(".post-thumb").find("a").attr("href"); + const image = $(element).find(".post-thumb").find("img").attr("data-src") || + $(element).find(".post-thumb").find("img").attr("src"); + if (title && link && image) { + catalog.push({ + title: title.replace("Download", "").trim(), + link: link, + image: image, + }); + } + }); + return catalog; + } + catch (err) { + return []; + } + }); } diff --git a/dist/world4u/stream.js b/dist/world4u/stream.js index 907ad81..92e09b4 100644 --- a/dist/world4u/stream.js +++ b/dist/world4u/stream.js @@ -1,186 +1,198 @@ "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 function ({ link: url, type, providerContext, }) { - const { axios, cheerio } = providerContext; - const headers = { - "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-Site": "none", - "Sec-Fetch-User": "?1", - "Upgrade-Insecure-Requests": "1", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0", - }; - try { - if (type === "movie") { - const linkRes = await axios.get(url, { headers }); - const linkData = linkRes.data; - const $ = cheerio.load(linkData); - url = $('strong:contains("INSTANT")').parent().attr("href") || url; - } - // fastilinks - if (url.includes("fastilinks")) { - const fastilinksRes = await axios.get(url, { headers }); - const fastilinksData = fastilinksRes.data; - const $$ = cheerio.load(fastilinksData); - const fastilinksKey = $$('input[name="_csrf_token_645a83a41868941e4692aa31e7235f2"]').attr("value"); - console.log("fastilinksKey", fastilinksKey); - const fastilinksFormData = new FormData(); - fastilinksFormData.append("_csrf_token_645a83a41868941e4692aa31e7235f2", fastilinksKey || ""); - const fastilinksRes2 = await fetch(url, { - method: "POST", - headers: headers, - body: fastilinksFormData, - }); - const fastilinksHtml = await fastilinksRes2.text(); - // console.log('fastilinksHtml', fastilinksHtml); - const $$$ = cheerio.load(fastilinksHtml); - const fastilinksLink = $$$('a:contains("mediafire")').attr("href") || - $$$('a:contains("photolinx")').attr("href"); - console.log("fastilinksLink", fastilinksLink); - url = fastilinksLink || url; - } - console.log("world4uGetStream", type, url); - if (url.includes("photolinx")) { - console.log("photolinx", url); - // const photolinxBaseUrl = url.split('/').slice(0, 3).join('/'); - const photolinxRes = await axios.get(url, { headers }); - const photolinxData = photolinxRes.data; - const $$$ = cheerio.load(photolinxData); - const access_token = $$$("#generate_url").attr("data-token"); - const uid = $$$("#generate_url").attr("data-uid"); - const body = { - type: "DOWNLOAD_GENERATE", - payload: { - access_token, - uid, - }, - }; - console.log("photolinxData", JSON.stringify(body)); - const photolinxRes2 = await fetch("https://photolinx.shop/action", { - headers: { - "sec-fetch-site": "same-origin", - "x-requested-with": "xmlhttprequest", - cookie: "PHPSESSID=9a8d855c700cf0711831c04960c2e2b4", - Referer: "https://photolinx.shop/download/5mPkrBD0D2x", - "Referrer-Policy": "strict-origin-when-cross-origin", - }, - body: JSON.stringify(body), - method: "POST", - }); - const photolinxData2 = await photolinxRes2.json(); - console.log("photolinxData2", photolinxData2); - const dwUrl = photolinxData2?.download_url; - if (dwUrl) { - const streamLinks = [ - { - server: "Photolinx", - link: dwUrl, - type: "mkv", - }, - ]; - return streamLinks; - } - } - const res = await axios.get(url, { headers }); - const html = res.data; - const streamLinks = []; - let data = { download: "" }; +const getStream = function (_a) { + return __awaiter(this, arguments, void 0, function* ({ link: url, type, providerContext, }) { + var _b; + const { axios, cheerio } = providerContext; + const headers = { + "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-Site": "none", + "Sec-Fetch-User": "?1", + "Upgrade-Insecure-Requests": "1", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0", + }; try { - const key = html.match(/formData\.append\('key',\s*'(\d+)'\);/)?.[1] || ""; - console.log("key", key); - const formData = new FormData(); - formData.append("key", key); - const streamRes = await fetch(url, { - method: "POST", - headers: headers, - body: formData, - }); - data = await streamRes.json(); - } - catch (err) { - console.log("error in world4uGetStream", err); - } - // console.log('streamRes', streamRes); - let $ = cheerio.load(html); - // console.log('data', html); - const mediafireUrl = $('h1:contains("Download")').find("a").attr("href") || - $(".input.popsok").attr("href"); - console.log("mediafireUrl", mediafireUrl); - if (mediafireUrl) { - const directUrl = await axios.head(mediafireUrl); - const urlContentType = directUrl.headers["content-type"]; - console.log("mfcontentType", urlContentType); - if (urlContentType && urlContentType.includes("video")) { + if (type === "movie") { + const linkRes = yield axios.get(url, { headers }); + const linkData = linkRes.data; + const $ = cheerio.load(linkData); + url = $('strong:contains("INSTANT")').parent().attr("href") || url; + } + // fastilinks + if (url.includes("fastilinks")) { + const fastilinksRes = yield axios.get(url, { headers }); + const fastilinksData = fastilinksRes.data; + const $$ = cheerio.load(fastilinksData); + const fastilinksKey = $$('input[name="_csrf_token_645a83a41868941e4692aa31e7235f2"]').attr("value"); + console.log("fastilinksKey", fastilinksKey); + const fastilinksFormData = new FormData(); + fastilinksFormData.append("_csrf_token_645a83a41868941e4692aa31e7235f2", fastilinksKey || ""); + const fastilinksRes2 = yield fetch(url, { + method: "POST", + headers: headers, + body: fastilinksFormData, + }); + const fastilinksHtml = yield fastilinksRes2.text(); + // console.log('fastilinksHtml', fastilinksHtml); + const $$$ = cheerio.load(fastilinksHtml); + const fastilinksLink = $$$('a:contains("mediafire")').attr("href") || + $$$('a:contains("photolinx")').attr("href"); + console.log("fastilinksLink", fastilinksLink); + url = fastilinksLink || url; + } + console.log("world4uGetStream", type, url); + if (url.includes("photolinx")) { + console.log("photolinx", url); + // const photolinxBaseUrl = url.split('/').slice(0, 3).join('/'); + const photolinxRes = yield axios.get(url, { headers }); + const photolinxData = photolinxRes.data; + const $$$ = cheerio.load(photolinxData); + const access_token = $$$("#generate_url").attr("data-token"); + const uid = $$$("#generate_url").attr("data-uid"); + const body = { + type: "DOWNLOAD_GENERATE", + payload: { + access_token, + uid, + }, + }; + console.log("photolinxData", JSON.stringify(body)); + const photolinxRes2 = yield fetch("https://photolinx.shop/action", { + headers: { + "sec-fetch-site": "same-origin", + "x-requested-with": "xmlhttprequest", + cookie: "PHPSESSID=9a8d855c700cf0711831c04960c2e2b4", + Referer: "https://photolinx.shop/download/5mPkrBD0D2x", + "Referrer-Policy": "strict-origin-when-cross-origin", + }, + body: JSON.stringify(body), + method: "POST", + }); + const photolinxData2 = yield photolinxRes2.json(); + console.log("photolinxData2", photolinxData2); + const dwUrl = photolinxData2 === null || photolinxData2 === void 0 ? void 0 : photolinxData2.download_url; + if (dwUrl) { + const streamLinks = [ + { + server: "Photolinx", + link: dwUrl, + type: "mkv", + }, + ]; + return streamLinks; + } + } + const res = yield axios.get(url, { headers }); + const html = res.data; + const streamLinks = []; + let data = { download: "" }; + try { + const key = ((_b = html.match(/formData\.append\('key',\s*'(\d+)'\);/)) === null || _b === void 0 ? void 0 : _b[1]) || ""; + console.log("key", key); + const formData = new FormData(); + formData.append("key", key); + const streamRes = yield fetch(url, { + method: "POST", + headers: headers, + body: formData, + }); + data = yield streamRes.json(); + } + catch (err) { + console.log("error in world4uGetStream", err); + } + // console.log('streamRes', streamRes); + let $ = cheerio.load(html); + // console.log('data', html); + const mediafireUrl = $('h1:contains("Download")').find("a").attr("href") || + $(".input.popsok").attr("href"); + console.log("mediafireUrl", mediafireUrl); + if (mediafireUrl) { + const directUrl = yield axios.head(mediafireUrl); + const urlContentType = directUrl.headers["content-type"]; + console.log("mfcontentType", urlContentType); + if (urlContentType && urlContentType.includes("video")) { + streamLinks.push({ + server: "Mediafire", + link: mediafireUrl, + type: "mkv", + }); + return streamLinks; + } + else { + const repairRes = yield axios.get(mediafireUrl, { + headers: { + Referer: url, + }, + }); + const repairHtml = repairRes.data; + // Regex to match the window.location.href assignment in the script content + const hrefRegex = /window\.location\.href\s*=\s*['"]([^'"]+)['"]/; + const match = repairHtml.match(hrefRegex); + // If a match is found, return the URL; otherwise return null + let downloadLInk = match ? match[1] : null; + console.log("downloadLInk", downloadLInk); + if (downloadLInk) { + streamLinks.push({ + server: "Mediafire", + link: downloadLInk, + type: "mkv", + }); + } + return streamLinks; + } + } + const requireRepairRes = yield axios.head(data.download); + const contentType = requireRepairRes.headers["content-type"]; + console.log("contentType", contentType); + if (contentType && contentType.includes("video")) { streamLinks.push({ server: "Mediafire", - link: mediafireUrl, + link: data.download, type: "mkv", }); return streamLinks; } else { - const repairRes = await axios.get(mediafireUrl, { + const repairRes = yield axios.get(data.download, { headers: { Referer: url, }, }); const repairHtml = repairRes.data; - // Regex to match the window.location.href assignment in the script content - const hrefRegex = /window\.location\.href\s*=\s*['"]([^'"]+)['"]/; - const match = repairHtml.match(hrefRegex); - // If a match is found, return the URL; otherwise return null - let downloadLInk = match ? match[1] : null; - console.log("downloadLInk", downloadLInk); - if (downloadLInk) { + const $ = cheerio.load(repairHtml); + const repairLink = $("#continue-btn").attr("href"); + console.log("repairLink", "https://www.mediafire.com" + repairLink); + const repairRequireRepairRes = yield axios.get("https://www.mediafire.com" + repairLink); + const $$ = cheerio.load(repairRequireRepairRes.data); + const repairDownloadLink = $$(".input.popsok").attr("href"); + console.log("repairDownloadLink", repairDownloadLink); + if (repairDownloadLink) { streamLinks.push({ server: "Mediafire", - link: downloadLInk, + link: repairDownloadLink, type: "mkv", }); } - return streamLinks; } - } - const requireRepairRes = await axios.head(data.download); - const contentType = requireRepairRes.headers["content-type"]; - console.log("contentType", contentType); - if (contentType && contentType.includes("video")) { - streamLinks.push({ - server: "Mediafire", - link: data.download, - type: "mkv", - }); return streamLinks; } - else { - const repairRes = await axios.get(data.download, { - headers: { - Referer: url, - }, - }); - const repairHtml = repairRes.data; - const $ = cheerio.load(repairHtml); - const repairLink = $("#continue-btn").attr("href"); - console.log("repairLink", "https://www.mediafire.com" + repairLink); - const repairRequireRepairRes = await axios.get("https://www.mediafire.com" + repairLink); - const $$ = cheerio.load(repairRequireRepairRes.data); - const repairDownloadLink = $$(".input.popsok").attr("href"); - console.log("repairDownloadLink", repairDownloadLink); - if (repairDownloadLink) { - streamLinks.push({ - server: "Mediafire", - link: repairDownloadLink, - type: "mkv", - }); - } + catch (err) { + console.log(err); + return []; } - return streamLinks; - } - catch (err) { - console.log(err); - return []; - } + }); }; exports.getStream = getStream;