This commit is contained in:
himanshu8443
2025-06-16 22:26:38 +05:30
parent 3f3e12f5df
commit 2a4aa2a680
185 changed files with 4645 additions and 3952 deletions

View File

@@ -1,20 +0,0 @@
export const allCatalog = [
{
title: 'Popular Movies',
filter: '/top/catalog/movie/top.json',
},
{
title: 'Popular TV Shows',
filter: '/top/catalog/series/top.json',
},
{
title: 'Featured Movies',
filter: '/imdbRating/catalog/movie/imdbRating.json',
},
{
title: 'Featured TV Shows',
filter: '/imdbRating/catalog/series/imdbRating.json',
},
];
export const allGenresList = [];

View File

@@ -0,0 +1,20 @@
export const catalog = [
{
title: "Popular Movies",
filter: "/top/catalog/movie/top.json",
},
{
title: "Popular TV Shows",
filter: "/top/catalog/series/top.json",
},
{
title: "Featured Movies",
filter: "/imdbRating/catalog/movie/imdbRating.json",
},
{
title: "Featured TV Shows",
filter: "/imdbRating/catalog/series/imdbRating.json",
},
];
export const genres = [];

View File

@@ -1,14 +0,0 @@
import {allCatalog, allGenresList} from './allCatalog';
import {allGetInfo} from './allGetInfo';
import {allGetStream} from './allGetStream';
import {allGetPost, allGetSearchPosts} from './allGetPost';
import {ProviderType} from '../../Manifest';
export const autoEmbed: ProviderType = {
catalog: allCatalog,
genres: allGenresList,
GetMetaData: allGetInfo,
GetHomePosts: allGetPost,
GetStream: allGetStream,
GetSearchPosts: allGetSearchPosts,
};

View File

