mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
minify again
This commit is contained in:
15
dist/ridoMovies/catalog.js
vendored
15
dist/ridoMovies/catalog.js
vendored
@@ -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=[];
|
||||
95
dist/ridoMovies/meta.js
vendored
95
dist/ridoMovies/meta.js
vendored
@@ -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(thisArg,_arguments,P,generator){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){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const getMeta=function(_a){return __awaiter(this,arguments,void 0,function*({link:link,providerContext:providerContext}){var _b,_c,_d,_e,_f,_g,_h;try{const{getBaseUrl:getBaseUrl,axios:axios}=providerContext,data=(yield axios.get(link)).data,meta={title:"",synopsis:"",image:"",imdbId:(null===(_b=null==data?void 0:data.meta)||void 0===_b?void 0:_b.imdb_id)||"",type:(null===(_c=null==data?void 0:data.meta)||void 0===_c?void 0:_c.type)||"movie"},baseUrl=yield getBaseUrl("ridomovies");let slug="";try{const data2=(yield axios.get(baseUrl+"/core/api/search?q="+meta.imdbId)).data;if(slug=null===(_e=null===(_d=null==data2?void 0:data2.data)||void 0===_d?void 0:_d.items[0])||void 0===_e?void 0:_e.fullSlug,!slug||"series"===(null==meta?void 0:meta.type))return{title:"",synopsis:"",image:"",imdbId:(null===(_f=null==data?void 0:data.meta)||void 0===_f?void 0:_f.imdb_id)||"",type:(null==meta?void 0:meta.type)||"movie",linkList:[]}}catch(err){return{title:"",synopsis:"",image:"",imdbId:(null==meta?void 0:meta.imdbId)||"",type:(null==meta?void 0:meta.type)||"movie",linkList:[]}}const links=[];let directLinks=[],season=new Map;if("series"===meta.type){null===(_h=null===(_g=null==data?void 0:data.meta)||void 0===_g?void 0:_g.videos)||void 0===_h||_h.map(video=>{(null==video?void 0:video.season)<=0||(season.has(null==video?void 0:video.season)||season.set(null==video?void 0:video.season,[]),season.get(null==video?void 0:video.season).push({title:"Episode "+(null==video?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;
|
||||
80
dist/ridoMovies/posts.js
vendored
80
dist/ridoMovies/posts.js
vendored
@@ -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(thisArg,_arguments,P,generator){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){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSearchPosts=exports.getPosts=void 0;const getPosts=function(_a){return __awaiter(this,arguments,void 0,function*({filter:filter,signal:signal,providerContext:providerContext}){try{const catalog=[],url="https://cinemeta-catalogs.strem.io"+filter,data=(yield providerContext.axios.get(url,{headers:providerContext.commonHeaders,signal:signal})).data;return null==data||data.metas.map(result=>{const title=null==result?void 0:result.name,id=(null==result?void 0:result.imdb_id)||(null==result?void 0:result.id),type=null==result?void 0:result.type,image=null==result?void 0:result.poster;id&&catalog.push({title:title,link:`https://v3-cinemeta.strem.io/meta/${type}/${id}.json`,image:image})}),catalog}catch(err){return[]}})};exports.getPosts=getPosts;const getSearchPosts=function(_a){return __awaiter(this,arguments,void 0,function*({searchQuery:searchQuery,page:page,signal:signal,providerContext:providerContext}){try{const{axios:axios,commonHeaders:headers}=providerContext;if(page>1)return[];const catalog=[],url2=`https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(searchQuery)}.json`,data2=(yield axios.get(url2,{headers:headers,signal:signal})).data;return null==data2||data2.metas.map(result=>{const title=(null==result?void 0:result.name)||"",id=(null==result?void 0:result.imdb_id)||(null==result?void 0:result.id),image=null==result?void 0:result.poster,type=null==result?void 0:result.type;id&&catalog.push({title:title,link:`https://v3-cinemeta.strem.io/meta/${type}/${id}.json`,image:image})}),catalog}catch(err){return[]}})};exports.getSearchPosts=getSearchPosts;
|
||||
72
dist/ridoMovies/stream.js
vendored
72
dist/ridoMovies/stream.js
vendored
@@ -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(thisArg,_arguments,P,generator){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){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStream=void 0;const getStream=_a=>__awaiter(void 0,[_a],void 0,function*({link:data,providerContext:providerContext}){var _b,_c;try{const{cheerio:cheerio,commonHeaders:headers,axios:axios}=providerContext,streamData=JSON.parse(data),streamLinks=[],url=(null==streamData?void 0:streamData.baseUrl)+"/api/"+(null==streamData?void 0:streamData.slug),res=yield axios.get(url,{headers:headers}),iframeUrl=(null===(_c=null===(_b=res.data.data)||void 0===_b?void 0:_b[0])||void 0===_c?void 0:_c.url).split('src="')[1].split('"')[0],iframeRes=yield axios.get(iframeUrl,{headers:Object.assign(Object.assign({},headers),{Referer:null==streamData?void 0:streamData.baseUrl})}),script=cheerio.load(iframeRes.data)('script:contains("eval")').html();if(!script)throw new Error("Unable to find script");const srcUrl=unpackJavaScript(script.trim());return streamLinks.push({link:srcUrl,server:"rido",type:"m3u8",headers:{Referer:iframeUrl}}),streamLinks}catch(e){return[]}});function unpackJavaScript(packedCode){const encodedString=packedCode.split("|aHR")[1].split("|")[0];var base64;return atob((base64="aHR"+encodedString)+"=".repeat((4-base64.length%4)%4))}exports.getStream=getStream;
|
||||
Reference in New Issue
Block a user