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

@@ -0,0 +1,16 @@
export const catalog = [
{
title: "Movies",
filter: "MOVIES",
},
{
title: "TV Shows",
filter: "SERIES",
},
{
title: "Anime",
filter: "ANIME",
},
];
export const genres = [];

View File

@@ -1,14 +0,0 @@
import {ringzGetPosts, ringzGetPostsSearch} from './ringzGetPosts';
import {ringzGetInfo} from './ringzGetMeta';
import {ringzGenresList, ringzCatalogList} from './ringzCatalog';
import {ProviderType} from '../types';
import {ringzGetStream} from './ringzGetStream';
export const ringz: ProviderType = {
catalog: ringzCatalogList,
genres: ringzGenresList,
GetMetaData: ringzGetInfo,
GetHomePosts: ringzGetPosts,
GetStream: ringzGetStream,
GetSearchPosts: ringzGetPostsSearch,
};

87
providers/ringz/meta.ts Normal file
View File

@@ -0,0 +1,87 @@
import { Info, Link, ProviderContext } from "../types";
export const getMeta = async function ({
link: data,
}: {
link: string;
providerContext: ProviderContext;
}): Promise<Info> {
try {
const dataJson = JSON.parse(data);
const title = dataJson?.kn || dataJson?.mn;
const image = dataJson?.IH || dataJson?.IV;
const tags = dataJson?.gn
.split(",")
.slice(0, 3)
.map((tag: string) => tag.trim());
const type = dataJson?.cg === "webSeries" ? "series" : "movie";
const linkList: Link[] = [];
if (dataJson?.cg === "webSeries") {
["1", "2", "3", "4"]?.forEach((item) => {
const directLinks: Link["directLinks"] = [];
if (
typeof dataJson?.["eServer" + item] === "object" &&
Object?.keys(dataJson?.["eServer" + item])?.length > 0
) {
Object.keys(dataJson?.["eServer" + item]).forEach((key) => {
directLinks.push({
title: "Episode " + key,
link: JSON.stringify({
url: dataJson?.["eServer" + item][key],
server: "Server " + item,
}),
});
});
linkList.push({
title: dataJson?.pn + " (Server " + item + ")",
directLinks,
});
}
});
} else {
const directLinks: Link["directLinks"] = [];
["1", "2", "3", "4"]?.forEach((item) => {
if (dataJson?.["s" + item]) {
directLinks.push({
title: "Server " + item + " (HD)",
link: JSON.stringify({
url: dataJson?.s1,
server: "Server " + item,
}),
});
}
if (dataJson?.["4s" + item]) {
directLinks.push({
title: "Server " + item + " (480p)",
link: JSON.stringify({
url: dataJson?.["4s" + item],
server: "Server " + item,
}),
});
}
});
linkList.push({
title: dataJson?.pn,
directLinks,
});
}
return {
title,
image,
imdbId: "",
synopsis: "",
type,
linkList,
tags,
};
} catch (err) {
return {
title: "",
image: "",
imdbId: "",
synopsis: "",
type: "movie",
linkList: [],
tags: [],
};
}
};

View File