@@ -1,6 +1,6 @@
import {EpisodeLink, Info, Link, ProviderContext} from '../types';
import { EpisodeLink, Info, Link, ProviderContext } from "../types";
export const allGetInfo = async function ({
export const getMeta = async function ({
link,
providerContext,
}: {
@@ -9,43 +9,43 @@ export const allGetInfo = async function ({
}): Promise<Info> {
const axios = providerContext.axios;
try {
console.log('all', link);
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',
title: "",
synopsis: "",
image: "",
imdbId: data?.meta?.imdb_id || "",
type: data?.meta?.type || "movie",
};
const links: Link[] = [];
let directLinks: EpisodeLink[] = [];
let season = new Map();
if (meta.type === 'series') {
if (meta.type === "series") {
data?.meta?.videos?.map((video: any) => {
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',
title: "Episode " + video?.episode,
type: "series",
link: JSON.stringify({
title: data?.meta?.name as string,
imdbId: data?.meta?.imdb_id,
season: video?.id?.split(':')[1],
episode: video?.id?.split(':')[2],
season: video?.id?.split(":")[1],
episode: video?.id?.split(":")[2],
type: data?.meta?.type,
tmdbId: data?.meta?.moviedb_id?.toString() || '',
tmdbId: data?.meta?.moviedb_id?.toString() || "",
year: data?.meta?.year,
}),
});
});
const keys = Array.from(season.keys());
keys.sort();
keys.map(key => {
keys.map((key) => {
directLinks = season.get(key);
links.push({
title: `Season ${key}`,
@@ -53,20 +53,20 @@ export const allGetInfo = async function ({
});
});
} else {
console.log('all meta Mv🔥🔥', meta);
console.log("all meta Mv🔥🔥", meta);
links.push({
title: data?.meta?.name as string,
directLinks: [
{
title: 'Movie',
type: 'movie',
title: "Movie",
type: "movie",
link: JSON.stringify({
title: data?.meta?.name as string,
imdbId: data?.meta?.imdb_id,
season: '',
episode: '',
season: "",
episode: "",
type: data?.meta?.type,
tmdbId: data?.meta?.moviedb_id?.toString() || '',
tmdbId: data?.meta?.moviedb_id?.toString() || "",
year: data?.meta?.year,
}),
},
@@ -80,11 +80,11 @@ export const allGetInfo = async function ({
} catch (err) {
console.error(err);
return {
title: '',
synopsis: '',
image: '',
imdbId: '',
type: 'movie',
title: "",
synopsis: "",
image: "",
imdbId: "",
type: "movie",
linkList: [],
};
}

View File

@@ -1,6 +1,6 @@
import {Post, ProviderContext} from '../types';
import { Post, ProviderContext } from "../types";
export const allGetPost = async function ({
export const getPosts = async function ({
filter,
signal,
providerContext,
@@ -13,8 +13,8 @@ export const allGetPost = async function ({
}): Promise<Post[]> {
try {
const catalog: Post[] = [];
const url = 'https://cinemeta-catalogs.strem.io' + filter;
console.log('allGetPostUrl', url);
const url = "https://cinemeta-catalogs.strem.io" + filter;
console.log("allGetPostUrl", url);
const res = await providerContext.axios.get(url, {
headers: providerContext.commonHeaders,
signal,
@@ -33,15 +33,15 @@ export const allGetPost = async function ({
});
}
});
console.log('catalog', catalog.length);
console.log("catalog", catalog.length);
return catalog;
} catch (err) {
console.error('AutoEmbed error ', err);
console.error("AutoEmbed error ", err);
return [];
}
};
export const allGetSearchPosts = async function ({
export const getSearchPosts = async function ({
searchQuery,
page,
// providerValue,
@@ -60,10 +60,10 @@ export const allGetSearchPosts = async function ({
}
const catalog: Post[] = [];
const url1 = `https://v3-cinemeta.strem.io/catalog/series/top/search=${encodeURI(
searchQuery,
searchQuery
)}.json`;
const url2 = `https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(
searchQuery,
searchQuery
)}.json`;
const res = await providerContext.axios.get(url1, {
headers: providerContext.commonHeaders,
@@ -71,7 +71,7 @@ export const allGetSearchPosts = async function ({
});
const data = res.data;
data?.metas.map((result: any) => {
const title = result.name || '';
const title = result.name || "";
const id = result?.imdb_id || result?.id;
const image = result?.poster;
const type = result?.type;
@@ -89,7 +89,7 @@ export const allGetSearchPosts = async function ({
});
const data2 = res2.data;
data2?.metas.map((result: any) => {
const title = result?.name || '';
const title = result?.name || "";
const id = result?.imdb_id || result?.id;
const image = result?.poster;
const type = result?.type;
@@ -103,7 +103,7 @@ export const allGetSearchPosts = async function ({
});
return catalog;
} catch (err) {
console.error('AutoEmbed error ', err);
console.error("AutoEmbed error ", err);
return [];
}
};

View File

@@ -1,6 +1,6 @@
import {Stream, ProviderContext, TextTrackType, TextTracks} from '../types';
import { Stream, ProviderContext, TextTrackType, TextTracks } from "../types";
export const allGetStream = async ({
export const getStream = async ({
link: id,
type,
providerContext,
@@ -11,14 +11,14 @@ export const allGetStream = async ({
}): Promise<Stream[]> => {
try {
const streams: Stream[] = [];
const {imdbId, season, episode, title, tmdbId, year} = JSON.parse(id);
const { imdbId, season, episode, title, tmdbId, year } = JSON.parse(id);
await getRiveStream(
tmdbId,
episode,
season,
type,
streams,
providerContext,
providerContext
);
return streams;
} catch (err) {
@@ -33,47 +33,47 @@ export async function getRiveStream(
season: string,
type: string,
Streams: Stream[],
providerContext: ProviderContext,
providerContext: 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',
"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 baseUrl = await providerContext.getBaseUrl("rive");
const cors = process.env.CORS_PRXY ? process.env.CORS_PRXY + "?url=" : "";
console.log("CORS: " + cors);
const route =
type === 'series'
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);
servers.map(async (server) => {
console.log("Rive: " + url + server);
try {
const res = await providerContext.axios.get(url + server, {
timeout: 4000,
@@ -83,10 +83,10 @@ export async function getRiveStream(
if (res.data?.data?.captions) {
res.data?.data?.captions.forEach((sub: any) => {
subtitles.push({
language: sub?.label?.slice(0, 2) || 'Und',
language: sub?.label?.slice(0, 2) || "Und",
uri: sub?.file,
title: sub?.label || 'Undefined',
type: sub?.file?.endsWith('.vtt')
title: sub?.label || "Undefined",
type: sub?.file?.endsWith(".vtt")
? TextTrackType.VTT
: TextTrackType.SUBRIP,
});
@@ -94,9 +94,9 @@ export async function getRiveStream(
}
res.data?.data?.sources.forEach((source: any) => {
Streams.push({
server: source?.source + '-' + source?.quality,
server: source?.source + "-" + source?.quality,
link: source?.url,
type: source?.format === 'hls' ? 'm3u8' : 'mp4',
type: source?.format === "hls" ? "m3u8" : "mp4",
quality: source?.quality,
subtitles: subtitles,
});
@@ -104,78 +104,78 @@ export async function getRiveStream(
} catch (e) {
console.log(e);
}
}),
})
);
}
function generateSecretKey(id: number | string) {
// Array of secret key fragments - updated array from the new implementation
const c = [
'Yhv40uKAZa',
'nn8YU4yBA',
'uNeH',
'ehK',
'jT0',
'n5G',
'99R',
'MvB1M',
'DQtPCh',
'GBRjk4k4I',
'CzIOoa95UT',
'BLE8s',
'GDZlc7',
'Fz45T',
'JW6lWn',
'DE3g4uw0i',
'18KxmYizv',
'8ji',
'JUDdNMnZ',
'oGpBippPgm',
'7De8Pg',
'Zv6',
'VHT9TVN',
'bYH6m',
'aK1',
'WcWH6jU',
'Q47YEMi4k',
'vRD3A',
'CGOsfJO',
'BLn8',
'RgK0drv7l',
'oPTfGCn3a',
'MkpMDkttW9',
'VNI1fPM',
'XNFi6',
'6cq',
'4LvTksXoEI',
'1rRa2KOZB0',
'zoOGRb8HT2',
'mhcXDtvz',
'NUmexFY2Ur',
'6BIMdvSZ',
'Tr0zU2vjRd',
'QPR',
'fhOqJR',
'R9VnFY',
'xkZ99D6S',
'umY7E',
'5Ds8qyDq',
'Cc6jy09y3',
'yvU3iR',
'Bg07zY',
'GccECglg',
'VYd',
'6vOiXqz',
'7xX',
'UdRrbEzF',
'fE6wc',
'BUd25Rb',
'lxq5Zum89o',
"Yhv40uKAZa",
"nn8YU4yBA",
"uNeH",
"ehK",
"jT0",
"n5G",
"99R",
"MvB1M",
"DQtPCh",
"GBRjk4k4I",
"CzIOoa95UT",
"BLE8s",
"GDZlc7",
"Fz45T",
"JW6lWn",
"DE3g4uw0i",
"18KxmYizv",
"8ji",
"JUDdNMnZ",
"oGpBippPgm",
"7De8Pg",
"Zv6",
"VHT9TVN",
"bYH6m",
"aK1",
"WcWH6jU",
"Q47YEMi4k",
"vRD3A",
"CGOsfJO",
"BLn8",
"RgK0drv7l",
"oPTfGCn3a",
"MkpMDkttW9",
"VNI1fPM",
"XNFi6",
"6cq",
"4LvTksXoEI",
"1rRa2KOZB0",
"zoOGRb8HT2",
"mhcXDtvz",
"NUmexFY2Ur",
"6BIMdvSZ",
"Tr0zU2vjRd",
"QPR",
"fhOqJR",
"R9VnFY",
"xkZ99D6S",
"umY7E",
"5Ds8qyDq",
"Cc6jy09y3",
"yvU3iR",
"Bg07zY",
"GccECglg",
"VYd",
"6vOiXqz",
"7xX",
"UdRrbEzF",
"fE6wc",
"BUd25Rb",
"lxq5Zum89o",
];
// Handle undefined input
if (id === undefined) {
return 'rive';
return "rive";
}
try {
@@ -195,7 +195,7 @@ function generateSecretKey(id: number | string) {
}
hash ^= hash >>> 13;
hash = (1540483477 * hash) >>> 0;
return (hash ^= hash >>> 15).toString(16).padStart(8, '0');
return (hash ^= hash >>> 15).toString(16).padStart(8, "0");
};
// Updated MurmurHash-like function to match the new implementation
@@ -214,7 +214,7 @@ function generateSecretKey(id: number | string) {
hash = (2246822507 * hash) >>> 0;
hash ^= hash >>> 13;
hash = (3266489909 * hash) >>> 0;
return (hash ^= hash >>> 16).toString(16).padStart(8, '0');
return (hash ^= hash >>> 16).toString(16).padStart(8, "0");
};
/* eslint-enable no-bitwise */
@@ -225,7 +225,7 @@ function generateSecretKey(id: number | string) {
if (isNaN(Number(id))) {
// For non-numeric inputs, sum the character codes
const charSum = idStr
.split('')
.split("")
.reduce((sum, char) => sum + char.charCodeAt(0), 0);
// Select array element or fallback to base64 encoded input
fragment = c[charSum % c.length] || btoa(idStr);
@@ -245,6 +245,6 @@ function generateSecretKey(id: number | string) {
);
} catch (error) {
// Return fallback value if any errors occur
return 'topSecret';
return "topSecret";
}
}