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: "Trending",
filter: "/trending",
},
{
title: "Movies",
filter: "/recent-movies",
},
{
title: "TV Shows",
filter: "/recent-shows",
},
];
export const genres = [];

View File

@@ -1,16 +0,0 @@
export const flixhqCatalog = [
{
title: 'Trending',
filter: '/trending',
},
{
title: 'Movies',
filter: '/recent-movies',
},
{
title: 'TV Shows',
filter: '/recent-shows',
},
];
export const flixhqGenresList = [];

View File

@@ -1,25 +0,0 @@
import {ProviderType} from '../types';
import {flixhqCatalog, flixhqGenresList} from './flixhqCatalog';
import {flixhqGetInfo} from './flixhqGetInfo';
import {flixhqGetPosts, flixhqGetSearchPost} from './flixhqGetPosts';
import {flixhqGetStream} from './flixhqGetStream';
export const flixhq: ProviderType = {
catalog: flixhqCatalog,
genres: flixhqGenresList,
GetMetaData: flixhqGetInfo,
GetHomePosts: flixhqGetPosts,
GetStream: flixhqGetStream,
GetSearchPosts: flixhqGetSearchPost,
nonDownloadableServer: ['upcloud-MultiQuality', 'vidcloud-MultiQuality'],
nonStreamableServer: [
'upcloud-1080',
'upcloud-720',
'upcloud-480',
'upcloud-360',
'vidcloud-1080',
'vidcloud-720',
'vidcloud-480',
'vidcloud-360',
],
};

View File

@@ -1,6 +1,6 @@
import {Info, Link, ProviderContext} from '../types';
import { Info, Link, ProviderContext } from "../types";
export const flixhqGetInfo = async function ({
export const getMeta = async function ({
link: id,
providerContext,
}: {
@@ -8,28 +8,28 @@ export const flixhqGetInfo = async function ({
providerContext: ProviderContext;
}): Promise<Info> {
try {
const {axios, getBaseUrl} = providerContext;
const baseUrl = await getBaseUrl('consumet');
const { axios, getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl("consumet");
const url = `${baseUrl}/movies/flixhq/info?id=` + id;
const res = await axios.get(url);
const data = res.data;
const meta = {
title: data.title,
synopsis: data.description.replace(/<[^>]*>?/gm, '').trim(),
synopsis: data.description.replace(/<[^>]*>?/gm, "").trim(),
image: data.cover,
cast: data.casts,
rating: data.rating,
tags: [data?.type, data?.duration, data.releaseDate.split('-')[0]],
imdbId: '',
type: data.episodes.length > 1 ? 'series' : 'movie',
tags: [data?.type, data?.duration, data.releaseDate.split("-")[0]],
imdbId: "",
type: data.episodes.length > 1 ? "series" : "movie",
};
const links: Link['directLinks'] = [];
const links: Link["directLinks"] = [];
data.episodes.forEach((episode: any) => {
const title = episode?.number
? 'Season-' + episode?.season + ' Ep-' + episode.number
? "Season-" + episode?.season + " Ep-" + episode.number
: episode.title;
const link = episode.id + '*' + data.id;
const link = episode.id + "*" + data.id;
if (link && title) {
links.push({
title,
@@ -50,11 +50,11 @@ export const flixhqGetInfo = 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 flixhqGetPosts = async function ({
export const getPosts = async function ({
filter,
signal,
providerContext,
@@ -11,14 +11,14 @@ export const flixhqGetPosts = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const {getBaseUrl} = providerContext;
const urlRes = await getBaseUrl('consumet');
const baseUrl = urlRes + '/movies/flixhq';
const { getBaseUrl } = providerContext;
const urlRes = await getBaseUrl("consumet");
const baseUrl = urlRes + "/movies/flixhq";
const url = `${baseUrl + filter}`;
return posts({url, signal, providerContext});
return posts({ url, signal, providerContext });
};
export const flixhqGetSearchPost = async function ({
export const getSearchPosts = async function ({
searchQuery,
page,
signal,
@@ -30,11 +30,11 @@ export const flixhqGetSearchPost = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const {getBaseUrl} = providerContext;
const urlRes = await getBaseUrl('consumet');
const baseUrl = urlRes + '/movies/flixhq';
const { getBaseUrl } = providerContext;
const urlRes = await getBaseUrl("consumet");
const baseUrl = urlRes + "/movies/flixhq";
const url = `${baseUrl}/${searchQuery}?page=${page}`;
return posts({url, signal, providerContext});
return posts({ url, signal, providerContext });
};
async function posts({
@@ -47,8 +47,8 @@ async function posts({
providerContext: ProviderContext;
}): Promise<Post[]> {
try {
const {axios} = providerContext;
const res = await axios.get(url, {signal});
const { axios } = providerContext;
const res = await axios.get(url, { signal });
const data = res.data?.results || res.data;
const catalog: Post[] = [];
data?.map((element: any) => {
@@ -65,7 +65,7 @@ async function posts({
});
return catalog;
} catch (err) {
console.error('flixhq error ', err);
console.error("flixhq error ", err);
return [];
}
}

View File

@@ -1,6 +1,6 @@
import {ProviderContext, Stream, TextTrackType} from '../types';
import { ProviderContext, Stream, TextTrackType } from "../types";
export const flixhqGetStream = async function ({
export const getStream = async function ({
link: id,
providerContext,
}: {
@@ -8,10 +8,10 @@ export const flixhqGetStream = async function ({
providerContext: ProviderContext;
}): Promise<Stream[]> {
try {
const {getBaseUrl} = providerContext;
const episodeId = id.split('*')[0];
const mediaId = id.split('*')[1];
const baseUrl = await getBaseUrl('consumet');
const { getBaseUrl } = providerContext;
const episodeId = id.split("*")[0];
const mediaId = id.split("*")[1];
const baseUrl = await getBaseUrl("consumet");
const serverUrl = `${baseUrl}/movies/flixhq/servers?episodeId=${episodeId}&mediaId=${mediaId}`;
const res = await fetch(serverUrl);
const servers = await res.json();
@@ -20,16 +20,16 @@ export const flixhqGetStream = async function ({
const streamUrl =
`${baseUrl}/movies/flixhq/watch?server=` +
server.name +
'&episodeId=' +
"&episodeId=" +
episodeId +
'&mediaId=' +
"&mediaId=" +
mediaId;
const streamRes = await fetch(streamUrl);
const streamData = await streamRes.json();
const subtitles: Stream['subtitles'] = [];
const subtitles: Stream["subtitles"] = [];
if (streamData?.sources?.length > 0) {
if (streamData.subtitles) {
streamData.subtitles.forEach((sub: {lang: string; url: string}) => {
streamData.subtitles.forEach((sub: { lang: string; url: string }) => {
subtitles.push({
language: sub?.lang?.slice(0, 2) as any,
uri: sub?.url,
@@ -42,10 +42,10 @@ export const flixhqGetStream = async function ({
streamLinks.push({
server:
server?.name +
'-' +
source?.quality?.replace('auto', 'MultiQuality'),
"-" +
source?.quality?.replace("auto", "MultiQuality"),
link: source.url,
type: source.isM3U8 ? 'm3u8' : 'mp4',
type: source.isM3U8 ? "m3u8" : "mp4",
subtitles: subtitles,
});
});