@@ -1,6 +1,6 @@
import {Post, ProviderContext} from '../types';
import { Post, ProviderContext } from "../types";
export const ringzGetPosts = async function ({
export const getPosts = async function ({
filter,
signal,
providerContext,
@@ -11,10 +11,10 @@ export const ringzGetPosts = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
return posts({filter, signal, providerContext});
return posts({ filter, signal, providerContext });
};
export const ringzGetPostsSearch = async function ({
export const getSearchPosts = async function ({
searchQuery,
page, // providerContext,
}: {
@@ -57,28 +57,28 @@ export const ringzGetPostsSearch = async function ({
});
return catalog;
} catch (err) {
console.error('ringz error ', err);
console.error("ringz error ", err);
return [];
}
};
async function posts({
filter, // signal,
// providerContext,
}: {
}: // providerContext,
{
filter: string;
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
try {
let response;
if (filter === 'MOVIES') {
if (filter === "MOVIES") {
response = getRingzMovies();
}
if (filter === 'SERIES') {
if (filter === "SERIES") {
response = getRingzShows();
}
if (filter === 'ANIME') {
if (filter === "ANIME") {
response = getRingzAnime();
}
const data = await response;
@@ -97,18 +97,18 @@ async function posts({
});
return catalog;
} catch (err) {
console.error('ringz error ', err);
console.error("ringz error ", err);
return [];
}
}
export const headers = {
'cf-access-client-id': '833049b087acf6e787cedfd85d1ccdb8.access',
'cf-access-client-secret':
'02db296a961d7513c3102d7785df4113eff036b2d57d060ffcc2ba3ba820c6aa',
"cf-access-client-id": "833049b087acf6e787cedfd85d1ccdb8.access",
"cf-access-client-secret":
"02db296a961d7513c3102d7785df4113eff036b2d57d060ffcc2ba3ba820c6aa",
};
const BASE_URL = 'https://privatereporz.pages.dev';
const BASE_URL = "https://privatereporz.pages.dev";
export async function getRingzMovies() {
try {
const response = await fetch(`${BASE_URL}/test.json`, {

View File

@@ -1,16 +0,0 @@
export const ringzCatalogList = [
{
title: 'Movies',
filter: 'MOVIES',
},
{
title: 'TV Shows',
filter: 'SERIES',
},
{
title: 'Anime',
filter: 'ANIME',
},
];
export const ringzGenresList = [];

View File

@@ -1,87 +0,0 @@
import {Info, Link, ProviderContext} from '../types';
export const ringzGetInfo = async function ({
link: data,
}: {
link: string;
providerContext: ProviderContext;
}): Promise<Info> {
try {
const dataJson = JSON.parse(data);
const title = dataJson?.kn || dataJson?.mn;
const image = dataJson?.IH || dataJson?.IV;
const tags = dataJson?.gn
.split(',')
.slice(0, 3)
.map((tag: string) => tag.trim());
const type = dataJson?.cg === 'webSeries' ? 'series' : 'movie';
const linkList: Link[] = [];
if (dataJson?.cg === 'webSeries') {
['1', '2', '3', '4']?.forEach(item => {
const directLinks: Link['directLinks'] = [];
if (
typeof dataJson?.['eServer' + item] === 'object' &&
Object?.keys(dataJson?.['eServer' + item])?.length > 0
) {
Object.keys(dataJson?.['eServer' + item]).forEach(key => {
directLinks.push({
title: 'Episode ' + key,
link: JSON.stringify({
url: dataJson?.['eServer' + item][key],
server: 'Server ' + item,
}),
});
});
linkList.push({
title: dataJson?.pn + ' (Server ' + item + ')',
directLinks,
});
}
});
} else {
const directLinks: Link['directLinks'] = [];
['1', '2', '3', '4']?.forEach(item => {
if (dataJson?.['s' + item]) {
directLinks.push({
title: 'Server ' + item + ' (HD)',
link: JSON.stringify({
url: dataJson?.s1,
server: 'Server ' + item,
}),
});
}
if (dataJson?.['4s' + item]) {
directLinks.push({
title: 'Server ' + item + ' (480p)',
link: JSON.stringify({
url: dataJson?.['4s' + item],
server: 'Server ' + item,
}),
});
}
});
linkList.push({
title: dataJson?.pn,
directLinks,
});
}
return {
title,
image,
imdbId: '',
synopsis: '',
type,
linkList,
tags,
};
} catch (err) {
return {
title: '',
image: '',
imdbId: '',
synopsis: '',
type: 'movie',
linkList: [],
tags: [],
};
}
};

View File

@@ -1,6 +1,6 @@
import {Stream, ProviderContext} from '../types';
import { Stream, ProviderContext } from "../types";
export const ringzGetStream = async function ({
export const getStream = async function ({
link: data,
}: {
link: string;
@@ -11,7 +11,7 @@ export const ringzGetStream = async function ({
streamLinks.push({
link: dataJson.url,
server: dataJson.server,
type: 'mkv',
type: "mkv",
});
return streamLinks;
};