This commit is contained in:
himanshu8443
2025-07-11 19:17:23 +05:30
parent 6ca69cf93b
commit 13f71510d5
139 changed files with 139 additions and 10578 deletions

View File

@@ -1,14 +1 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.genres = exports.catalog = void 0;
exports.catalog = [
{
title: "Popular Movies",
filter: "/top/catalog/movie/top.json",
},
{
title: "Featured Movies",
filter: "/imdbRating/catalog/movie/imdbRating.json",
},
];
exports.genres = [];
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.genres=exports.catalog=void 0,exports.catalog=[{title:"Popular Movies",filter:"/top/catalog/movie/top.json"},{title:"Featured Movies",filter:"/imdbRating/catalog/movie/imdbRating.json"}],exports.genres=[];

View File

@@ -1,94 +1 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMeta = void 0;
const getMeta = function (_a) {
return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) {
var _b, _c, _d, _e, _f, _g, _h;
try {
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: (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: "",
type: "movie",
linkList: [],
};
}
});
};
exports.getMeta = getMeta;
"use strict";var __awaiter=this&&this.__awaiter||function(i,e,t,n){return new(t||(t=Promise))(function(o,l){function s(i){try{a(n.next(i))}catch(i){l(i)}}function d(i){try{a(n.throw(i))}catch(i){l(i)}}function a(i){var e;i.done?o(i.value):(e=i.value,e instanceof t?e:new t(function(i){i(e)})).then(s,d)}a((n=n.apply(i,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const getMeta=function(i){return __awaiter(this,arguments,void 0,function*({link:i,providerContext:e}){var t,n,o,l,s,d,a;try{const{getBaseUrl:u,axios:v}=e,r=(yield v.get(i)).data,c={title:"",synopsis:"",image:"",imdbId:(null===(t=null==r?void 0:r.meta)||void 0===t?void 0:t.imdb_id)||"",type:(null===(n=null==r?void 0:r.meta)||void 0===n?void 0:n.type)||"movie"},p=yield u("ridomovies");let m="";try{const i=(yield v.get(p+"/core/api/search?q="+c.imdbId)).data;if(m=null===(l=null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.items[0])||void 0===l?void 0:l.fullSlug,!m||"series"===(null==c?void 0:c.type))return{title:"",synopsis:"",image:"",imdbId:(null===(s=null==r?void 0:r.meta)||void 0===s?void 0:s.imdb_id)||"",type:(null==c?void 0:c.type)||"movie",linkList:[]}}catch(i){return{title:"",synopsis:"",image:"",imdbId:(null==c?void 0:c.imdbId)||"",type:(null==c?void 0:c.type)||"movie",linkList:[]}}const y=[];let f=[],g=new Map;if("series"===c.type){null===(a=null===(d=null==r?void 0:r.meta)||void 0===d?void 0:d.videos)||void 0===a||a.map(i=>{(null==i?void 0:i.season)<=0||(g.has(null==i?void 0:i.season)||g.set(null==i?void 0:i.season,[]),g.get(null==i?void 0:i.season).push({title:"Episode "+(null==i?void 0:i.episode),link:""}))});for(const[i,e]of g.entries())y.push({title:"Season "+i,directLinks:e})}else f.push({title:"Movie",link:i}),y.push({title:"Movie",directLinks:f});return Object.assign(Object.assign({},c),{linkList:y})}catch(i){return{title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]}}})};exports.getMeta=getMeta;

View File

@@ -1,79 +1 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSearchPosts = exports.getPosts = void 0;
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 [];
}
});
};
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 [];
}
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;
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,n,o){return new(n||(n=Promise))(function(i,s){function a(t){try{c(o.next(t))}catch(t){s(t)}}function r(t){try{c(o.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,r)}c((o=o.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSearchPosts=exports.getPosts=void 0;const getPosts=function(t){return __awaiter(this,arguments,void 0,function*({filter:t,signal:e,providerContext:n}){try{const o=[],i="https://cinemeta-catalogs.strem.io"+t,s=(yield n.axios.get(i,{headers:n.commonHeaders,signal:e})).data;return null==s||s.metas.map(t=>{const e=null==t?void 0:t.name,n=(null==t?void 0:t.imdb_id)||(null==t?void 0:t.id),i=null==t?void 0:t.type,s=null==t?void 0:t.poster;n&&o.push({title:e,link:`https://v3-cinemeta.strem.io/meta/${i}/${n}.json`,image:s})}),o}catch(t){return[]}})};exports.getPosts=getPosts;const getSearchPosts=function(t){return __awaiter(this,arguments,void 0,function*({searchQuery:t,page:e,signal:n,providerContext:o}){try{const{axios:i,commonHeaders:s}=o;if(e>1)return[];const a=[],r=`https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(t)}.json`,c=(yield i.get(r,{headers:s,signal:n})).data;return null==c||c.metas.map(t=>{const e=(null==t?void 0:t.name)||"",n=(null==t?void 0:t.imdb_id)||(null==t?void 0:t.id),o=null==t?void 0:t.poster,i=null==t?void 0:t.type;n&&a.push({title:e,link:`https://v3-cinemeta.strem.io/meta/${i}/${n}.json`,image:o})}),a}catch(t){return[]}})};exports.getSearchPosts=getSearchPosts;

View File

@@ -1,71 +1 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStream = void 0;
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);
const streamLinks = [];
// const path =
// streamData?.type === 'movie'
// ? `/${streamData?.slug}`
// : `/${streamData?.slug}/season-${streamData?.season}/episode-${streamData?.episode}`;
// const url = streamData?.baseUrl + path;
// console.log('all', url);
// 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 === 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 = 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 = 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();
if (!script) {
throw new Error("Unable to find script");
}
// console.log('rido script', script);
const srcUrl = unpackJavaScript(script.trim());
console.log("rido srcUrl", srcUrl);
streamLinks.push({
link: srcUrl,
server: "rido",
type: "m3u8",
headers: {
Referer: iframeUrl,
},
});
return streamLinks;
}
catch (e) {
console.log("rido get stream err", e);
return [];
}
});
exports.getStream = getStream;
function unpackJavaScript(packedCode) {
const encodedString = packedCode.split("|aHR")[1].split("|")[0];
const base64Url = "aHR" + encodedString;
function addPadding(base64) {
return base64 + "=".repeat((4 - (base64.length % 4)) % 4);
}
console.log("rido base64Url", base64Url);
const unpackedCode = atob(addPadding(base64Url));
return unpackedCode;
}
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,r,a){return new(r||(r=Promise))(function(n,i){function o(t){try{c(a.next(t))}catch(t){i(t)}}function s(t){try{c(a.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(o,s)}c((a=a.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStream=void 0;const getStream=t=>__awaiter(void 0,[t],void 0,function*({link:t,providerContext:e}){var r,a;try{const{cheerio:n,commonHeaders:i,axios:o}=e,s=JSON.parse(t),c=[],l=(null==s?void 0:s.baseUrl)+"/api/"+(null==s?void 0:s.slug),u=yield o.get(l,{headers:i}),d=(null===(a=null===(r=u.data.data)||void 0===r?void 0:r[0])||void 0===a?void 0:a.url).split('src="')[1].split('"')[0],p=yield o.get(d,{headers:Object.assign(Object.assign({},i),{Referer:null==s?void 0:s.baseUrl})}),v=n.load(p.data)('script:contains("eval")').html();if(!v)throw new Error("Unable to find script");const h=unpackJavaScript(v.trim());return c.push({link:h,server:"rido",type:"m3u8",headers:{Referer:d}}),c}catch(t){return[]}});function unpackJavaScript(t){const e=t.split("|aHR")[1].split("|")[0];var r;return atob((r="aHR"+e)+"=".repeat((4-r.length%4)%4))}exports.getStream=getStream;