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

View File

@@ -1,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;

View File

@@ -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;

View File

@@ -1,7 +1,17 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStream = void 0;
const getStream = async ({ link: data, providerContext, }) => {
const getStream = (_a) => __awaiter(void 0, [_a], void 0, function* ({ link: data, providerContext, }) {
var _b, _c;
try {
const { cheerio, commonHeaders: headers, axios } = providerContext;
const streamData = JSON.parse(data);
@@ -15,18 +25,15 @@ const getStream = async ({ link: data, providerContext, }) => {
// const res = await axios.get(url, {headers});
// const postId = res.data.split('\\"postid\\":\\"')[1].split('\\"')[0];
// console.log('rido post id', postId);
const url = streamData?.baseUrl + "/api/" + streamData?.slug;
const url = (streamData === null || streamData === void 0 ? void 0 : streamData.baseUrl) + "/api/" + (streamData === null || streamData === void 0 ? void 0 : streamData.slug);
console.log("rido url", url);
const res = await axios.get(url, { headers });
const iframe = res.data.data?.[0]?.url;
const res = yield axios.get(url, { headers });
const iframe = (_c = (_b = res.data.data) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.url;
console.log("rido data", iframe);
const iframeUrl = iframe.split('src="')[1].split('"')[0];
console.log("rido iframeUrl", iframeUrl);
const iframeRes = await axios.get(iframeUrl, {
headers: {
...headers,
Referer: streamData?.baseUrl,
},
const iframeRes = yield axios.get(iframeUrl, {
headers: Object.assign(Object.assign({}, headers), { Referer: streamData === null || streamData === void 0 ? void 0 : streamData.baseUrl }),
});
const $ = cheerio.load(iframeRes.data);
const script = $('script:contains("eval")').html();
@@ -50,7 +57,7 @@ const getStream = async ({ link: data, providerContext, }) => {
console.log("rido get stream err", e);
return [];
}
};
});
exports.getStream = getStream;
function unpackJavaScript(packedCode) {
const encodedString = packedCode.split("|aHR")[1].split("|")[0];