mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
build
This commit is contained in:
14
dist/ridoMovies/catalog.js
vendored
14
dist/ridoMovies/catalog.js
vendored
@@ -1,14 +0,0 @@
|
||||
"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 = [];
|
||||
16
dist/ridoMovies/index.js
vendored
16
dist/ridoMovies/index.js
vendored
@@ -1,16 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ridoMovies = void 0;
|
||||
const guardahdCatalog_1 = require("../guardahd/guardahdCatalog");
|
||||
const allGetPost_1 = require("../autoEmbed/allGetPost");
|
||||
const guardahdGetPosts_1 = require("../guardahd/guardahdGetPosts");
|
||||
const ridoGetMeta_1 = require("./ridoGetMeta");
|
||||
const ridoGetSream_1 = require("./ridoGetSream");
|
||||
exports.ridoMovies = {
|
||||
catalog: guardahdCatalog_1.guardahdCatalog,
|
||||
genres: guardahdCatalog_1.guardahdGenresList,
|
||||
GetMetaData: ridoGetMeta_1.ridoGetInfo,
|
||||
GetHomePosts: allGetPost_1.allGetPost,
|
||||
GetStream: ridoGetSream_1.ridoGetStream,
|
||||
GetSearchPosts: guardahdGetPosts_1.guardahdGetSearchPosts,
|
||||
};
|
||||
85
dist/ridoMovies/meta.js
vendored
85
dist/ridoMovies/meta.js
vendored
@@ -1,85 +0,0 @@
|
||||
"use strict";
|
||||
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 = "";
|
||||
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") {
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: data?.meta?.imdb_id || "",
|
||||
type: meta?.type || "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: meta?.imdbId || "",
|
||||
type: meta?.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;
|
||||
66
dist/ridoMovies/posts.js
vendored
66
dist/ridoMovies/posts.js
vendored
@@ -1,66 +0,0 @@
|
||||
"use strict";
|
||||
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) {
|
||||
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,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("AutoEmbed error ", err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
85
dist/ridoMovies/ridoGetMeta.js
vendored
85
dist/ridoMovies/ridoGetMeta.js
vendored
@@ -1,85 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ridoGetInfo = void 0;
|
||||
const ridoGetInfo = 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 = '';
|
||||
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') {
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: data?.meta?.imdb_id || '',
|
||||
type: meta?.type || 'movie',
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: meta?.imdbId || '',
|
||||
type: meta?.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.ridoGetInfo = ridoGetInfo;
|
||||
64
dist/ridoMovies/ridoGetSream.js
vendored
64
dist/ridoMovies/ridoGetSream.js
vendored
@@ -1,64 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ridoGetStream = void 0;
|
||||
const ridoGetStream = async ({ link: data, providerContext, }) => {
|
||||
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?.baseUrl + '/api/' + streamData?.slug;
|
||||
console.log('rido url', url);
|
||||
const res = await axios.get(url, { headers });
|
||||
const iframe = res.data.data?.[0]?.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 $ = 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.ridoGetStream = ridoGetStream;
|
||||
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;
|
||||
}
|
||||
64
dist/ridoMovies/stream.js
vendored
64
dist/ridoMovies/stream.js
vendored
@@ -1,64 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
const getStream = async ({ link: data, providerContext, }) => {
|
||||
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?.baseUrl + "/api/" + streamData?.slug;
|
||||
console.log("rido url", url);
|
||||
const res = await axios.get(url, { headers });
|
||||
const iframe = res.data.data?.[0]?.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 $ = 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;
|
||||
}
|
||||
Reference in New Issue
Block a user