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, link,
providerContext, providerContext,
}: { }: {
@@ -9,43 +9,43 @@ export const allGetInfo = async function ({
}): Promise<Info> { }): Promise<Info> {
const axios = providerContext.axios; const axios = providerContext.axios;
try { try {
console.log('all', link); console.log("all", link);
const res = await axios.get(link); const res = await axios.get(link);
const data = res.data; const data = res.data;
const meta = { const meta = {
title: '', title: "",
synopsis: '', synopsis: "",
image: '', image: "",
imdbId: data?.meta?.imdb_id || '', imdbId: data?.meta?.imdb_id || "",
type: data?.meta?.type || 'movie', type: data?.meta?.type || "movie",
}; };
const links: Link[] = []; const links: Link[] = [];
let directLinks: EpisodeLink[] = []; let directLinks: EpisodeLink[] = [];
let season = new Map(); let season = new Map();
if (meta.type === 'series') { if (meta.type === "series") {
data?.meta?.videos?.map((video: any) => { data?.meta?.videos?.map((video: any) => {
if (video?.season <= 0) return; if (video?.season <= 0) return;
if (!season.has(video?.season)) { if (!season.has(video?.season)) {
season.set(video?.season, []); season.set(video?.season, []);
} }
season.get(video?.season).push({ season.get(video?.season).push({
title: 'Episode ' + video?.episode, title: "Episode " + video?.episode,
type: 'series', type: "series",
link: JSON.stringify({ link: JSON.stringify({
title: data?.meta?.name as string, title: data?.meta?.name as string,
imdbId: data?.meta?.imdb_id, imdbId: data?.meta?.imdb_id,
season: video?.id?.split(':')[1], season: video?.id?.split(":")[1],
episode: video?.id?.split(':')[2], episode: video?.id?.split(":")[2],
type: data?.meta?.type, type: data?.meta?.type,
tmdbId: data?.meta?.moviedb_id?.toString() || '', tmdbId: data?.meta?.moviedb_id?.toString() || "",
year: data?.meta?.year, year: data?.meta?.year,
}), }),
}); });
}); });
const keys = Array.from(season.keys()); const keys = Array.from(season.keys());
keys.sort(); keys.sort();
keys.map(key => { keys.map((key) => {
directLinks = season.get(key); directLinks = season.get(key);
links.push({ links.push({
title: `Season ${key}`, title: `Season ${key}`,
@@ -53,20 +53,20 @@ export const allGetInfo = async function ({
}); });
}); });
} else { } else {
console.log('all meta Mv🔥🔥', meta); console.log("all meta Mv🔥🔥", meta);
links.push({ links.push({
title: data?.meta?.name as string, title: data?.meta?.name as string,
directLinks: [ directLinks: [
{ {
title: 'Movie', title: "Movie",
type: 'movie', type: "movie",
link: JSON.stringify({ link: JSON.stringify({
title: data?.meta?.name as string, title: data?.meta?.name as string,
imdbId: data?.meta?.imdb_id, imdbId: data?.meta?.imdb_id,
season: '', season: "",
episode: '', episode: "",
type: data?.meta?.type, type: data?.meta?.type,
tmdbId: data?.meta?.moviedb_id?.toString() || '', tmdbId: data?.meta?.moviedb_id?.toString() || "",
year: data?.meta?.year, year: data?.meta?.year,
}), }),
}, },
@@ -80,11 +80,11 @@ export const allGetInfo = async function ({
} catch (err) { } catch (err) {
console.error(err); console.error(err);
return { return {
title: '', title: "",
synopsis: '', synopsis: "",
image: '', image: "",
imdbId: '', imdbId: "",
type: 'movie', type: "movie",
linkList: [], 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, filter,
signal, signal,
providerContext, providerContext,
@@ -13,8 +13,8 @@ export const allGetPost = async function ({
}): Promise<Post[]> { }): Promise<Post[]> {
try { try {
const catalog: Post[] = []; const catalog: Post[] = [];
const url = 'https://cinemeta-catalogs.strem.io' + filter; const url = "https://cinemeta-catalogs.strem.io" + filter;
console.log('allGetPostUrl', url); console.log("allGetPostUrl", url);
const res = await providerContext.axios.get(url, { const res = await providerContext.axios.get(url, {
headers: providerContext.commonHeaders, headers: providerContext.commonHeaders,
signal, signal,
@@ -33,15 +33,15 @@ export const allGetPost = async function ({
}); });
} }
}); });
console.log('catalog', catalog.length); console.log("catalog", catalog.length);
return catalog; return catalog;
} catch (err) { } catch (err) {
console.error('AutoEmbed error ', err); console.error("AutoEmbed error ", err);
return []; return [];
} }
}; };
export const allGetSearchPosts = async function ({ export const getSearchPosts = async function ({
searchQuery, searchQuery,
page, page,
// providerValue, // providerValue,
@@ -60,10 +60,10 @@ export const allGetSearchPosts = async function ({
} }
const catalog: Post[] = []; const catalog: Post[] = [];
const url1 = `https://v3-cinemeta.strem.io/catalog/series/top/search=${encodeURI( const url1 = `https://v3-cinemeta.strem.io/catalog/series/top/search=${encodeURI(
searchQuery, searchQuery
)}.json`; )}.json`;
const url2 = `https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI( const url2 = `https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(
searchQuery, searchQuery
)}.json`; )}.json`;
const res = await providerContext.axios.get(url1, { const res = await providerContext.axios.get(url1, {
headers: providerContext.commonHeaders, headers: providerContext.commonHeaders,
@@ -71,7 +71,7 @@ export const allGetSearchPosts = async function ({
}); });
const data = res.data; const data = res.data;
data?.metas.map((result: any) => { data?.metas.map((result: any) => {
const title = result.name || ''; const title = result.name || "";
const id = result?.imdb_id || result?.id; const id = result?.imdb_id || result?.id;
const image = result?.poster; const image = result?.poster;
const type = result?.type; const type = result?.type;
@@ -89,7 +89,7 @@ export const allGetSearchPosts = async function ({
}); });
const data2 = res2.data; const data2 = res2.data;
data2?.metas.map((result: any) => { data2?.metas.map((result: any) => {
const title = result?.name || ''; const title = result?.name || "";
const id = result?.imdb_id || result?.id; const id = result?.imdb_id || result?.id;
const image = result?.poster; const image = result?.poster;
const type = result?.type; const type = result?.type;
@@ -103,7 +103,7 @@ export const allGetSearchPosts = async function ({
}); });
return catalog; return catalog;
} catch (err) { } catch (err) {
console.error('AutoEmbed error ', err); console.error("AutoEmbed error ", err);
return []; 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, link: id,
type, type,
providerContext, providerContext,
@@ -18,7 +18,7 @@ export const allGetStream = async ({
season, season,
type, type,
streams, streams,
providerContext, providerContext
); );
return streams; return streams;
} catch (err) { } catch (err) {
@@ -33,47 +33,47 @@ export async function getRiveStream(
season: string, season: string,
type: string, type: string,
Streams: Stream[], Streams: Stream[],
providerContext: ProviderContext, providerContext: ProviderContext
) { ) {
const secret = generateSecretKey(Number(tmdId)); const secret = generateSecretKey(Number(tmdId));
const servers = [ const servers = [
'flowcast', "flowcast",
'shadow', "shadow",
'asiacloud', "asiacloud",
'hindicast', "hindicast",
'anime', "anime",
'animez', "animez",
'guard', "guard",
'curve', "curve",
'hq', "hq",
'ninja', "ninja",
'alpha', "alpha",
'kaze', "kaze",
'zenesis', "zenesis",
'genesis', "genesis",
'zenith', "zenith",
'ghost', "ghost",
'halo', "halo",
'kinoecho', "kinoecho",
'ee3', "ee3",
'volt', "volt",
'putafilme', "putafilme",
'ophim', "ophim",
'kage', "kage",
]; ];
const baseUrl = await providerContext.getBaseUrl('rive'); const baseUrl = await providerContext.getBaseUrl("rive");
const cors = process.env.CORS_PRXY ? process.env.CORS_PRXY + '?url=' : ''; const cors = process.env.CORS_PRXY ? process.env.CORS_PRXY + "?url=" : "";
console.log('CORS: ' + cors); console.log("CORS: " + cors);
const route = const route =
type === 'series' type === "series"
? `/api/backendfetch?requestID=tvVideoProvider&id=${tmdId}&season=${season}&episode=${episode}&secretKey=${secret}&service=` ? `/api/backendfetch?requestID=tvVideoProvider&id=${tmdId}&season=${season}&episode=${episode}&secretKey=${secret}&service=`
: `/api/backendfetch?requestID=movieVideoProvider&id=${tmdId}&secretKey=${secret}&service=`; : `/api/backendfetch?requestID=movieVideoProvider&id=${tmdId}&secretKey=${secret}&service=`;
const url = cors const url = cors
? cors + encodeURIComponent(baseUrl + route) ? cors + encodeURIComponent(baseUrl + route)
: baseUrl + route; : baseUrl + route;
await Promise.all( await Promise.all(
servers.map(async server => { servers.map(async (server) => {
console.log('Rive: ' + url + server); console.log("Rive: " + url + server);
try { try {
const res = await providerContext.axios.get(url + server, { const res = await providerContext.axios.get(url + server, {
timeout: 4000, timeout: 4000,
@@ -83,10 +83,10 @@ export async function getRiveStream(
if (res.data?.data?.captions) { if (res.data?.data?.captions) {
res.data?.data?.captions.forEach((sub: any) => { res.data?.data?.captions.forEach((sub: any) => {
subtitles.push({ subtitles.push({
language: sub?.label?.slice(0, 2) || 'Und', language: sub?.label?.slice(0, 2) || "Und",
uri: sub?.file, uri: sub?.file,
title: sub?.label || 'Undefined', title: sub?.label || "Undefined",
type: sub?.file?.endsWith('.vtt') type: sub?.file?.endsWith(".vtt")
? TextTrackType.VTT ? TextTrackType.VTT
: TextTrackType.SUBRIP, : TextTrackType.SUBRIP,
}); });
@@ -94,9 +94,9 @@ export async function getRiveStream(
} }
res.data?.data?.sources.forEach((source: any) => { res.data?.data?.sources.forEach((source: any) => {
Streams.push({ Streams.push({
server: source?.source + '-' + source?.quality, server: source?.source + "-" + source?.quality,
link: source?.url, link: source?.url,
type: source?.format === 'hls' ? 'm3u8' : 'mp4', type: source?.format === "hls" ? "m3u8" : "mp4",
quality: source?.quality, quality: source?.quality,
subtitles: subtitles, subtitles: subtitles,
}); });
@@ -104,78 +104,78 @@ export async function getRiveStream(
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
}), })
); );
} }
function generateSecretKey(id: number | string) { function generateSecretKey(id: number | string) {
// Array of secret key fragments - updated array from the new implementation // Array of secret key fragments - updated array from the new implementation
const c = [ const c = [
'Yhv40uKAZa', "Yhv40uKAZa",
'nn8YU4yBA', "nn8YU4yBA",
'uNeH', "uNeH",
'ehK', "ehK",
'jT0', "jT0",
'n5G', "n5G",
'99R', "99R",
'MvB1M', "MvB1M",
'DQtPCh', "DQtPCh",
'GBRjk4k4I', "GBRjk4k4I",
'CzIOoa95UT', "CzIOoa95UT",
'BLE8s', "BLE8s",
'GDZlc7', "GDZlc7",
'Fz45T', "Fz45T",
'JW6lWn', "JW6lWn",
'DE3g4uw0i', "DE3g4uw0i",
'18KxmYizv', "18KxmYizv",
'8ji', "8ji",
'JUDdNMnZ', "JUDdNMnZ",
'oGpBippPgm', "oGpBippPgm",
'7De8Pg', "7De8Pg",
'Zv6', "Zv6",
'VHT9TVN', "VHT9TVN",
'bYH6m', "bYH6m",
'aK1', "aK1",
'WcWH6jU', "WcWH6jU",
'Q47YEMi4k', "Q47YEMi4k",
'vRD3A', "vRD3A",
'CGOsfJO', "CGOsfJO",
'BLn8', "BLn8",
'RgK0drv7l', "RgK0drv7l",
'oPTfGCn3a', "oPTfGCn3a",
'MkpMDkttW9', "MkpMDkttW9",
'VNI1fPM', "VNI1fPM",
'XNFi6', "XNFi6",
'6cq', "6cq",
'4LvTksXoEI', "4LvTksXoEI",
'1rRa2KOZB0', "1rRa2KOZB0",
'zoOGRb8HT2', "zoOGRb8HT2",
'mhcXDtvz', "mhcXDtvz",
'NUmexFY2Ur', "NUmexFY2Ur",
'6BIMdvSZ', "6BIMdvSZ",
'Tr0zU2vjRd', "Tr0zU2vjRd",
'QPR', "QPR",
'fhOqJR', "fhOqJR",
'R9VnFY', "R9VnFY",
'xkZ99D6S', "xkZ99D6S",
'umY7E', "umY7E",
'5Ds8qyDq', "5Ds8qyDq",
'Cc6jy09y3', "Cc6jy09y3",
'yvU3iR', "yvU3iR",
'Bg07zY', "Bg07zY",
'GccECglg', "GccECglg",
'VYd', "VYd",
'6vOiXqz', "6vOiXqz",
'7xX', "7xX",
'UdRrbEzF', "UdRrbEzF",
'fE6wc', "fE6wc",
'BUd25Rb', "BUd25Rb",
'lxq5Zum89o', "lxq5Zum89o",
]; ];
// Handle undefined input // Handle undefined input
if (id === undefined) { if (id === undefined) {
return 'rive'; return "rive";
} }
try { try {
@@ -195,7 +195,7 @@ function generateSecretKey(id: number | string) {
} }
hash ^= hash >>> 13; hash ^= hash >>> 13;
hash = (1540483477 * hash) >>> 0; 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 // Updated MurmurHash-like function to match the new implementation
@@ -214,7 +214,7 @@ function generateSecretKey(id: number | string) {
hash = (2246822507 * hash) >>> 0; hash = (2246822507 * hash) >>> 0;
hash ^= hash >>> 13; hash ^= hash >>> 13;
hash = (3266489909 * hash) >>> 0; 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 */ /* eslint-enable no-bitwise */
@@ -225,7 +225,7 @@ function generateSecretKey(id: number | string) {
if (isNaN(Number(id))) { if (isNaN(Number(id))) {
// For non-numeric inputs, sum the character codes // For non-numeric inputs, sum the character codes
const charSum = idStr const charSum = idStr
.split('') .split("")
.reduce((sum, char) => sum + char.charCodeAt(0), 0); .reduce((sum, char) => sum + char.charCodeAt(0), 0);
// Select array element or fallback to base64 encoded input // Select array element or fallback to base64 encoded input
fragment = c[charSum % c.length] || btoa(idStr); fragment = c[charSum % c.length] || btoa(idStr);
@@ -245,6 +245,6 @@ function generateSecretKey(id: number | string) {
); );
} catch (error) { } catch (error) {
// Return fallback value if any errors occur // Return fallback value if any errors occur
return 'topSecret'; return "topSecret";
} }
} }

View File

@@ -0,0 +1,20 @@
export const catalog = [
{
title: "Trending",
filter: "/genre/latest-trending-releases/",
},
{
title: "Netflix",
filter: "/network/netflix/",
},
{
title: "Amazon Prime",
filter: "/network/prime-video/",
},
{
title: "Animation",
filter: "/genre/anime/",
},
];
export const genres = [];

View File

@@ -1,20 +0,0 @@
export const clCatalog = [
{
title: 'Trending',
filter: '/genre/latest-trending-releases/',
},
{
title: 'Netflix',
filter: '/network/netflix/',
},
{
title: 'Amazon Prime',
filter: '/network/prime-video/',
},
{
title: 'Animation',
filter: '/genre/anime/',
},
];
export const clGenresList = [];

View File

@@ -1,6 +1,6 @@
import {EpisodeLink, ProviderContext} from '../types'; import { EpisodeLink, ProviderContext } from "../types";
export const clsEpisodeLinks = async function ({ export const getEpisodes = async function ({
url, url,
providerContext, providerContext,
}: { }: {
@@ -8,7 +8,7 @@ export const clsEpisodeLinks = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<EpisodeLink[]> { }): Promise<EpisodeLink[]> {
try { try {
if (!url.includes('luxelinks') || url.includes('luxecinema')) { if (!url.includes("luxelinks") || url.includes("luxecinema")) {
const res = await providerContext.axios.get(url, { const res = await providerContext.axios.get(url, {
headers: providerContext.commonHeaders, headers: providerContext.commonHeaders,
}); });
@@ -18,14 +18,14 @@ export const clsEpisodeLinks = async function ({
url = encodedLink ? atob(encodedLink) : url; url = encodedLink ? atob(encodedLink) : url;
} else { } else {
const redirectUrlRes = await fetch( const redirectUrlRes = await fetch(
'https://ext.8man.me/api/cinemaluxe', "https://ext.8man.me/api/cinemaluxe",
{ {
method: 'POST', method: "POST",
headers: { headers: {
'Content-Type': 'application/json', "Content-Type": "application/json",
}, },
body: JSON.stringify({ url }), body: JSON.stringify({ url }),
}, }
); );
const redirectUrl = await redirectUrlRes.json(); const redirectUrl = await redirectUrlRes.json();
url = redirectUrl?.redirectUrl || url; url = redirectUrl?.redirectUrl || url;
@@ -37,37 +37,37 @@ export const clsEpisodeLinks = async function ({
const html = res.data; const html = res.data;
let $ = providerContext.cheerio.load(html); let $ = providerContext.cheerio.load(html);
const episodeLinks: EpisodeLink[] = []; const episodeLinks: EpisodeLink[] = [];
if (url.includes('luxedrive')) { if (url.includes("luxedrive")) {
episodeLinks.push({ episodeLinks.push({
title: 'Movie', title: "Movie",
link: url, link: url,
}); });
return episodeLinks; return episodeLinks;
} }
$('a.maxbutton-4,a.maxbutton,.maxbutton-hubcloud,.ep-simple-button').map( $("a.maxbutton-4,a.maxbutton,.maxbutton-hubcloud,.ep-simple-button").map(
(i, element) => { (i, element) => {
const title = $(element).text()?.trim(); const title = $(element).text()?.trim();
const link = $(element).attr('href'); const link = $(element).attr("href");
if ( if (
title && title &&
link && link &&
!title.includes('Batch') && !title.includes("Batch") &&
!title.toLowerCase().includes('zip') !title.toLowerCase().includes("zip")
) { ) {
episodeLinks.push({ episodeLinks.push({
title: title title: title
.replace(/\(\d{4}\)/, '') .replace(/\(\d{4}\)/, "")
.replace('Download', 'Movie') .replace("Download", "Movie")
.replace('⚡', '') .replace("⚡", "")
.trim(), .trim(),
link, link,
}); });
} }
}, }
); );
return episodeLinks; return episodeLinks;
} catch (err) { } catch (err) {
console.error('cl episode links', err); console.error("cl episode links", err);
return []; return [];
} }
}; };

View File

@@ -1,16 +0,0 @@
import {clGenresList, clCatalog} from './clCatalog';
import {clGetInfo} from './clGetMeta';
import {clsEpisodeLinks} from './clGetEpisodes';
import {clGetPostsSearch, clGetPosts} from './clGetPosts';
import {ProviderType} from '../types';
import {clGetStream} from './clGetSteam';
export const cinemaLuxe: ProviderType = {
catalog: clCatalog,
genres: clGenresList,
GetHomePosts: clGetPosts,
GetMetaData: clGetInfo,
GetSearchPosts: clGetPostsSearch,
GetEpisodeLinks: clsEpisodeLinks,
GetStream: clGetStream,
};

View File

@@ -1,6 +1,6 @@
import {Info, Link, ProviderContext} from '../types'; import { Info, Link, ProviderContext } from "../types";
export const clGetInfo = async function ({ export const getMeta = async function ({
link, link,
providerContext, providerContext,
}: { }: {
@@ -14,36 +14,36 @@ export const clGetInfo = async function ({
}); });
const data = res.data; const data = res.data;
const $ = providerContext.cheerio.load(data); const $ = providerContext.cheerio.load(data);
const type = url.includes('tvshows') ? 'series' : 'movie'; const type = url.includes("tvshows") ? "series" : "movie";
const imdbId = ''; const imdbId = "";
const title = url.split('/')[4].replace(/-/g, ' '); const title = url.split("/")[4].replace(/-/g, " ");
const image = $('.g-item').find('a').attr('href') || ''; const image = $(".g-item").find("a").attr("href") || "";
const synopsis = $('.wp-content').text().trim(); const synopsis = $(".wp-content").text().trim();
const tags = $('.sgeneros') const tags = $(".sgeneros")
.children() .children()
.map((i, element) => $(element).text()) .map((i, element) => $(element).text())
.get() .get()
.slice(3); .slice(3);
const rating = Number($('#repimdb').find('strong').text()) const rating = Number($("#repimdb").find("strong").text())
.toFixed(1) .toFixed(1)
.toString(); .toString();
const links: Link[] = []; const links: Link[] = [];
$('.mb-center.maxbutton-5-center,.ep-button-container').map( $(".mb-center.maxbutton-5-center,.ep-button-container").map(
(i, element) => { (i, element) => {
const title = $(element) const title = $(element)
.text() .text()
.replace('\u2b07Download', '') .replace("\u2b07Download", "")
.replace('\u2b07 Download', '') .replace("\u2b07 Download", "")
.trim(); .trim();
const link = $(element).find('a').attr('href'); const link = $(element).find("a").attr("href");
if (title && link) { if (title && link) {
links.push({ links.push({
title, title,
episodesLink: link, episodesLink: link,
quality: title?.match(/\d+P\b/)?.[0].replace('P', 'p') || '', quality: title?.match(/\d+P\b/)?.[0].replace("P", "p") || "",
}); });
} }
}, }
); );
return { return {
title, title,
@@ -58,11 +58,11 @@ export const clGetInfo = async function ({
} catch (err) { } catch (err) {
console.error(err); console.error(err);
return { return {
title: '', title: "",
synopsis: '', synopsis: "",
image: '', image: "",
imdbId: '', imdbId: "",
type: 'movie', type: "movie",
linkList: [], linkList: [],
}; };
} }

View File

@@ -1,6 +1,6 @@
import {Post, ProviderContext} from '../types'; import { Post, ProviderContext } from "../types";
export const clGetPosts = async function ({ export const getPosts = async function ({
filter, filter,
page, page,
signal, signal,
@@ -11,12 +11,12 @@ export const clGetPosts = async function ({
signal: AbortSignal; signal: AbortSignal;
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Post[]> { }): Promise<Post[]> {
const baseUrl = await providerContext.getBaseUrl('cinemaLuxe'); const baseUrl = await providerContext.getBaseUrl("cinemaLuxe");
const url = `${baseUrl + filter}page/${page}/`; const url = `${baseUrl + filter}page/${page}/`;
return posts({ url, signal, providerContext }); return posts({ url, signal, providerContext });
}; };
export const clGetPostsSearch = async function ({ export const getSearchPosts = async function ({
searchQuery, searchQuery,
page, page,
signal, signal,
@@ -28,7 +28,7 @@ export const clGetPostsSearch = async function ({
signal: AbortSignal; signal: AbortSignal;
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Post[]> { }): Promise<Post[]> {
const baseUrl = await providerContext.getBaseUrl('cinemaLuxe'); const baseUrl = await providerContext.getBaseUrl("cinemaLuxe");
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`; const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
return posts({ url, signal, providerContext }); return posts({ url, signal, providerContext });
}; };
@@ -50,10 +50,10 @@ async function posts({
const data = await res.text(); const data = await res.text();
const $ = providerContext.cheerio.load(data); const $ = providerContext.cheerio.load(data);
const catalog: Post[] = []; const catalog: Post[] = [];
$('.item.tvshows,.item.movies').map((i, element) => { $(".item.tvshows,.item.movies").map((i, element) => {
const title = $(element).find('.poster').find('img').attr('alt'); const title = $(element).find(".poster").find("img").attr("alt");
const link = $(element).find('.poster').find('a').attr('href'); const link = $(element).find(".poster").find("a").attr("href");
const image = $(element).find('.poster').find('img').attr('data-src'); const image = $(element).find(".poster").find("img").attr("data-src");
if (title && link && image) { if (title && link && image) {
catalog.push({ catalog.push({
title: title, title: title,
@@ -62,10 +62,10 @@ async function posts({
}); });
} }
}); });
$('.result-item').map((i, element) => { $(".result-item").map((i, element) => {
const title = $(element).find('.thumbnail').find('img').attr('alt'); const title = $(element).find(".thumbnail").find("img").attr("alt");
const link = $(element).find('.thumbnail').find('a').attr('href'); const link = $(element).find(".thumbnail").find("a").attr("href");
const image = $(element).find('.thumbnail').find('img').attr('data-src'); const image = $(element).find(".thumbnail").find("img").attr("data-src");
if (title && link && image) { if (title && link && image) {
catalog.push({ catalog.push({
title: title, title: title,
@@ -76,7 +76,7 @@ async function posts({
}); });
return catalog; return catalog;
} catch (err) { } catch (err) {
console.error('cinemaluxe error ', err); console.error("cinemaluxe error ", err);
return []; return [];
} }
} }

View File

@@ -1,6 +1,6 @@
import {Stream, ProviderContext} from '../types'; import { Stream, ProviderContext } from "../types";
export const clGetStream = async ({ export const getStream = async ({
link, link,
signal, signal,
providerContext, providerContext,
@@ -12,23 +12,23 @@ export const clGetStream = async ({
}): Promise<Stream[]> => { }): Promise<Stream[]> => {
try { try {
let newLink = link; let newLink = link;
if (link.includes('luxedrive')) { if (link.includes("luxedrive")) {
const res = await providerContext.axios.get(link); const res = await providerContext.axios.get(link);
const $ = providerContext.cheerio.load(res.data); const $ = providerContext.cheerio.load(res.data);
const hubcloudLink = $('a.btn.hubcloud').attr('href'); const hubcloudLink = $("a.btn.hubcloud").attr("href");
if (hubcloudLink) { if (hubcloudLink) {
newLink = hubcloudLink; newLink = hubcloudLink;
} else { } else {
const gdFlixLink = $('a.btn.gdflix').attr('href'); const gdFlixLink = $("a.btn.gdflix").attr("href");
if (gdFlixLink) { if (gdFlixLink) {
newLink = gdFlixLink; newLink = gdFlixLink;
} }
} }
} }
if (newLink.includes('gdflix')) { if (newLink.includes("gdflix")) {
const sreams = await providerContext.extractors.gdFlixExtracter( const sreams = await providerContext.extractors.gdFlixExtracter(
newLink, newLink,
signal, signal
); );
return sreams; return sreams;
} }
@@ -36,8 +36,8 @@ export const clGetStream = async ({
const data2 = res2.data; const data2 = res2.data;
const hcLink = data2.match(/location\.replace\('([^']+)'/)?.[1] || newLink; const hcLink = data2.match(/location\.replace\('([^']+)'/)?.[1] || newLink;
const hubCloudLinks = await providerContext.extractors.hubcloudExtracter( const hubCloudLinks = await providerContext.extractors.hubcloudExtracter(
hcLink.includes('https://hubcloud') ? hcLink : newLink, hcLink.includes("https://hubcloud") ? hcLink : newLink,
signal, signal
); );
return hubCloudLinks; return hubCloudLinks;
} catch (err) { } catch (err) {

View File

@@ -0,0 +1,12 @@
export const catalog = [
{
title: "Series",
filter: "/rest-api//v130/tvseries",
},
{
title: "Movies",
filter: "/rest-api//v130/movies",
},
];
export const genres = [];

View File

@@ -1,12 +0,0 @@
export const dooCatalog = [
{
title: 'Series',
filter: '/rest-api//v130/tvseries',
},
{
title: 'Movies',
filter: '/rest-api//v130/movies',
},
];
export const dooGenresList = [];

View File

@@ -1,14 +0,0 @@
import {ProviderType} from '../types';
import {dooCatalog, dooGenresList} from './dooCatalog';
import {dooGetInfo} from './dooGetInfo';
import {dooGetPost, dooGetSearchPost} from './dooGetPosts';
import {dooGetStream} from './dooGetSteam';
export const dooflixProvider: ProviderType = {
catalog: dooCatalog,
genres: dooGenresList,
GetMetaData: dooGetInfo,
GetStream: dooGetStream,
GetHomePosts: dooGetPost,
GetSearchPosts: dooGetSearchPost,
};

View File

@@ -1,14 +1,14 @@
import {EpisodeLink, Info, Link, ProviderContext} from '../types'; import { EpisodeLink, Info, Link, ProviderContext } from "../types";
const headers = { const headers = {
'Accept-Encoding': 'gzip', "Accept-Encoding": "gzip",
'API-KEY': '2pm95lc6prpdbk0ppji9rsqo', "API-KEY": "2pm95lc6prpdbk0ppji9rsqo",
Connection: 'Keep-Alive', Connection: "Keep-Alive",
'If-Modified-Since': 'Wed, 14 Aug 2024 13:00:04 GMT', "If-Modified-Since": "Wed, 14 Aug 2024 13:00:04 GMT",
'User-Agent': 'okhttp/3.14.9', "User-Agent": "okhttp/3.14.9",
}; };
export const dooGetInfo = async function ({ export const getMeta = async function ({
link, link,
providerContext, providerContext,
}: { }: {
@@ -19,22 +19,22 @@ export const dooGetInfo = async function ({
const { axios } = providerContext; const { axios } = providerContext;
const res = await axios.get(link, { headers }); const res = await axios.get(link, { headers });
const resData = res.data; const resData = res.data;
const jsonStart = resData?.indexOf('{'); const jsonStart = resData?.indexOf("{");
const jsonEnd = resData?.lastIndexOf('}') + 1; const jsonEnd = resData?.lastIndexOf("}") + 1;
const data = JSON?.parse(resData?.substring(jsonStart, jsonEnd))?.title const data = JSON?.parse(resData?.substring(jsonStart, jsonEnd))?.title
? JSON?.parse(resData?.substring(jsonStart, jsonEnd)) ? JSON?.parse(resData?.substring(jsonStart, jsonEnd))
: resData; : resData;
const title = data?.title || ''; const title = data?.title || "";
const synopsis = data?.description || ''; const synopsis = data?.description || "";
const image = data?.poster_url || ''; const image = data?.poster_url || "";
const cast = data?.cast || []; const cast = data?.cast || [];
const rating = data?.imdb_rating || ''; const rating = data?.imdb_rating || "";
const type = Number(data?.is_tvseries) ? 'series' : 'movie'; const type = Number(data?.is_tvseries) ? "series" : "movie";
const tags = data?.genre?.map((genre: any) => genre?.name) || []; const tags = data?.genre?.map((genre: any) => genre?.name) || [];
const links: Link[] = []; const links: Link[] = [];
if (type === 'series') { if (type === "series") {
data?.season?.map((season: any) => { data?.season?.map((season: any) => {
const title = season?.seasons_name || ''; const title = season?.seasons_name || "";
const directLinks: EpisodeLink[] = const directLinks: EpisodeLink[] =
season?.episodes?.map((episode: any) => ({ season?.episodes?.map((episode: any) => ({
title: episode?.episodes_name, title: episode?.episodes_name,
@@ -48,10 +48,10 @@ export const dooGetInfo = async function ({
} else { } else {
data?.videos?.map((video: any) => { data?.videos?.map((video: any) => {
links.push({ links.push({
title: title + ' ' + video?.label, title: title + " " + video?.label,
directLinks: [ directLinks: [
{ {
title: 'Play', title: "Play",
link: video?.file_url, link: video?.file_url,
}, },
], ],
@@ -59,11 +59,11 @@ export const dooGetInfo = async function ({
}); });
} }
return { return {
image: image?.includes('https') ? image : image?.replace('http', 'https'), image: image?.includes("https") ? image : image?.replace("http", "https"),
synopsis: synopsis, synopsis: synopsis,
title: title, title: title,
rating: rating, rating: rating,
imdbId: '', imdbId: "",
cast: cast, cast: cast,
tags: tags, tags: tags,
type: type, type: type,
@@ -72,11 +72,11 @@ export const dooGetInfo = async function ({
} catch (err) { } catch (err) {
console.error(err); console.error(err);
return { return {
title: '', title: "",
synopsis: '', synopsis: "",
image: '', image: "",
imdbId: '', imdbId: "",
type: 'movie', type: "movie",
linkList: [], linkList: [],
}; };
} }

View File

@@ -1,14 +1,14 @@
import {Post, ProviderContext} from '../types'; import { Post, ProviderContext } from "../types";
const headers = { const headers = {
'Accept-Encoding': 'gzip', "Accept-Encoding": "gzip",
'API-KEY': '2pm95lc6prpdbk0ppji9rsqo', "API-KEY": "2pm95lc6prpdbk0ppji9rsqo",
Connection: 'Keep-Alive', Connection: "Keep-Alive",
'If-Modified-Since': 'Wed, 14 Aug 2024 13:00:04 GMT', "If-Modified-Since": "Wed, 14 Aug 2024 13:00:04 GMT",
'User-Agent': 'okhttp/3.14.9', "User-Agent": "okhttp/3.14.9",
}; };
export const dooGetPost = async function ({ export const getPosts = async function ({
filter, filter,
page, page,
signal, signal,
@@ -22,22 +22,22 @@ export const dooGetPost = async function ({
}): Promise<Post[]> { }): Promise<Post[]> {
try { try {
const { axios, getBaseUrl } = providerContext; const { axios, getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl('dooflix'); const baseUrl = await getBaseUrl("dooflix");
const catalog: Post[] = []; const catalog: Post[] = [];
const url = `${baseUrl + filter + `?page=${page}`}`; const url = `${baseUrl + filter + `?page=${page}`}`;
const res = await axios.get(url, { headers, signal }); const res = await axios.get(url, { headers, signal });
const resData = res.data; const resData = res.data;
if (!resData || typeof resData !== 'string') { if (!resData || typeof resData !== "string") {
console.warn('Unexpected response format from dooflix API'); console.warn("Unexpected response format from dooflix API");
return []; return [];
} }
let data; let data;
try { try {
const jsonStart = resData.indexOf('['); const jsonStart = resData.indexOf("[");
const jsonEnd = resData.lastIndexOf(']') + 1; const jsonEnd = resData.lastIndexOf("]") + 1;
if (jsonStart === -1 || jsonEnd <= jsonStart) { if (jsonStart === -1 || jsonEnd <= jsonStart) {
// If we can't find valid JSON array markers, try parsing the entire response // If we can't find valid JSON array markers, try parsing the entire response
@@ -48,12 +48,12 @@ export const dooGetPost = async function ({
data = parsedArray.length > 0 ? parsedArray : resData; data = parsedArray.length > 0 ? parsedArray : resData;
} }
} catch (parseError) { } catch (parseError) {
console.error('Error parsing dooflix response:', parseError); console.error("Error parsing dooflix response:", parseError);
return []; return [];
} }
if (!Array.isArray(data)) { if (!Array.isArray(data)) {
console.warn('Unexpected data format from dooflix API'); console.warn("Unexpected data format from dooflix API");
return []; return [];
} }
@@ -61,16 +61,16 @@ export const dooGetPost = async function ({
const id = result?.videos_id; const id = result?.videos_id;
if (!id) return; if (!id) return;
const type = !result?.is_tvseries ? 'tvseries' : 'movie'; const type = !result?.is_tvseries ? "tvseries" : "movie";
const link = `${baseUrl}/rest-api//v130/single_details?type=${type}&id=${id}`; const link = `${baseUrl}/rest-api//v130/single_details?type=${type}&id=${id}`;
const thumbnailUrl = result?.thumbnail_url; const thumbnailUrl = result?.thumbnail_url;
const image = thumbnailUrl?.includes('https') const image = thumbnailUrl?.includes("https")
? thumbnailUrl ? thumbnailUrl
: thumbnailUrl?.replace('http', 'https'); : thumbnailUrl?.replace("http", "https");
catalog.push({ catalog.push({
title: result?.title || '', title: result?.title || "",
link, link,
image, image,
}); });
@@ -78,12 +78,12 @@ export const dooGetPost = async function ({
return catalog; return catalog;
} catch (err) { } catch (err) {
console.error('dooflix error:', err); console.error("dooflix error:", err);
return []; return [];
} }
}; };
export const dooGetSearchPost = async function ({ export const getSearchPosts = async function ({
searchQuery, searchQuery,
page, page,
providerContext, providerContext,
@@ -101,21 +101,21 @@ export const dooGetSearchPost = async function ({
} }
const { axios, getBaseUrl } = providerContext; const { axios, getBaseUrl } = providerContext;
const catalog: Post[] = []; const catalog: Post[] = [];
const baseUrl = await getBaseUrl('dooflix'); const baseUrl = await getBaseUrl("dooflix");
const url = `${baseUrl}/rest-api//v130/search?q=${searchQuery}&type=movietvserieslive&range_to=0&range_from=0&tv_category_id=0&genre_id=0&country_id=0`; const url = `${baseUrl}/rest-api//v130/search?q=${searchQuery}&type=movietvserieslive&range_to=0&range_from=0&tv_category_id=0&genre_id=0&country_id=0`;
const res = await axios.get(url, { headers, signal }); const res = await axios.get(url, { headers, signal });
const resData = res.data; const resData = res.data;
if (!resData || typeof resData !== 'string') { if (!resData || typeof resData !== "string") {
console.warn('Unexpected search response format from dooflix API'); console.warn("Unexpected search response format from dooflix API");
return []; return [];
} }
let data; let data;
try { try {
const jsonStart = resData.indexOf('{'); const jsonStart = resData.indexOf("{");
const jsonEnd = resData.lastIndexOf('}') + 1; const jsonEnd = resData.lastIndexOf("}") + 1;
if (jsonStart === -1 || jsonEnd <= jsonStart) { if (jsonStart === -1 || jsonEnd <= jsonStart) {
data = resData; data = resData;
@@ -125,7 +125,7 @@ export const dooGetSearchPost = async function ({
data = parsedData?.movie ? parsedData : resData; data = parsedData?.movie ? parsedData : resData;
} }
} catch (parseError) { } catch (parseError) {
console.error('Error parsing dooflix search response:', parseError); console.error("Error parsing dooflix search response:", parseError);
return []; return [];
} }
@@ -136,12 +136,12 @@ export const dooGetSearchPost = async function ({
const link = `${baseUrl}/rest-api//v130/single_details?type=movie&id=${id}`; const link = `${baseUrl}/rest-api//v130/single_details?type=movie&id=${id}`;
const thumbnailUrl = result?.thumbnail_url; const thumbnailUrl = result?.thumbnail_url;
const image = thumbnailUrl?.includes('https') const image = thumbnailUrl?.includes("https")
? thumbnailUrl ? thumbnailUrl
: thumbnailUrl?.replace('http', 'https'); : thumbnailUrl?.replace("http", "https");
catalog.push({ catalog.push({
title: result?.title || '', title: result?.title || "",
link, link,
image, image,
}); });
@@ -154,12 +154,12 @@ export const dooGetSearchPost = async function ({
const link = `${baseUrl}/rest-api//v130/single_details?type=tvseries&id=${id}`; const link = `${baseUrl}/rest-api//v130/single_details?type=tvseries&id=${id}`;
const thumbnailUrl = result?.thumbnail_url; const thumbnailUrl = result?.thumbnail_url;
const image = thumbnailUrl?.includes('https') const image = thumbnailUrl?.includes("https")
? thumbnailUrl ? thumbnailUrl
: thumbnailUrl?.replace('http', 'https'); : thumbnailUrl?.replace("http", "https");
catalog.push({ catalog.push({
title: result?.title || '', title: result?.title || "",
link, link,
image, image,
}); });
@@ -167,7 +167,7 @@ export const dooGetSearchPost = async function ({
return catalog; return catalog;
} catch (error) { } catch (error) {
console.error('dooflix search error:', error); console.error("dooflix search error:", error);
return []; return [];
} }
}; };

View File

@@ -1,6 +1,6 @@
import {Stream} from '../types'; import { Stream } from "../types";
export const dooGetStream = async function ({ export const getStream = async function ({
link, link,
}: { }: {
link: string; link: string;
@@ -8,19 +8,19 @@ export const dooGetStream = async function ({
try { try {
const streams: Stream[] = []; const streams: Stream[] = [];
streams.push({ streams.push({
server: 'Dooflix', server: "Dooflix",
link: link, link: link,
type: 'm3u8', type: "m3u8",
headers: { headers: {
Connection: 'Keep-Alive', Connection: "Keep-Alive",
'User-Agent': "User-Agent":
'Mozilla/5.0 (WindowsNT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.37', "Mozilla/5.0 (WindowsNT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.37",
Referer: 'https://molop.art/', Referer: "https://molop.art/",
Cookie: Cookie:
'cf_clearance=M2_2Hy4lKRy_ruRX3dzOgm3iho1FHe2DUC1lq28BUtI-1737377622-1.2.1.1-6R8RaH94._H2BuNuotsjTZ3fAF6cLwPII0guemu9A5Xa46lpCJPuELycojdREwoonYS2kRTYcZ9_1c4h4epi2LtDvMM9jIoOZKE9pIdWa30peM1hRMpvffTjGUCraHsJNCJez8S_QZ6XkkdP7GeQ5iwiYaI6Grp6qSJWoq0Hj8lS7EITZ1LzyrALI6iLlYjgLmgLGa1VuhORWJBN8ZxrJIZ_ba_pqbrR9fjnyToqxZ0XQaZfk1d3rZyNWoZUjI98GoAxVjnKtcBQQG6b2jYPJuMbbYraGoa54N7E7BR__7o', "cf_clearance=M2_2Hy4lKRy_ruRX3dzOgm3iho1FHe2DUC1lq28BUtI-1737377622-1.2.1.1-6R8RaH94._H2BuNuotsjTZ3fAF6cLwPII0guemu9A5Xa46lpCJPuELycojdREwoonYS2kRTYcZ9_1c4h4epi2LtDvMM9jIoOZKE9pIdWa30peM1hRMpvffTjGUCraHsJNCJez8S_QZ6XkkdP7GeQ5iwiYaI6Grp6qSJWoq0Hj8lS7EITZ1LzyrALI6iLlYjgLmgLGa1VuhORWJBN8ZxrJIZ_ba_pqbrR9fjnyToqxZ0XQaZfk1d3rZyNWoZUjI98GoAxVjnKtcBQQG6b2jYPJuMbbYraGoa54N7E7BR__7o",
}, },
}); });
console.log('doo streams', streams); console.log("doo streams", streams);
return streams; return streams;
} catch (err) { } catch (err) {
console.error(err); console.error(err);

View File

@@ -1,61 +1,61 @@
export const driveCatalog = [ export const catalog = [
{ {
title: 'Latest', title: "Latest",
filter: '', filter: "",
}, },
{ {
title: 'Anime', title: "Anime",
filter: 'category/anime/', filter: "category/anime/",
}, },
{ {
title: 'Netflix', title: "Netflix",
filter: 'category/netflix/', filter: "category/netflix/",
}, },
{ {
title: '4K', title: "4K",
filter: 'category/2160p-4k/', filter: "category/2160p-4k/",
}, },
]; ];
export const driveGenresList = [ export const genres = [
{ {
title: 'Action', title: "Action",
filter: '/category/action', filter: "/category/action",
}, },
{ {
title: 'Crime', title: "Crime",
filter: '/category/crime', filter: "/category/crime",
}, },
{ {
title: 'Comedy', title: "Comedy",
filter: '/category/comedy', filter: "/category/comedy",
}, },
{ {
title: 'Drama', title: "Drama",
filter: '/category/drama', filter: "/category/drama",
}, },
{ {
title: 'Horror', title: "Horror",
filter: '/category/horror', filter: "/category/horror",
}, },
{ {
title: 'Family', title: "Family",
filter: '/category/family', filter: "/category/family",
}, },
{ {
title: 'Sci-Fi', title: "Sci-Fi",
filter: '/category/sifi', filter: "/category/sifi",
}, },
{ {
title: 'Thriller', title: "Thriller",
filter: '/category/triller', filter: "/category/triller",
}, },
{ {
title: 'Romance', title: "Romance",
filter: '/category/romance', filter: "/category/romance",
}, },
{ {
title: 'Fight', title: "Fight",
filter: '/category/fight', filter: "/category/fight",
}, },
]; ];

View File

@@ -1,6 +1,6 @@
import {EpisodeLink, ProviderContext} from '../types'; import { EpisodeLink, ProviderContext } from "../types";
export const driveGetEpisodeLinks = async function ({ export const getEpisodes = async function ({
url, url,
providerContext, providerContext,
}: { }: {
@@ -16,10 +16,10 @@ export const driveGetEpisodeLinks = async function ({
const episodeLinks: EpisodeLink[] = []; const episodeLinks: EpisodeLink[] = [];
$('a:contains("HubCloud")').map((i, element) => { $('a:contains("HubCloud")').map((i, element) => {
const title = $(element).parent().prev().text(); const title = $(element).parent().prev().text();
const link = $(element).attr('href'); const link = $(element).attr("href");
if (link && (title.includes('Ep') || title.includes('Download'))) { if (link && (title.includes("Ep") || title.includes("Download"))) {
episodeLinks.push({ episodeLinks.push({
title: title.includes('Download') ? 'Play' : title, title: title.includes("Download") ? "Play" : title,
link, link,
}); });
} }
@@ -31,7 +31,7 @@ export const driveGetEpisodeLinks = async function ({
console.error(err); console.error(err);
return [ return [
{ {
title: 'Server 1', title: "Server 1",
link: url, link: url,
}, },
]; ];

View File

@@ -1,16 +0,0 @@
import {ProviderType} from '../../Manifest';
import {driveCatalog, driveGenresList} from './catalog';
import {driveGetEpisodeLinks} from './driveGetEpisodesList';
import {driveGetInfo} from './driveGetInfo';
import {driveGetPosts, driveGetSearchPost} from './driveGetPosts';
import {driveGetStream} from './driveGetStream';
export const moviesDrive: ProviderType = {
catalog: driveCatalog,
genres: driveGenresList,
GetMetaData: driveGetInfo,
GetHomePosts: driveGetPosts,
GetStream: driveGetStream,
GetEpisodeLinks: driveGetEpisodeLinks,
GetSearchPosts: driveGetSearchPost,
};

View File

@@ -1,6 +1,6 @@
import {Info, Link} from '../types'; import { Info, Link } from "../types";
export const driveGetInfo = async function ({ export const getMeta = async function ({
link, link,
providerContext, providerContext,
}: { }: {
@@ -17,51 +17,51 @@ export const driveGetInfo = async function ({
const res = await axios.get(url); const res = await axios.get(url);
const data = res.data; const data = res.data;
const $ = cheerio.load(data); const $ = cheerio.load(data);
const type = $('.left-wrapper') const type = $(".left-wrapper")
.text() .text()
.toLocaleLowerCase() .toLocaleLowerCase()
.includes('movie name') .includes("movie name")
? 'movie' ? "movie"
: 'series'; : "series";
const imdbId = $('a:contains("IMDb")').attr('href')?.split('/')[4] || ''; const imdbId = $('a:contains("IMDb")').attr("href")?.split("/")[4] || "";
const title = const title =
$('.left-wrapper').find('strong:contains("Name")').next().text() || $(".left-wrapper").find('strong:contains("Name")').next().text() ||
$('.left-wrapper') $(".left-wrapper")
.find('strong:contains("Name"),h5:contains("Name")') .find('strong:contains("Name"),h5:contains("Name")')
.find('span:first') .find("span:first")
.text(); .text();
const synopsis = const synopsis =
$('.left-wrapper') $(".left-wrapper")
.find( .find(
'h2:contains("Storyline"),h3:contains("Storyline"),h5:contains("Storyline"),h4:contains("Storyline"),h4:contains("STORYLINE")', 'h2:contains("Storyline"),h3:contains("Storyline"),h5:contains("Storyline"),h4:contains("Storyline"),h4:contains("STORYLINE")'
) )
.next() .next()
.text() || .text() ||
$('.ipc-html-content-inner-div').text() || $(".ipc-html-content-inner-div").text() ||
''; "";
const image = const image =
$('img.entered.lazyloaded,img.entered,img.litespeed-loaded').attr( $("img.entered.lazyloaded,img.entered,img.litespeed-loaded").attr(
'src', "src"
) || ) ||
$('img.aligncenter').attr('src') || $("img.aligncenter").attr("src") ||
''; "";
// Links // Links
const links: Link[] = []; const links: Link[] = [];
$( $(
'a:contains("1080")a:not(:contains("Zip")),a:contains("720")a:not(:contains("Zip")),a:contains("480")a:not(:contains("Zip")),a:contains("2160")a:not(:contains("Zip")),a:contains("4k")a:not(:contains("Zip"))', 'a:contains("1080")a:not(:contains("Zip")),a:contains("720")a:not(:contains("Zip")),a:contains("480")a:not(:contains("Zip")),a:contains("2160")a:not(:contains("Zip")),a:contains("4k")a:not(:contains("Zip"))'
).map((i: number, element: any) => { ).map((i: number, element: any) => {
const title = $(element).parent('h5').prev().text(); const title = $(element).parent("h5").prev().text();
const episodesLink = $(element).attr('href'); const episodesLink = $(element).attr("href");
const quality = title.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || ''; const quality = title.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || "";
if (episodesLink && title) { if (episodesLink && title) {
links.push({ links.push({
title, title,
episodesLink: type === 'series' ? episodesLink : '', episodesLink: type === "series" ? episodesLink : "",
directLinks: directLinks:
type === 'movie' type === "movie"
? [{title: 'Movie', link: episodesLink, type: 'movie'}] ? [{ title: "Movie", link: episodesLink, type: "movie" }]
: [], : [],
quality: quality, quality: quality,
}); });
@@ -69,7 +69,7 @@ export const driveGetInfo = async function ({
}); });
// console.log('drive meta', title, synopsis, image, imdbId, type, links); // console.log('drive meta', title, synopsis, image, imdbId, type, links);
console.log('drive meta', links, type); console.log("drive meta", links, type);
return { return {
title, title,
synopsis, synopsis,
@@ -81,11 +81,11 @@ export const driveGetInfo = async function ({
} catch (err) { } catch (err) {
console.error(err); console.error(err);
return { return {
title: '', title: "",
synopsis: '', synopsis: "",
image: '', image: "",
imdbId: '', imdbId: "",
type: 'movie', type: "movie",
linkList: [], linkList: [],
}; };
} }

View File

@@ -1,6 +1,6 @@
import {Post, ProviderContext} from '../types'; import { Post, ProviderContext } from "../types";
export const driveGetPosts = async function ({ export const getPosts = async function ({
filter, filter,
page, page,
signal, signal,
@@ -13,12 +13,12 @@ export const driveGetPosts = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl } = providerContext; const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl('drive'); const baseUrl = await getBaseUrl("drive");
const url = `${baseUrl + filter}/page/${page}/`; const url = `${baseUrl + filter}/page/${page}/`;
return posts({ url, signal, providerContext }); return posts({ url, signal, providerContext });
}; };
export const driveGetSearchPost = async function ({ export const getSearchPosts = async function ({
searchQuery, searchQuery,
page, page,
signal, signal,
@@ -31,7 +31,7 @@ export const driveGetSearchPost = async function ({
signal: AbortSignal; signal: AbortSignal;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl } = providerContext; const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl('drive'); const baseUrl = await getBaseUrl("drive");
const url = `${baseUrl}page/${page}/?s=${searchQuery}`; const url = `${baseUrl}page/${page}/?s=${searchQuery}`;
return posts({ url, signal, providerContext }); return posts({ url, signal, providerContext });
}; };
@@ -51,15 +51,15 @@ async function posts({
const data = await res.text(); const data = await res.text();
const $ = cheerio.load(data); const $ = cheerio.load(data);
const catalog: Post[] = []; const catalog: Post[] = [];
$('.recent-movies') $(".recent-movies")
.children() .children()
.map((i, element) => { .map((i, element) => {
const title = $(element).find('figure').find('img').attr('alt'); const title = $(element).find("figure").find("img").attr("alt");
const link = $(element).find('a').attr('href'); const link = $(element).find("a").attr("href");
const image = $(element).find('figure').find('img').attr('src'); const image = $(element).find("figure").find("img").attr("src");
if (title && link && image) { if (title && link && image) {
catalog.push({ catalog.push({
title: title.replace('Download', '').trim(), title: title.replace("Download", "").trim(),
link: link, link: link,
image: image, image: image,
}); });
@@ -67,7 +67,7 @@ async function posts({
}); });
return catalog; return catalog;
} catch (err) { } catch (err) {
console.error('drive error ', err); console.error("drive error ", err);
return []; return [];
} }
} }

View File

@@ -1,6 +1,6 @@
import {Stream, ProviderContext} from '../types'; import { Stream, ProviderContext } from "../types";
export const driveGetStream = async function ({ export const getStream = async function ({
link: url, link: url,
type, type,
signal, signal,
@@ -13,20 +13,20 @@ export const driveGetStream = async function ({
}): Promise<Stream[]> { }): Promise<Stream[]> {
const headers = providerContext.commonHeaders; const headers = providerContext.commonHeaders;
try { try {
if (type === 'movie') { if (type === "movie") {
const res = await providerContext.axios.get(url, { headers }); const res = await providerContext.axios.get(url, { headers });
const html = res.data; const html = res.data;
const $ = providerContext.cheerio.load(html); const $ = providerContext.cheerio.load(html);
const link = $('a:contains("HubCloud")').attr('href'); const link = $('a:contains("HubCloud")').attr("href");
url = link || url; url = link || url;
} }
const res = await providerContext.axios.get(url, { headers }); const res = await providerContext.axios.get(url, { headers });
let redirectUrl = res.data.match( let redirectUrl = res.data.match(
/<meta\s+http-equiv="refresh"\s+content="[^"]*?;\s*url=([^"]+)"\s*\/?>/i, /<meta\s+http-equiv="refresh"\s+content="[^"]*?;\s*url=([^"]+)"\s*\/?>/i
)?.[1]; )?.[1];
if (url.includes('/archives/')) { if (url.includes("/archives/")) {
redirectUrl = res.data.match( redirectUrl = res.data.match(
/<a\s+[^>]*href="(https:\/\/hubcloud\.[^\/]+\/[^"]+)"/i, /<a\s+[^>]*href="(https:\/\/hubcloud\.[^\/]+\/[^"]+)"/i
)?.[1]; )?.[1];
} }
if (!redirectUrl) { if (!redirectUrl) {
@@ -35,13 +35,13 @@ export const driveGetStream = async function ({
const res2 = await providerContext.axios.get(redirectUrl, { headers }); const res2 = await providerContext.axios.get(redirectUrl, { headers });
const data = res2.data; const data = res2.data;
const $ = providerContext.cheerio.load(data); const $ = providerContext.cheerio.load(data);
const hubcloudLink = $('.fa-file-download').parent().attr('href'); const hubcloudLink = $(".fa-file-download").parent().attr("href");
return await providerContext.extractors.hubcloudExtracter( return await providerContext.extractors.hubcloudExtracter(
hubcloudLink?.includes('https://hubcloud') ? hubcloudLink : redirectUrl, hubcloudLink?.includes("https://hubcloud") ? hubcloudLink : redirectUrl,
signal, signal
); );
} catch (err) { } catch (err) {
console.error('Movies Drive err', err); console.error("Movies Drive err", err);
return []; return [];
} }
}; };

View File

@@ -0,0 +1,16 @@
export const catalog = [
{
title: "Home",
filter: "",
},
{
title: "Web Series",
filter: "/page-cat/42/Web-Series.html",
},
{
title: "Hollywood",
filter: "/page-cat/9/New-Hollywood-Hindi-Dubbed-Movie-2016-2025.html",
},
];
export const genres = [];

View File

@@ -1,6 +1,6 @@
import {EpisodeLink, ProviderContext} from '../types'; import { EpisodeLink, ProviderContext } from "../types";
export const ffEpisodeLinks = async function ({ export const getEpisodes = async function ({
url, url,
providerContext, providerContext,
}: { }: {
@@ -15,13 +15,13 @@ export const ffEpisodeLinks = async function ({
const $ = cheerio.load(data); const $ = cheerio.load(data);
const episodeLinks: EpisodeLink[] = []; const episodeLinks: EpisodeLink[] = [];
$('.dlink.dl').map((i, element) => { $(".dlink.dl").map((i, element) => {
const title = $(element) const title = $(element)
.find('a') .find("a")
.text() .text()
?.replace('Download', '') ?.replace("Download", "")
?.trim(); ?.trim();
const link = $(element).find('a').attr('href'); const link = $(element).find("a").attr("href");
if (title && link) { if (title && link) {
episodeLinks.push({ episodeLinks.push({
@@ -32,7 +32,7 @@ export const ffEpisodeLinks = async function ({
}); });
return episodeLinks; return episodeLinks;
} catch (err) { } catch (err) {
console.error('cl episode links', err); console.error("cl episode links", err);
return []; return [];
} }
}; };

View File

@@ -1,16 +0,0 @@
export const ffCatalog = [
{
title: 'Home',
filter: '',
},
{
title: 'Web Series',
filter: '/page-cat/42/Web-Series.html',
},
{
title: 'Hollywood',
filter: '/page-cat/9/New-Hollywood-Hindi-Dubbed-Movie-2016-2025.html',
},
];
export const ffGenresList = [];

View File

@@ -1,56 +0,0 @@
import {Info, Link, ProviderContext} from '../types';
export const ffGetInfo = async function ({
link,
providerContext,
}: {
link: string;
providerContext: ProviderContext;
}): Promise<Info> {
try {
const {axios, cheerio, commonHeaders: headers} = providerContext;
const url = link;
const res = await axios.get(url, {headers});
const data = res.data;
const $ = cheerio.load(data);
const type = url.includes('tvshows') ? 'series' : 'movie';
const imdbId = '';
const title = $('.fname:contains("Name")').find('.colora').text().trim();
const image = $('.ss').find('img').attr('src') || '';
const synopsis = $('.fname:contains("Description")')
.find('.colorg')
.text()
.trim();
const tags =
$('.fname:contains("Genre")').find('.colorb').text().split(',') || [];
const rating = '';
const links: Link[] = [];
const downloadLink = $('.dlbtn').find('a').attr('href');
if (downloadLink) {
links.push({
title: title,
episodesLink: downloadLink,
});
}
return {
title,
tags,
rating,
synopsis,
image,
imdbId,
type,
linkList: links,
};
} catch (err) {
console.error(err);
return {
title: '',
synopsis: '',
image: '',
imdbId: '',
type: 'movie',
linkList: [],
};
}
};

View File

@@ -1,16 +0,0 @@
import {ProviderType} from '../types';
import {ffCatalog, ffGenresList} from './ffCatalog';
import {ffEpisodeLinks} from './ffGetEpisodes';
import {ffGetInfo} from './ffGetMeta';
import {ffGetPosts, ffGetPostsSearch} from './ffGetPosts';
import {ffGetStream} from './ffGetStream';
export const filmyfly: ProviderType = {
catalog: ffCatalog,
genres: ffGenresList,
GetHomePosts: ffGetPosts,
GetMetaData: ffGetInfo,
GetSearchPosts: ffGetPostsSearch,
GetEpisodeLinks: ffEpisodeLinks,
GetStream: ffGetStream,
};

View File

@@ -0,0 +1,56 @@
import { Info, Link, ProviderContext } from "../types";
export const getMeta = async function ({
link,
providerContext,
}: {
link: string;
providerContext: ProviderContext;
}): Promise<Info> {
try {
const { axios, cheerio, commonHeaders: headers } = providerContext;
const url = link;
const res = await axios.get(url, { headers });
const data = res.data;
const $ = cheerio.load(data);
const type = url.includes("tvshows") ? "series" : "movie";
const imdbId = "";
const title = $('.fname:contains("Name")').find(".colora").text().trim();
const image = $(".ss").find("img").attr("src") || "";
const synopsis = $('.fname:contains("Description")')
.find(".colorg")
.text()
.trim();
const tags =
$('.fname:contains("Genre")').find(".colorb").text().split(",") || [];
const rating = "";
const links: Link[] = [];
const downloadLink = $(".dlbtn").find("a").attr("href");
if (downloadLink) {
links.push({
title: title,
episodesLink: downloadLink,
});
}
return {
title,
tags,
rating,
synopsis,
image,
imdbId,
type,
linkList: links,
};
} catch (err) {
console.error(err);
return {
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 ffGetPosts = async function ({ export const getPosts = async function ({
filter, filter,
page, page,
signal, signal,
@@ -13,12 +13,12 @@ export const ffGetPosts = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl } = providerContext; const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl('filmyfly'); const baseUrl = await getBaseUrl("filmyfly");
const url = `${baseUrl + filter}/${page}`; const url = `${baseUrl + filter}/${page}`;
return posts({ url, signal, baseUrl, providerContext }); return posts({ url, signal, baseUrl, providerContext });
}; };
export const ffGetPostsSearch = async function ({ export const getSearchPosts = async function ({
searchQuery, searchQuery,
page, page,
signal, signal,
@@ -31,7 +31,7 @@ export const ffGetPostsSearch = async function ({
signal: AbortSignal; signal: AbortSignal;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl } = providerContext; const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl('filmyfly'); const baseUrl = await getBaseUrl("filmyfly");
const url = `${baseUrl}/site-1.html?to-search=${searchQuery}`; const url = `${baseUrl}/site-1.html?to-search=${searchQuery}`;
if (page > 1) { if (page > 1) {
return []; return [];
@@ -56,11 +56,11 @@ async function posts({
const data = await res.text(); const data = await res.text();
const $ = cheerio.load(data); const $ = cheerio.load(data);
const catalog: Post[] = []; const catalog: Post[] = [];
$('.A2,.A10,.fl').map((i, element) => { $(".A2,.A10,.fl").map((i, element) => {
const title = const title =
$(element).find('a').eq(1).text() || $(element).find('b').text(); $(element).find("a").eq(1).text() || $(element).find("b").text();
const link = $(element).find('a').attr('href'); const link = $(element).find("a").attr("href");
const image = $(element).find('img').attr('src'); const image = $(element).find("img").attr("src");
if (title && link && image) { if (title && link && image) {
catalog.push({ catalog.push({
title: title, title: title,
@@ -71,7 +71,7 @@ async function posts({
}); });
return catalog; return catalog;
} catch (err) { } catch (err) {
console.error('ff error ', err); console.error("ff error ", err);
return []; return [];
} }
} }

View File

@@ -1,6 +1,6 @@
import {Stream, ProviderContext} from '../types'; import { Stream, ProviderContext } from "../types";
export const ffGetStream = async function ({ export const getStream = async function ({
link, link,
signal, signal,
providerContext, providerContext,
@@ -15,30 +15,30 @@ export const ffGetStream = async function ({
const data = res.data; const data = res.data;
const $ = providerContext.cheerio.load(data); const $ = providerContext.cheerio.load(data);
const streams: Stream[] = []; const streams: Stream[] = [];
const elements = $('.button2,.button1,.button3,.button4,.button').toArray(); const elements = $(".button2,.button1,.button3,.button4,.button").toArray();
const promises = elements.map(async element => { const promises = elements.map(async (element) => {
const title = $(element).text(); const title = $(element).text();
let link = $(element).attr('href'); let link = $(element).attr("href");
if (title.includes('GDFLIX') && link) { if (title.includes("GDFLIX") && link) {
const gdLinks = await providerContext.extractors.gdFlixExtracter( const gdLinks = await providerContext.extractors.gdFlixExtracter(
link, link,
signal, signal
); );
streams.push(...gdLinks); streams.push(...gdLinks);
} }
const alreadyAdded = streams.find(s => s.link === link); const alreadyAdded = streams.find((s) => s.link === link);
if ( if (
title && title &&
link && link &&
!title.includes('Watch') && !title.includes("Watch") &&
!title.includes('Login') && !title.includes("Login") &&
!title.includes('GoFile') && !title.includes("GoFile") &&
!alreadyAdded !alreadyAdded
) { ) {
streams.push({ streams.push({
server: title, server: title,
link: link, link: link,
type: 'mkv', type: "mkv",
}); });
} }
}); });

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, link: id,
providerContext, providerContext,
}: { }: {
@@ -9,27 +9,27 @@ export const flixhqGetInfo = async function ({
}): Promise<Info> { }): Promise<Info> {
try { try {
const { axios, getBaseUrl } = providerContext; const { axios, getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl('consumet'); const baseUrl = await getBaseUrl("consumet");
const url = `${baseUrl}/movies/flixhq/info?id=` + id; const url = `${baseUrl}/movies/flixhq/info?id=` + id;
const res = await axios.get(url); const res = await axios.get(url);
const data = res.data; const data = res.data;
const meta = { const meta = {
title: data.title, title: data.title,
synopsis: data.description.replace(/<[^>]*>?/gm, '').trim(), synopsis: data.description.replace(/<[^>]*>?/gm, "").trim(),
image: data.cover, image: data.cover,
cast: data.casts, cast: data.casts,
rating: data.rating, rating: data.rating,
tags: [data?.type, data?.duration, data.releaseDate.split('-')[0]], tags: [data?.type, data?.duration, data.releaseDate.split("-")[0]],
imdbId: '', imdbId: "",
type: data.episodes.length > 1 ? 'series' : 'movie', type: data.episodes.length > 1 ? "series" : "movie",
}; };
const links: Link['directLinks'] = []; const links: Link["directLinks"] = [];
data.episodes.forEach((episode: any) => { data.episodes.forEach((episode: any) => {
const title = episode?.number const title = episode?.number
? 'Season-' + episode?.season + ' Ep-' + episode.number ? "Season-" + episode?.season + " Ep-" + episode.number
: episode.title; : episode.title;
const link = episode.id + '*' + data.id; const link = episode.id + "*" + data.id;
if (link && title) { if (link && title) {
links.push({ links.push({
title, title,
@@ -50,11 +50,11 @@ export const flixhqGetInfo = async function ({
} catch (err) { } catch (err) {
console.error(err); console.error(err);
return { return {
title: '', title: "",
synopsis: '', synopsis: "",
image: '', image: "",
imdbId: '', imdbId: "",
type: 'movie', type: "movie",
linkList: [], 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, filter,
signal, signal,
providerContext, providerContext,
@@ -12,13 +12,13 @@ export const flixhqGetPosts = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl } = providerContext; const { getBaseUrl } = providerContext;
const urlRes = await getBaseUrl('consumet'); const urlRes = await getBaseUrl("consumet");
const baseUrl = urlRes + '/movies/flixhq'; const baseUrl = urlRes + "/movies/flixhq";
const url = `${baseUrl + filter}`; 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, searchQuery,
page, page,
signal, signal,
@@ -31,8 +31,8 @@ export const flixhqGetSearchPost = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl } = providerContext; const { getBaseUrl } = providerContext;
const urlRes = await getBaseUrl('consumet'); const urlRes = await getBaseUrl("consumet");
const baseUrl = urlRes + '/movies/flixhq'; const baseUrl = urlRes + "/movies/flixhq";
const url = `${baseUrl}/${searchQuery}?page=${page}`; const url = `${baseUrl}/${searchQuery}?page=${page}`;
return posts({ url, signal, providerContext }); return posts({ url, signal, providerContext });
}; };
@@ -65,7 +65,7 @@ async function posts({
}); });
return catalog; return catalog;
} catch (err) { } catch (err) {
console.error('flixhq error ', err); console.error("flixhq error ", err);
return []; 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, link: id,
providerContext, providerContext,
}: { }: {
@@ -9,9 +9,9 @@ export const flixhqGetStream = async function ({
}): Promise<Stream[]> { }): Promise<Stream[]> {
try { try {
const { getBaseUrl } = providerContext; const { getBaseUrl } = providerContext;
const episodeId = id.split('*')[0]; const episodeId = id.split("*")[0];
const mediaId = id.split('*')[1]; const mediaId = id.split("*")[1];
const baseUrl = await getBaseUrl('consumet'); const baseUrl = await getBaseUrl("consumet");
const serverUrl = `${baseUrl}/movies/flixhq/servers?episodeId=${episodeId}&mediaId=${mediaId}`; const serverUrl = `${baseUrl}/movies/flixhq/servers?episodeId=${episodeId}&mediaId=${mediaId}`;
const res = await fetch(serverUrl); const res = await fetch(serverUrl);
const servers = await res.json(); const servers = await res.json();
@@ -20,13 +20,13 @@ export const flixhqGetStream = async function ({
const streamUrl = const streamUrl =
`${baseUrl}/movies/flixhq/watch?server=` + `${baseUrl}/movies/flixhq/watch?server=` +
server.name + server.name +
'&episodeId=' + "&episodeId=" +
episodeId + episodeId +
'&mediaId=' + "&mediaId=" +
mediaId; mediaId;
const streamRes = await fetch(streamUrl); const streamRes = await fetch(streamUrl);
const streamData = await streamRes.json(); const streamData = await streamRes.json();
const subtitles: Stream['subtitles'] = []; const subtitles: Stream["subtitles"] = [];
if (streamData?.sources?.length > 0) { if (streamData?.sources?.length > 0) {
if (streamData.subtitles) { if (streamData.subtitles) {
streamData.subtitles.forEach((sub: { lang: string; url: string }) => { streamData.subtitles.forEach((sub: { lang: string; url: string }) => {
@@ -42,10 +42,10 @@ export const flixhqGetStream = async function ({
streamLinks.push({ streamLinks.push({
server: server:
server?.name + server?.name +
'-' + "-" +
source?.quality?.replace('auto', 'MultiQuality'), source?.quality?.replace("auto", "MultiQuality"),
link: source.url, link: source.url,
type: source.isM3U8 ? 'm3u8' : 'mp4', type: source.isM3U8 ? "m3u8" : "mp4",
subtitles: subtitles, subtitles: subtitles,
}); });
}); });

View File

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

View File

@@ -1,12 +0,0 @@
export const guardahdCatalog = [
{
title: 'Popular Movies',
filter: '/top/catalog/movie/top.json',
},
{
title: 'Featured Movies',
filter: '/imdbRating/catalog/movie/imdbRating.json',
},
];
export const guardahdGenresList = [];

View File

@@ -1,44 +0,0 @@
import {Post, ProviderContext} from '../types';
export const guardahdGetSearchPosts = async function ({
searchQuery,
page,
signal,
providerContext,
}: {
searchQuery: string;
page: number;
providerValue: string;
providerContext: ProviderContext;
signal: AbortSignal;
}): Promise<Post[]> {
try {
const {axios, commonHeaders: headers} = providerContext;
if (page > 1) {
return [];
}
const catalog: Post[] = [];
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: any) => {
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 [];
}
};

View File

@@ -1,15 +0,0 @@
import {guardahdCatalog, guardahdGenresList} from './guardahdCatalog';
import {allGetInfo} from '../autoEmbed/allGetInfo';
import {allGetPost} from '../autoEmbed/allGetPost';
import {guardahdGetSearchPosts} from './guardahdGetPosts';
import {ProviderType} from '../types';
import {GuardahdGetStream} from './GetGuardahdStream';
export const guardahd: ProviderType = {
catalog: guardahdCatalog,
genres: guardahdGenresList,
GetMetaData: allGetInfo,
GetHomePosts: allGetPost,
GetStream: GuardahdGetStream,
GetSearchPosts: guardahdGetSearchPosts,
};

View File

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

View File

@@ -0,0 +1,85 @@
import { Post, ProviderContext } from "../types";
export const getPosts = async function ({
filter,
signal,
providerContext,
}: {
filter: string;
page: number;
providerValue: string;
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
try {
const catalog: Post[] = [];
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: any) => {
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 [];
}
};
export const getSearchPosts = async function ({
searchQuery,
page,
signal,
providerContext,
}: {
searchQuery: string;
page: number;
providerValue: string;
providerContext: ProviderContext;
signal: AbortSignal;
}): Promise<Post[]> {
try {
const { axios, commonHeaders: headers } = providerContext;
if (page > 1) {
return [];
}
const catalog: Post[] = [];
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: any) => {
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 [];
}
};

View File

@@ -1,6 +1,6 @@
import {ProviderContext, Stream} from '../types'; import { ProviderContext, Stream } from "../types";
export const GuardahdGetStream = async function ({ export const getStream = async function ({
link: id, link: id,
type, type,
providerContext, providerContext,
@@ -13,26 +13,25 @@ export const GuardahdGetStream = async function ({
const { axios, cheerio, extractors } = providerContext; const { axios, cheerio, extractors } = providerContext;
const { superVideoExtractor } = extractors; const { superVideoExtractor } = extractors;
async function ExtractGuardahd({ async function ExtractGuardahd({
imdb, // type, imdb, // type, // season,
// episode, }: // episode,
} // season, {
: {
imdb: string; imdb: string;
type: string; type: string;
season: string; season: string;
episode: string; episode: string;
}) { }) {
try { try {
const baseUrl = 'https://guardahd.stream'; const baseUrl = "https://guardahd.stream";
const path = '/set-movie-a/' + imdb; const path = "/set-movie-a/" + imdb;
const url = baseUrl + path; const url = baseUrl + path;
console.log('url:', url); console.log("url:", url);
const res = await axios.get(url, { timeout: 4000 }); const res = await axios.get(url, { timeout: 4000 });
const html = res.data; const html = res.data;
const $ = cheerio.load(html); const $ = cheerio.load(html);
const superVideoUrl = $('li:contains("supervideo")').attr('data-link'); const superVideoUrl = $('li:contains("supervideo")').attr("data-link");
console.log('superVideoUrl:', superVideoUrl); console.log("superVideoUrl:", superVideoUrl);
if (!superVideoUrl) { if (!superVideoUrl) {
return null; return null;
@@ -40,13 +39,13 @@ export const GuardahdGetStream = async function ({
const controller2 = new AbortController(); const controller2 = new AbortController();
const signal2 = controller2.signal; const signal2 = controller2.signal;
setTimeout(() => controller2.abort(), 4000); setTimeout(() => controller2.abort(), 4000);
const res2 = await fetch('https:' + superVideoUrl, {signal: signal2}); const res2 = await fetch("https:" + superVideoUrl, { signal: signal2 });
const data = await res2.text(); const data = await res2.text();
// console.log('mostraguarda data:', data); // console.log('mostraguarda data:', data);
const streamUrl = await superVideoExtractor(data); const streamUrl = await superVideoExtractor(data);
return streamUrl; return streamUrl;
} catch (err) { } catch (err) {
console.error('Error in GetMostraguardaStram:', err); console.error("Error in GetMostraguardaStram:", err);
} }
} }
async function GetMostraguardaStream({ async function GetMostraguardaStream({
@@ -61,20 +60,20 @@ export const GuardahdGetStream = async function ({
episode: string; episode: string;
}) { }) {
try { try {
const baseUrl = 'https://mostraguarda.stream'; const baseUrl = "https://mostraguarda.stream";
const path = const path =
type === 'tv' type === "tv"
? `/serie/${imdb}/${season}/${episode}` ? `/serie/${imdb}/${season}/${episode}`
: `/movie/${imdb}`; : `/movie/${imdb}`;
const url = baseUrl + path; const url = baseUrl + path;
console.log('url:', url); console.log("url:", url);
const res = await axios(url, { timeout: 4000 }); const res = await axios(url, { timeout: 4000 });
const html = res.data; const html = res.data;
const $ = cheerio.load(html); const $ = cheerio.load(html);
const superVideoUrl = $('li:contains("supervideo")').attr('data-link'); const superVideoUrl = $('li:contains("supervideo")').attr("data-link");
console.log('superVideoUrl:', superVideoUrl); console.log("superVideoUrl:", superVideoUrl);
if (!superVideoUrl) { if (!superVideoUrl) {
return null; return null;
@@ -82,13 +81,13 @@ export const GuardahdGetStream = async function ({
const controller2 = new AbortController(); const controller2 = new AbortController();
const signal2 = controller2.signal; const signal2 = controller2.signal;
setTimeout(() => controller2.abort(), 4000); setTimeout(() => controller2.abort(), 4000);
const res2 = await fetch('https:' + superVideoUrl, {signal: signal2}); const res2 = await fetch("https:" + superVideoUrl, { signal: signal2 });
const data = await res2.text(); const data = await res2.text();
// console.log('mostraguarda data:', data); // console.log('mostraguarda data:', data);
const streamUrl = await superVideoExtractor(data); const streamUrl = await superVideoExtractor(data);
return streamUrl; return streamUrl;
} catch (err) { } catch (err) {
console.error('Error in GetMostraguardaStram:', err); console.error("Error in GetMostraguardaStram:", err);
} }
} }
console.log(id); console.log(id);
@@ -104,9 +103,9 @@ export const GuardahdGetStream = async function ({
}); });
if (mostraguardaStream) { if (mostraguardaStream) {
streams.push({ streams.push({
server: 'Supervideo 1', server: "Supervideo 1",
link: mostraguardaStream, link: mostraguardaStream,
type: 'm3u8', type: "m3u8",
}); });
} }
@@ -119,9 +118,9 @@ export const GuardahdGetStream = async function ({
if (guardahdStream) { if (guardahdStream) {
streams.push({ streams.push({
server: 'Supervideo 2', server: "Supervideo 2",
link: guardahdStream, link: guardahdStream,
type: 'm3u8', type: "m3u8",
}); });
} }

View File

@@ -0,0 +1,61 @@
export const catalog = [
{
title: "Latest",
filter: "",
},
{
title: "Web Series",
filter: "/category/web-series",
},
{
title: "Hollywood ",
filter: "/category/hollywood-movies",
},
{
title: "South Movies",
filter: "/category/south-hindi-movies",
},
];
export const genres = [
{
title: "Action",
filter: "/category/action",
},
{
title: "Crime",
filter: "/category/crime",
},
{
title: "Comedy",
filter: "/category/comedy",
},
{
title: "Drama",
filter: "/category/drama",
},
{
title: "Horror",
filter: "/category/horror",
},
{
title: "Family",
filter: "/category/family",
},
{
title: "Sci-Fi",
filter: "/category/sifi",
},
{
title: "Thriller",
filter: "/category/triller",
},
{
title: "Romance",
filter: "/category/romance",
},
{
title: "Fight",
filter: "/category/fight",
},
];

View File

@@ -1,61 +0,0 @@
export const hdhub4uCatalog = [
{
title: 'Latest',
filter: '',
},
{
title: 'Web Series',
filter: '/category/web-series',
},
{
title: 'Hollywood ',
filter: '/category/hollywood-movies',
},
{
title: 'South Movies',
filter: '/category/south-hindi-movies',
},
];
export const hdhub4uGenresList = [
{
title: 'Action',
filter: '/category/action',
},
{
title: 'Crime',
filter: '/category/crime',
},
{
title: 'Comedy',
filter: '/category/comedy',
},
{
title: 'Drama',
filter: '/category/drama',
},
{
title: 'Horror',
filter: '/category/horror',
},
{
title: 'Family',
filter: '/category/family',
},
{
title: 'Sci-Fi',
filter: '/category/sifi',
},
{
title: 'Thriller',
filter: '/category/triller',
},
{
title: 'Romance',
filter: '/category/romance',
},
{
title: 'Fight',
filter: '/category/fight',
},
];

View File

@@ -1,14 +0,0 @@
import {hdhub4uCatalog, hdhub4uGenresList} from './hdhubCatalog';
import {hdhub4uGetInfo} from './hdhubGetInfo';
import {hdhub4uGetStream} from './hdhub4uGetSteam';
import {hdhubGetPosts, hdhubGetPostsSearch} from './hdhubGetPosts';
import {ProviderType} from '../types';
export const hdhub4uProvider: ProviderType = {
catalog: hdhub4uCatalog,
genres: hdhub4uGenresList,
GetMetaData: hdhub4uGetInfo,
GetStream: hdhub4uGetStream,
GetHomePosts: hdhubGetPosts,
GetSearchPosts: hdhubGetPostsSearch,
};

View File

@@ -1,12 +1,12 @@
import {Info, Link, ProviderContext} from '../types'; import { Info, Link, ProviderContext } from "../types";
const hdbHeaders = { const hdbHeaders = {
Cookie: 'xla=s4t', Cookie: "xla=s4t",
Referer: 'https://google.com', Referer: "https://google.com",
'User-Agent': "User-Agent":
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0', "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0",
}; };
export const hdhub4uGetInfo = async function ({ export const getMeta = async function ({
link, link,
providerContext, providerContext,
}: { }: {
@@ -19,30 +19,30 @@ export const hdhub4uGetInfo = async function ({
const res = await axios.get(url, { headers: hdbHeaders }); const res = await axios.get(url, { headers: hdbHeaders });
const data = res.data; const data = res.data;
const $ = cheerio.load(data); const $ = cheerio.load(data);
const container = $('.page-body'); const container = $(".page-body");
const imdbId = const imdbId =
container container
.find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])') .find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])')
.attr('href') .attr("href")
?.split('/')[4] || ''; ?.split("/")[4] || "";
const title = container const title = container
.find( .find(
'h2[data-ved="2ahUKEwjL0NrBk4vnAhWlH7cAHRCeAlwQ3B0oATAfegQIFBAM"],h2[data-ved="2ahUKEwiP0pGdlermAhUFYVAKHV8tAmgQ3B0oATAZegQIDhAM"]', 'h2[data-ved="2ahUKEwjL0NrBk4vnAhWlH7cAHRCeAlwQ3B0oATAfegQIFBAM"],h2[data-ved="2ahUKEwiP0pGdlermAhUFYVAKHV8tAmgQ3B0oATAZegQIDhAM"]'
) )
.text(); .text();
const type = title.toLocaleLowerCase().includes('season') const type = title.toLocaleLowerCase().includes("season")
? 'series' ? "series"
: 'movie'; : "movie";
const synopsis = container const synopsis = container
.find('strong:contains("DESCRIPTION")') .find('strong:contains("DESCRIPTION")')
.parent() .parent()
.text() .text()
.replace('DESCRIPTION:', ''); .replace("DESCRIPTION:", "");
const image = container.find('img[decoding="async"]').attr('src') || ''; const image = container.find('img[decoding="async"]').attr("src") || "";
// Links // Links
const links: Link[] = []; const links: Link[] = [];
const directLink: Link['directLinks'] = []; const directLink: Link["directLinks"] = [];
// direct link type // direct link type
$('strong:contains("EPiSODE")').map((i, element) => { $('strong:contains("EPiSODE")').map((i, element) => {
@@ -54,9 +54,9 @@ export const hdhub4uGetInfo = async function ({
.parent() .parent()
.next() .next()
.next() .next()
.find('a') .find("a")
.attr('href') || .attr("href") ||
$(element).parent().parent().parent().next().find('a').attr('href'); $(element).parent().parent().parent().next().find("a").attr("href");
if (episodesLink && episodesLink) { if (episodesLink && episodesLink) {
directLink.push({ directLink.push({
@@ -69,7 +69,7 @@ export const hdhub4uGetInfo = async function ({
if (directLink.length === 0) { if (directLink.length === 0) {
container.find('a:contains("EPiSODE")').map((i, element) => { container.find('a:contains("EPiSODE")').map((i, element) => {
const epTitle = $(element).text(); const epTitle = $(element).text();
const episodesLink = $(element).attr('href'); const episodesLink = $(element).attr("href");
if (episodesLink) { if (episodesLink) {
directLink.push({ directLink.push({
title: epTitle.toLocaleUpperCase(), title: epTitle.toLocaleUpperCase(),
@@ -87,18 +87,20 @@ export const hdhub4uGetInfo = async function ({
if (directLink.length === 0) { if (directLink.length === 0) {
container container
.find( .find(
'a:contains("480"),a:contains("720"),a:contains("1080"),a:contains("2160"),a:contains("4K")', 'a:contains("480"),a:contains("720"),a:contains("1080"),a:contains("2160"),a:contains("4K")'
) )
.map((i, element) => { .map((i, element) => {
const quality = const quality =
$(element) $(element)
.text() .text()
.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || ''; .match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || "";
const movieLinks = $(element).attr('href'); const movieLinks = $(element).attr("href");
const title = $(element).text(); const title = $(element).text();
if (movieLinks) { if (movieLinks) {
links.push({ links.push({
directLinks: [{link: movieLinks, title: 'Movie', type: 'movie'}], directLinks: [
{ link: movieLinks, title: "Movie", type: "movie" },
],
quality: quality, quality: quality,
title: title, title: title,
}); });
@@ -118,11 +120,11 @@ export const hdhub4uGetInfo = async function ({
} catch (err) { } catch (err) {
console.error(err); console.error(err);
return { return {
title: '', title: "",
synopsis: '', synopsis: "",
image: '', image: "",
imdbId: '', imdbId: "",
type: 'movie', type: "movie",
linkList: [], linkList: [],
}; };
} }

View File

@@ -1,13 +1,13 @@
import {Post, ProviderContext} from '../types'; import { Post, ProviderContext } from "../types";
const hdbHeaders = { const hdbHeaders = {
Cookie: 'xla=s4t', Cookie: "xla=s4t",
Referer: 'https://google.com', Referer: "https://google.com",
'User-Agent': "User-Agent":
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0', "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0",
}; };
export const hdhubGetPosts = async function ({ export const getPosts = async function ({
filter, filter,
page, page,
signal, signal,
@@ -20,12 +20,12 @@ export const hdhubGetPosts = async function ({
signal: AbortSignal; signal: AbortSignal;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl } = providerContext; const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl('hdhub'); const baseUrl = await getBaseUrl("hdhub");
const url = `${baseUrl + filter}/page/${page}/`; const url = `${baseUrl + filter}/page/${page}/`;
return posts({ url, signal, providerContext }); return posts({ url, signal, providerContext });
}; };
export const hdhubGetPostsSearch = async function ({ export const getSearchPosts = async function ({
searchQuery, searchQuery,
page, page,
signal, signal,
@@ -38,7 +38,7 @@ export const hdhubGetPostsSearch = async function ({
signal: AbortSignal; signal: AbortSignal;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl } = providerContext; const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl('hdhub'); const baseUrl = await getBaseUrl("hdhub");
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`; const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
return posts({ url, signal, providerContext }); return posts({ url, signal, providerContext });
}; };
@@ -61,16 +61,16 @@ async function posts({
const data = await res.text(); const data = await res.text();
const $ = cheerio.load(data); const $ = cheerio.load(data);
const catalog: Post[] = []; const catalog: Post[] = [];
$('.recent-movies') $(".recent-movies")
.children() .children()
.map((i, element) => { .map((i, element) => {
const title = $(element).find('figure').find('img').attr('alt'); const title = $(element).find("figure").find("img").attr("alt");
const link = $(element).find('a').attr('href'); const link = $(element).find("a").attr("href");
const image = $(element).find('figure').find('img').attr('src'); const image = $(element).find("figure").find("img").attr("src");
if (title && link && image) { if (title && link && image) {
catalog.push({ catalog.push({
title: title.replace('Download', '').trim(), title: title.replace("Download", "").trim(),
link: link, link: link,
image: image, image: image,
}); });
@@ -78,7 +78,7 @@ async function posts({
}); });
return catalog; return catalog;
} catch (err) { } catch (err) {
console.error('hdhubGetPosts error ', err); console.error("hdhubGetPosts error ", err);
return []; return [];
} }
} }

View File

@@ -1,6 +1,6 @@
import {ProviderContext} from '../types'; import { ProviderContext } from "../types";
export async function hdhub4uGetStream({ export async function getStream({
link, link,
signal, signal,
providerContext, providerContext,
@@ -10,15 +10,20 @@ export async function hdhub4uGetStream({
signal: AbortSignal; signal: AbortSignal;
providerContext: ProviderContext; providerContext: ProviderContext;
}) { }) {
const {axios, cheerio, extractors, commonHeaders: headers} = providerContext; const {
axios,
cheerio,
extractors,
commonHeaders: headers,
} = providerContext;
const { hubcloudExtracter } = extractors; const { hubcloudExtracter } = extractors;
let hubdriveLink = ''; let hubdriveLink = "";
if (link.includes('hubdrive')) { if (link.includes("hubdrive")) {
const hubdriveRes = await axios.get(link, { headers, signal }); const hubdriveRes = await axios.get(link, { headers, signal });
const hubdriveText = hubdriveRes.data; const hubdriveText = hubdriveRes.data;
const $ = cheerio.load(hubdriveText); const $ = cheerio.load(hubdriveText);
hubdriveLink = hubdriveLink =
$('.btn.btn-primary.btn-user.btn-success1.m-1').attr('href') || link; $(".btn.btn-primary.btn-user.btn-success1.m-1").attr("href") || link;
} else { } else {
const res = await axios.get(link, { headers, signal }); const res = await axios.get(link, { headers, signal });
const text = res.data; const text = res.data;
@@ -30,16 +35,16 @@ export async function hdhub4uGetStream({
const redirectLinkText = redirectLinkRes.data; const redirectLinkText = redirectLinkRes.data;
const $ = cheerio.load(redirectLinkText); const $ = cheerio.load(redirectLinkText);
hubdriveLink = hubdriveLink =
$('h3:contains("1080p")').find('a').attr('href') || $('h3:contains("1080p")').find("a").attr("href") ||
redirectLinkText.match( redirectLinkText.match(
/href="(https:\/\/hubcloud\.[^\/]+\/drive\/[^"]+)"/, /href="(https:\/\/hubcloud\.[^\/]+\/drive\/[^"]+)"/
)[1]; )[1];
if (hubdriveLink.includes('hubdrive')) { if (hubdriveLink.includes("hubdrive")) {
const hubdriveRes = await axios.get(hubdriveLink, { headers, signal }); const hubdriveRes = await axios.get(hubdriveLink, { headers, signal });
const hubdriveText = hubdriveRes.data; const hubdriveText = hubdriveRes.data;
const $$ = cheerio.load(hubdriveText); const $$ = cheerio.load(hubdriveText);
hubdriveLink = hubdriveLink =
$$('.btn.btn-primary.btn-user.btn-success1.m-1').attr('href') || $$(".btn.btn-primary.btn-user.btn-success1.m-1").attr("href") ||
hubdriveLink; hubdriveLink;
} }
} }
@@ -47,12 +52,12 @@ export async function hdhub4uGetStream({
const hubcloudText = hubdriveLinkRes.data; const hubcloudText = hubdriveLinkRes.data;
const hubcloudLink = const hubcloudLink =
hubcloudText.match( hubcloudText.match(
/<META HTTP-EQUIV="refresh" content="0; url=([^"]+)">/i, /<META HTTP-EQUIV="refresh" content="0; url=([^"]+)">/i
)?.[1] || hubdriveLink; )?.[1] || hubdriveLink;
try { try {
return await hubcloudExtracter(hubcloudLink, signal); return await hubcloudExtracter(hubcloudLink, signal);
} catch (error: any) { } catch (error: any) {
console.log('hd hub 4 getStream error: ', error); console.log("hd hub 4 getStream error: ", error);
return []; return [];
} }
} }
@@ -62,36 +67,36 @@ const encode = function (value: string) {
}; };
const decode = function (value: string) { const decode = function (value: string) {
if (value === undefined) { if (value === undefined) {
return ''; return "";
} }
return atob(value.toString()); return atob(value.toString());
}; };
const pen = function (value: string) { const pen = function (value: string) {
return value.replace(/[a-zA-Z]/g, function (_0x1a470e: any) { return value.replace(/[a-zA-Z]/g, function (_0x1a470e: any) {
return String.fromCharCode( return String.fromCharCode(
(_0x1a470e <= 'Z' ? 90 : 122) >= (_0x1a470e <= "Z" ? 90 : 122) >=
(_0x1a470e = _0x1a470e.charCodeAt(0) + 13) (_0x1a470e = _0x1a470e.charCodeAt(0) + 13)
? _0x1a470e ? _0x1a470e
: _0x1a470e - 26, : _0x1a470e - 26
); );
}); });
}; };
const abortableTimeout = ( const abortableTimeout = (
ms: number, ms: number,
{signal}: {signal?: AbortSignal} = {}, { signal }: { signal?: AbortSignal } = {}
) => { ) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (signal && signal.aborted) { if (signal && signal.aborted) {
return reject(new Error('Aborted')); return reject(new Error("Aborted"));
} }
const timer = setTimeout(resolve, ms); const timer = setTimeout(resolve, ms);
if (signal) { if (signal) {
signal.addEventListener('abort', () => { signal.addEventListener("abort", () => {
clearTimeout(timer); clearTimeout(timer);
reject(new Error('Aborted')); reject(new Error("Aborted"));
}); });
} }
}); });
@@ -100,14 +105,14 @@ const abortableTimeout = (
export async function getRedirectLinks( export async function getRedirectLinks(
link: string, link: string,
signal: AbortSignal, signal: AbortSignal,
headers: any, headers: any
) { ) {
try { try {
const res = await fetch(link, { headers, signal }); const res = await fetch(link, { headers, signal });
const resText = await res.text(); const resText = await res.text();
var regex = /ck\('_wp_http_\d+','([^']+)'/g; var regex = /ck\('_wp_http_\d+','([^']+)'/g;
var combinedString = ''; var combinedString = "";
var match; var match;
while ((match = regex.exec(resText)) !== null) { while ((match = regex.exec(resText)) !== null) {
@@ -120,23 +125,23 @@ export async function getRedirectLinks(
const data = JSON.parse(decodedString); const data = JSON.parse(decodedString);
console.log(data); console.log(data);
const token = encode(data?.data); const token = encode(data?.data);
const blogLink = data?.wp_http1 + '?re=' + token; const blogLink = data?.wp_http1 + "?re=" + token;
// abort timeout on signal // abort timeout on signal
let wait = abortableTimeout((Number(data?.total_time) + 3) * 1000, { let wait = abortableTimeout((Number(data?.total_time) + 3) * 1000, {
signal, signal,
}); });
await wait; await wait;
console.log('blogLink', blogLink); console.log("blogLink", blogLink);
let vcloudLink = 'Invalid Request'; let vcloudLink = "Invalid Request";
while (vcloudLink.includes('Invalid Request')) { while (vcloudLink.includes("Invalid Request")) {
const blogRes = await fetch(blogLink, { headers, signal }); const blogRes = await fetch(blogLink, { headers, signal });
const blogResText = (await blogRes.text()) as any; const blogResText = (await blogRes.text()) as any;
if (blogResText.includes('Invalid Request')) { if (blogResText.includes("Invalid Request")) {
console.log(blogResText); console.log(blogResText);
} else { } else {
vcloudLink = blogResText.match(/var reurl = "([^"]+)"/) || ''; vcloudLink = blogResText.match(/var reurl = "([^"]+)"/) || "";
break; break;
} }
} }
@@ -144,7 +149,7 @@ export async function getRedirectLinks(
// console.log('vcloudLink', vcloudLink?.[1]); // console.log('vcloudLink', vcloudLink?.[1]);
return blogLink || link; return blogLink || link;
} catch (err) { } catch (err) {
console.log('Error in getRedirectLinks', err); console.log("Error in getRedirectLinks", err);
return link; return link;
} }
} }
@@ -152,10 +157,10 @@ export async function getRedirectLinks(
function rot13(str: string) { function rot13(str: string) {
return str.replace(/[a-zA-Z]/g, function (char) { return str.replace(/[a-zA-Z]/g, function (char) {
const charCode = char.charCodeAt(0); const charCode = char.charCodeAt(0);
const isUpperCase = char <= 'Z'; const isUpperCase = char <= "Z";
const baseCharCode = isUpperCase ? 65 : 97; const baseCharCode = isUpperCase ? 65 : 97;
return String.fromCharCode( return String.fromCharCode(
((charCode - baseCharCode + 13) % 26) + baseCharCode, ((charCode - baseCharCode + 13) % 26) + baseCharCode
); );
}); });
} }
@@ -177,7 +182,7 @@ export function decodeString(encryptedString: string) {
// Parse JSON // Parse JSON
return JSON.parse(decoded); return JSON.parse(decoded);
} catch (error) { } catch (error) {
console.error('Error decoding string:', error); console.error("Error decoding string:", error);
return null; return null;
} }
} }

View File

@@ -0,0 +1,20 @@
export const catalogs = [
{
title: "Recent",
filter: "/anime/zoro/recent-episodes",
},
{
title: "Top Airing",
filter: "/anime/zoro/top-airing",
},
{
title: "Most Popular",
filter: "/anime/zoro/most-popular",
},
{
title: "Most Favorited",
filter: "/anime/zoro/most-favorite",
},
];
export const genres = [];

View File

@@ -1,20 +0,0 @@
export const hiCatalog = [
{
title: 'Recent',
filter: '/anime/zoro/recent-episodes',
},
{
title: 'Top Airing',
filter: '/anime/zoro/top-airing',
},
{
title: 'Most Popular',
filter: '/anime/zoro/most-popular',
},
{
title: 'Most Favorited',
filter: '/anime/zoro/most-favorite',
},
];
export const hiGenresList = [];

View File

@@ -1,14 +0,0 @@
import {hiGetInfo} from './hiGetInfo';
import {hiCatalog, hiGenresList} from './hiCatalog';
import {hiGetStream} from './HiGetSteam';
import {hiGetPosts, hiGetPostsSearch} from './hiGetPosts';
import {ProviderType} from '../types';
export const HiAnime: ProviderType = {
catalog: hiCatalog,
genres: hiGenresList,
GetMetaData: hiGetInfo,
GetHomePosts: hiGetPosts,
GetStream: hiGetStream,
GetSearchPosts: hiGetPostsSearch,
};

View File

@@ -1,6 +1,6 @@
import {Info, Link, ProviderContext} from '../types'; import { Info, Link, ProviderContext } from "../types";
export const hiGetInfo = async function ({ export const getMeta = async function ({
link, link,
providerContext, providerContext,
}: { }: {
@@ -9,7 +9,7 @@ export const hiGetInfo = async function ({
}): Promise<Info> { }): Promise<Info> {
try { try {
const { getBaseUrl, axios } = providerContext; const { getBaseUrl, axios } = providerContext;
const baseUrl = await getBaseUrl('consumet'); const baseUrl = await getBaseUrl("consumet");
const url = `${baseUrl}/anime/zoro/info?id=` + link; const url = `${baseUrl}/anime/zoro/info?id=` + link;
const res = await axios.get(url); const res = await axios.get(url);
const data = res.data; const data = res.data;
@@ -19,20 +19,20 @@ export const hiGetInfo = async function ({
image: data.image, image: data.image,
tags: [ tags: [
data?.type, data?.type,
data?.subOrDub === 'both' ? 'Sub And Dub' : data?.subOrDub, data?.subOrDub === "both" ? "Sub And Dub" : data?.subOrDub,
], ],
imdbId: '', imdbId: "",
type: data.episodes.length > 0 ? 'series' : 'movie', type: data.episodes.length > 0 ? "series" : "movie",
}; };
const linkList: Link[] = []; const linkList: Link[] = [];
const subLinks: Link['directLinks'] = []; const subLinks: Link["directLinks"] = [];
data.episodes.forEach((episode: any) => { data.episodes.forEach((episode: any) => {
if (!episode?.isSubbed) { if (!episode?.isSubbed) {
return; return;
} }
const title = const title =
'Episode ' + episode.number + (episode?.isFiller ? ' (Filler)' : ''); "Episode " + episode.number + (episode?.isFiller ? " (Filler)" : "");
const link = episode.id + '$sub'; const link = episode.id + "$sub";
if (link && title) { if (link && title) {
subLinks.push({ subLinks.push({
title, title,
@@ -41,18 +41,18 @@ export const hiGetInfo = async function ({
} }
}); });
linkList.push({ linkList.push({
title: meta.title + ' (Sub)', title: meta.title + " (Sub)",
directLinks: subLinks, directLinks: subLinks,
}); });
if (data?.subOrDub === 'both') { if (data?.subOrDub === "both") {
const dubLinks: Link['directLinks'] = []; const dubLinks: Link["directLinks"] = [];
data.episodes.forEach((episode: any) => { data.episodes.forEach((episode: any) => {
if (!episode?.isDubbed) { if (!episode?.isDubbed) {
return; return;
} }
const title = const title =
'Episode ' + episode.number + (episode?.isFiller ? ' (Filler)' : ''); "Episode " + episode.number + (episode?.isFiller ? " (Filler)" : "");
const link = episode.id + '$dub'; const link = episode.id + "$dub";
if (link && title) { if (link && title) {
dubLinks.push({ dubLinks.push({
title, title,
@@ -61,7 +61,7 @@ export const hiGetInfo = async function ({
} }
}); });
linkList.push({ linkList.push({
title: meta.title + ' (Dub)', title: meta.title + " (Dub)",
directLinks: dubLinks, directLinks: dubLinks,
}); });
} }
@@ -72,11 +72,11 @@ export const hiGetInfo = async function ({
} catch (err) { } catch (err) {
console.error(err); console.error(err);
return { return {
title: '', title: "",
synopsis: '', synopsis: "",
image: '', image: "",
imdbId: '', imdbId: "",
type: 'movie', type: "movie",
linkList: [], linkList: [],
}; };
} }

View File

@@ -1,6 +1,6 @@
import {Post, ProviderContext} from '../types'; import { Post, ProviderContext } from "../types";
export const hiGetPosts = async function ({ export const getPosts = async function ({
filter, filter,
page, page,
signal, signal,
@@ -13,12 +13,12 @@ export const hiGetPosts = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl, axios } = providerContext; const { getBaseUrl, axios } = providerContext;
const baseUrl = await getBaseUrl('consumet'); const baseUrl = await getBaseUrl("consumet");
const url = `${baseUrl + filter}?page=${page}`; const url = `${baseUrl + filter}?page=${page}`;
return posts({ url, signal, axios }); return posts({ url, signal, axios });
}; };
export const hiGetPostsSearch = async function ({ export const getSearchPosts = async function ({
searchQuery, searchQuery,
page, page,
signal, signal,
@@ -31,7 +31,7 @@ export const hiGetPostsSearch = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl, axios } = providerContext; const { getBaseUrl, axios } = providerContext;
const baseUrl = await getBaseUrl('consumet'); const baseUrl = await getBaseUrl("consumet");
const url = `${baseUrl}/anime/zoro/${searchQuery}?page=${page}`; const url = `${baseUrl}/anime/zoro/${searchQuery}?page=${page}`;
return posts({ url, signal, axios }); return posts({ url, signal, axios });
}; };
@@ -43,7 +43,7 @@ async function posts({
}: { }: {
url: string; url: string;
signal: AbortSignal; signal: AbortSignal;
axios: ProviderContext['axios']; axios: ProviderContext["axios"];
}): Promise<Post[]> { }): Promise<Post[]> {
try { try {
const res = await axios.get(url, { signal }); const res = await axios.get(url, { signal });
@@ -63,7 +63,7 @@ async function posts({
}); });
return catalog; return catalog;
} catch (err) { } catch (err) {
console.error('zoro error ', err); console.error("zoro error ", err);
return []; return [];
} }
} }

View File

@@ -1,6 +1,6 @@
import {Stream, ProviderContext, TextTracks, TextTrackType} from '../types'; import { Stream, ProviderContext, TextTracks, TextTrackType } from "../types";
export const hiGetStream = async function ({ export const getStream = async function ({
link: id, link: id,
providerContext, providerContext,
}: { }: {
@@ -9,23 +9,23 @@ export const hiGetStream = async function ({
}): Promise<Stream[]> { }): Promise<Stream[]> {
try { try {
const { getBaseUrl, axios } = providerContext; const { getBaseUrl, axios } = providerContext;
const baseUrl = await getBaseUrl('consumet'); const baseUrl = await getBaseUrl("consumet");
const servers = ['vidcloud', 'vidstreaming']; const servers = ["vidcloud", "vidstreaming"];
const url = `${baseUrl}/anime/zoro/watch?episodeId=${id}&server=`; const url = `${baseUrl}/anime/zoro/watch?episodeId=${id}&server=`;
const streamLinks: Stream[] = []; const streamLinks: Stream[] = [];
await Promise.all( await Promise.all(
servers.map(async server => { servers.map(async (server) => {
try { try {
const res = await axios.get(url + server); const res = await axios.get(url + server);
if (res.data) { if (res.data) {
const subtitles: TextTracks = []; const subtitles: TextTracks = [];
res.data?.subtitles.forEach((sub: any) => { res.data?.subtitles.forEach((sub: any) => {
if (sub?.lang === 'Thumbnails') return; if (sub?.lang === "Thumbnails") return;
subtitles.push({ subtitles.push({
language: sub?.lang?.slice(0, 2) || 'Und', language: sub?.lang?.slice(0, 2) || "Und",
uri: sub?.url, uri: sub?.url,
title: sub?.lang || 'Undefined', title: sub?.lang || "Undefined",
type: sub?.url?.endsWith('.vtt') type: sub?.url?.endsWith(".vtt")
? TextTrackType.VTT ? TextTrackType.VTT
: TextTrackType.SUBRIP, : TextTrackType.SUBRIP,
}); });
@@ -34,10 +34,10 @@ export const hiGetStream = async function ({
streamLinks.push({ streamLinks.push({
server: server, server: server,
link: source?.url, link: source?.url,
type: source?.isM3U8 ? 'm3u8' : 'mp4', type: source?.isM3U8 ? "m3u8" : "mp4",
headers: { headers: {
Referer: 'https://megacloud.club/', Referer: "https://megacloud.club/",
Origin: 'https://megacloud.club', Origin: "https://megacloud.club",
}, },
subtitles: subtitles, subtitles: subtitles,
}); });
@@ -46,7 +46,7 @@ export const hiGetStream = async function ({
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
}), })
); );
return streamLinks; return streamLinks;
} catch (err) { } catch (err) {

View File

@@ -1,6 +1,6 @@
import {EpisodeLink, ProviderContext} from '../types'; import { EpisodeLink, ProviderContext } from "../types";
export const katEpisodeLinks = async function ({ export const getEpisodes = async function ({
url, url,
providerContext, providerContext,
}: { }: {
@@ -10,44 +10,44 @@ export const katEpisodeLinks = async function ({
const { axios, cheerio } = providerContext; const { axios, cheerio } = providerContext;
const episodesLink: EpisodeLink[] = []; const episodesLink: EpisodeLink[] = [];
try { try {
if (url.includes('gdflix')) { if (url.includes("gdflix")) {
const baseUrl = url.split('/pack')?.[0]; const baseUrl = url.split("/pack")?.[0];
const res = await axios.get(url); const res = await axios.get(url);
const data = res.data; const data = res.data;
const $ = cheerio.load(data); const $ = cheerio.load(data);
const links = $('.list-group-item'); const links = $(".list-group-item");
links?.map((i, link) => { links?.map((i, link) => {
episodesLink.push({ episodesLink.push({
title: $(link).text() || '', title: $(link).text() || "",
link: baseUrl + $(link).find('a').attr('href') || '', link: baseUrl + $(link).find("a").attr("href") || "",
}); });
}); });
if (episodesLink.length > 0) { if (episodesLink.length > 0) {
return episodesLink; return episodesLink;
} }
} }
if (url.includes('/pack')) { if (url.includes("/pack")) {
const epIds = await extractKmhdEpisodes(url, providerContext); const epIds = await extractKmhdEpisodes(url, providerContext);
epIds?.forEach((id: string, index: number) => { epIds?.forEach((id: string, index: number) => {
episodesLink.push({ episodesLink.push({
title: `Episode ${index + 1}`, title: `Episode ${index + 1}`,
link: url.split('/pack')[0] + '/file/' + id, link: url.split("/pack")[0] + "/file/" + id,
}); });
}); });
} }
const res = await axios.get(url, { const res = await axios.get(url, {
headers: { headers: {
Cookie: Cookie:
'_ga_GNR438JY8N=GS1.1.1722240350.5.0.1722240350.0.0.0; _ga=GA1.1.372196696.1722150754; unlocked=true', "_ga_GNR438JY8N=GS1.1.1722240350.5.0.1722240350.0.0.0; _ga=GA1.1.372196696.1722150754; unlocked=true",
}, },
}); });
const episodeData = res.data; const episodeData = res.data;
const $ = cheerio.load(episodeData); const $ = cheerio.load(episodeData);
const links = $('.autohyperlink'); const links = $(".autohyperlink");
links?.map((i, link) => { links?.map((i, link) => {
episodesLink.push({ episodesLink.push({
title: $(link).parent().children().remove().end().text() || '', title: $(link).parent().children().remove().end().text() || "",
link: $(link).attr('href') || '', link: $(link).attr("href") || "",
}); });
}); });
@@ -60,21 +60,21 @@ export const katEpisodeLinks = async function ({
export async function extractKmhdLink( export async function extractKmhdLink(
katlink: string, katlink: string,
providerContext: ProviderContext, providerContext: ProviderContext
) { ) {
const { axios } = providerContext; const { axios } = providerContext;
const res = await axios.get(katlink); const res = await axios.get(katlink);
const data = res.data; const data = res.data;
const hubDriveRes = data.match(/hubdrive_res:\s*"([^"]+)"/)[1]; const hubDriveRes = data.match(/hubdrive_res:\s*"([^"]+)"/)[1];
const hubDriveLink = data.match( const hubDriveLink = data.match(
/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/, /hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/
)[1]; )[1];
return hubDriveLink + hubDriveRes; return hubDriveLink + hubDriveRes;
} }
async function extractKmhdEpisodes( async function extractKmhdEpisodes(
katlink: string, katlink: string,
providerContext: ProviderContext, providerContext: ProviderContext
) { ) {
const { axios } = providerContext; const { axios } = providerContext;
const res = await axios.get(katlink); const res = await axios.get(katlink);

View File

@@ -1,16 +0,0 @@
import {katCatalog, katGenresList} from './katCatalog';
import {katEpisodeLinks} from './katGetEpsodes';
import {katGetInfo} from './katGetInfo';
import {katGetPosts, katGetPostsSearch} from './katGetPosts';
import {katGetStream} from './katGetSteam';
import {ProviderType} from '../types';
export const katMoviesHd: ProviderType = {
catalog: katCatalog,
genres: katGenresList,
GetMetaData: katGetInfo,
GetHomePosts: katGetPosts,
GetStream: katGetStream,
GetEpisodeLinks: katEpisodeLinks,
GetSearchPosts: katGetPostsSearch,
};

View File

@@ -1,6 +1,6 @@
import {Info, Link, ProviderContext} from '../types'; import { Info, Link, ProviderContext } from "../types";
export const katGetInfo = async function ({ export const getMeta = async function ({
link, link,
providerContext, providerContext,
}: { }: {
@@ -13,44 +13,44 @@ export const katGetInfo = async function ({
const res = await axios.get(url); const res = await axios.get(url);
const data = res.data; const data = res.data;
const $ = cheerio.load(data); const $ = cheerio.load(data);
const container = $('.yQ8hqd.ksSzJd.LoQAYe').html() const container = $(".yQ8hqd.ksSzJd.LoQAYe").html()
? $('.yQ8hqd.ksSzJd.LoQAYe') ? $(".yQ8hqd.ksSzJd.LoQAYe")
: $('.FxvUNb'); : $(".FxvUNb");
const imdbId = const imdbId =
container container
.find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])') .find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])')
.attr('href') .attr("href")
?.split('/')[4] || ''; ?.split("/")[4] || "";
const title = container const title = container
.find('li:contains("Name")') .find('li:contains("Name")')
.children() .children()
.remove() .remove()
.end() .end()
.text(); .text();
const type = $('.yQ8hqd.ksSzJd.LoQAYe').html() ? 'series' : 'movie'; const type = $(".yQ8hqd.ksSzJd.LoQAYe").html() ? "series" : "movie";
const synopsis = container.find('li:contains("Stars")').text(); const synopsis = container.find('li:contains("Stars")').text();
const image = const image =
$('h4:contains("SCREENSHOTS")').next().find('img').attr('src') || ''; $('h4:contains("SCREENSHOTS")').next().find("img").attr("src") || "";
console.log('katGetInfo', title, synopsis, image, imdbId, type); console.log("katGetInfo", title, synopsis, image, imdbId, type);
// Links // Links
const links: Link[] = []; const links: Link[] = [];
const directLink: Link['directLinks'] = []; const directLink: Link["directLinks"] = [];
// direct links // direct links
$('.entry-content') $(".entry-content")
.find('p:contains("Episode")') .find('p:contains("Episode")')
.each((i, element) => { .each((i, element) => {
const dlLink = const dlLink =
$(element) $(element)
.nextAll('h3,h2') .nextAll("h3,h2")
.first() .first()
.find('a:contains("1080"),a:contains("720"),a:contains("480")') .find('a:contains("1080"),a:contains("720"),a:contains("480")')
.attr('href') || ''; .attr("href") || "";
const dlTitle = $(element).find('span').text(); const dlTitle = $(element).find("span").text();
if (link.trim().length > 0 && dlTitle.includes('Episode ')) { if (link.trim().length > 0 && dlTitle.includes("Episode ")) {
directLink.push({ directLink.push({
title: dlTitle, title: dlTitle,
link: dlLink, link: dlLink,
@@ -60,24 +60,24 @@ export const katGetInfo = async function ({
if (directLink.length > 0) { if (directLink.length > 0) {
links.push({ links.push({
quality: '', quality: "",
title: title, title: title,
directLinks: directLink, directLinks: directLink,
}); });
} }
$('.entry-content') $(".entry-content")
.find('pre') .find("pre")
.nextUntil('div') .nextUntil("div")
.filter('h2') .filter("h2")
.each((i, element) => { .each((i, element) => {
const link = $(element).find('a').attr('href'); const link = $(element).find("a").attr("href");
const quality = const quality =
$(element) $(element)
.text() .text()
.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || ''; .match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || "";
const title = $(element).text(); const title = $(element).text();
if (link && title.includes('')) { if (link && title.includes("")) {
links.push({ links.push({
quality, quality,
title, title,
@@ -86,23 +86,23 @@ export const katGetInfo = async function ({
} }
}); });
if (links.length === 0 && type === 'movie') { if (links.length === 0 && type === "movie") {
$('.entry-content') $(".entry-content")
.find('h2:contains("DOWNLOAD"),h3:contains("DOWNLOAD")') .find('h2:contains("DOWNLOAD"),h3:contains("DOWNLOAD")')
.nextUntil('pre,div') .nextUntil("pre,div")
.filter('h2') .filter("h2")
.each((i, element) => { .each((i, element) => {
const link = $(element).find('a').attr('href'); const link = $(element).find("a").attr("href");
const quality = const quality =
$(element) $(element)
.text() .text()
.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || ''; .match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || "";
const title = $(element).text(); const title = $(element).text();
if (link && !title.includes('Online')) { if (link && !title.includes("Online")) {
links.push({ links.push({
quality, quality,
title, title,
directLinks: [{link, title, type: 'movie'}], directLinks: [{ link, title, type: "movie" }],
}); });
} }
}); });
@@ -120,11 +120,11 @@ export const katGetInfo = async function ({
} catch (err) { } catch (err) {
console.error(err); console.error(err);
return { return {
title: '', title: "",
synopsis: '', synopsis: "",
image: '', image: "",
imdbId: '', imdbId: "",
type: 'movie', type: "movie",
linkList: [], linkList: [],
}; };
} }

View File

@@ -1,6 +1,6 @@
import {Post, ProviderContext} from '../types'; import { Post, ProviderContext } from "../types";
export const katGetPosts = async function ({ export const getPosts = async function ({
filter, filter,
page, page,
signal, signal,
@@ -13,12 +13,12 @@ export const katGetPosts = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl, cheerio } = providerContext; const { getBaseUrl, cheerio } = providerContext;
const baseUrl = await getBaseUrl('kat'); const baseUrl = await getBaseUrl("kat");
const url = `${baseUrl + filter}/page/${page}/`; const url = `${baseUrl + filter}/page/${page}/`;
return posts({ url, signal, cheerio }); return posts({ url, signal, cheerio });
}; };
export const katGetPostsSearch = async function ({ export const getSearchPosts = async function ({
searchQuery, searchQuery,
page, page,
signal, signal,
@@ -31,7 +31,7 @@ export const katGetPostsSearch = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl, cheerio } = providerContext; const { getBaseUrl, cheerio } = providerContext;
const baseUrl = await getBaseUrl('kat'); const baseUrl = await getBaseUrl("kat");
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`; const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
return posts({ url, signal, cheerio }); return posts({ url, signal, cheerio });
}; };
@@ -43,22 +43,22 @@ async function posts({
}: { }: {
url: string; url: string;
signal: AbortSignal; signal: AbortSignal;
cheerio: ProviderContext['cheerio']; cheerio: ProviderContext["cheerio"];
}): Promise<Post[]> { }): Promise<Post[]> {
try { try {
const res = await fetch(url, { signal }); const res = await fetch(url, { signal });
const data = await res.text(); const data = await res.text();
const $ = cheerio.load(data); const $ = cheerio.load(data);
const catalog: Post[] = []; const catalog: Post[] = [];
$('.recent-posts') $(".recent-posts")
.children() .children()
.map((i, element) => { .map((i, element) => {
const title = $(element).find('img').attr('alt'); const title = $(element).find("img").attr("alt");
const link = $(element).find('a').attr('href'); const link = $(element).find("a").attr("href");
const image = $(element).find('img').attr('src'); const image = $(element).find("img").attr("src");
if (title && link && image) { if (title && link && image) {
catalog.push({ catalog.push({
title: title.replace('Download', '').trim(), title: title.replace("Download", "").trim(),
link: link, link: link,
image: image, image: image,
}); });
@@ -66,7 +66,7 @@ async function posts({
}); });
return catalog; return catalog;
} catch (err) { } catch (err) {
console.error('katmovies error ', err); console.error("katmovies error ", err);
return []; return [];
} }
} }

View File

@@ -1,19 +1,19 @@
import {Stream, ProviderContext} from '../types'; import { Stream, ProviderContext } from "../types";
async function extractKmhdLink( async function extractKmhdLink(
katlink: string, katlink: string,
providerContext: ProviderContext, providerContext: ProviderContext
) { ) {
const { axios } = providerContext; const { axios } = providerContext;
const res = await axios.get(katlink); const res = await axios.get(katlink);
const data = res.data; const data = res.data;
const hubDriveRes = data.match(/hubdrive_res:\s*"([^"]+)"/)[1]; const hubDriveRes = data.match(/hubdrive_res:\s*"([^"]+)"/)[1];
const hubDriveLink = data.match( const hubDriveLink = data.match(
/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/, /hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/
)[1]; )[1];
return hubDriveLink + hubDriveRes; return hubDriveLink + hubDriveRes;
} }
export async function katGetStream({ export const getStream = async function ({
link, link,
signal, signal,
providerContext, providerContext,
@@ -26,74 +26,74 @@ export async function katGetStream({
const { axios, cheerio, extractors } = providerContext; const { axios, cheerio, extractors } = providerContext;
const { hubcloudExtracter, gdFlixExtracter } = extractors; const { hubcloudExtracter, gdFlixExtracter } = extractors;
const streamLinks: Stream[] = []; const streamLinks: Stream[] = [];
console.log('katGetStream', link); console.log("katGetStream", link);
try { try {
if (link.includes('gdflix')) { if (link.includes("gdflix")) {
return await gdFlixExtracter(link, signal); return await gdFlixExtracter(link, signal);
} }
if (link.includes('kmhd')) { if (link.includes("kmhd")) {
const hubcloudLink = await extractKmhdLink(link, providerContext); const hubcloudLink = await extractKmhdLink(link, providerContext);
return await hubcloudExtracter(hubcloudLink, signal); return await hubcloudExtracter(hubcloudLink, signal);
} }
if (link.includes('gdflix')) { if (link.includes("gdflix")) {
// resume link // resume link
try { try {
const resumeDrive = link.replace('/file', '/zfile'); const resumeDrive = link.replace("/file", "/zfile");
// console.log('resumeDrive', resumeDrive); // console.log('resumeDrive', resumeDrive);
const resumeDriveRes = await axios.get(resumeDrive); const resumeDriveRes = await axios.get(resumeDrive);
const resumeDriveHtml = resumeDriveRes.data; const resumeDriveHtml = resumeDriveRes.data;
const $resumeDrive = cheerio.load(resumeDriveHtml); const $resumeDrive = cheerio.load(resumeDriveHtml);
const resumeLink = $resumeDrive('.btn-success').attr('href'); const resumeLink = $resumeDrive(".btn-success").attr("href");
console.log('resumeLink', resumeLink); console.log("resumeLink", resumeLink);
if (resumeLink) { if (resumeLink) {
streamLinks.push({ streamLinks.push({
server: 'ResumeCloud', server: "ResumeCloud",
link: resumeLink, link: resumeLink,
type: 'mkv', type: "mkv",
}); });
} }
} catch (err) { } catch (err) {
console.log('Resume link not found'); console.log("Resume link not found");
} }
//instant link //instant link
try { try {
const driveres = await axios.get(link, { timeout: 10000 }); const driveres = await axios.get(link, { timeout: 10000 });
const $drive = cheerio.load(driveres.data); const $drive = cheerio.load(driveres.data);
const seed = $drive('.btn-danger').attr('href') || ''; const seed = $drive(".btn-danger").attr("href") || "";
const instantToken = seed.split('=')[1]; const instantToken = seed.split("=")[1];
// console.log('InstantToken', instantToken); // console.log('InstantToken', instantToken);
const InstantFromData = new FormData(); const InstantFromData = new FormData();
InstantFromData.append('keys', instantToken); InstantFromData.append("keys", instantToken);
const videoSeedUrl = seed.split('/').slice(0, 3).join('/') + '/api'; const videoSeedUrl = seed.split("/").slice(0, 3).join("/") + "/api";
// console.log('videoSeedUrl', videoSeedUrl); // console.log('videoSeedUrl', videoSeedUrl);
const instantLinkRes = await fetch(videoSeedUrl, { const instantLinkRes = await fetch(videoSeedUrl, {
method: 'POST', method: "POST",
body: InstantFromData, body: InstantFromData,
headers: { headers: {
'x-token': videoSeedUrl, "x-token": videoSeedUrl,
}, },
}); });
const instantLinkData = await instantLinkRes.json(); const instantLinkData = await instantLinkRes.json();
console.log('instantLinkData', instantLinkData); console.log("instantLinkData", instantLinkData);
if (instantLinkData.error === false) { if (instantLinkData.error === false) {
const instantLink = instantLinkData.url; const instantLink = instantLinkData.url;
streamLinks.push({ streamLinks.push({
server: 'Gdrive-Instant', server: "Gdrive-Instant",
link: instantLink, link: instantLink,
type: 'mkv', type: "mkv",
}); });
} else { } else {
console.log('Instant link not found', instantLinkData); console.log("Instant link not found", instantLinkData);
} }
} catch (err) { } catch (err) {
console.log('Instant link not found', err); console.log("Instant link not found", err);
} }
return streamLinks; return streamLinks;
} }
const stereams = await hubcloudExtracter(link, signal); const stereams = await hubcloudExtracter(link, signal);
return stereams; return stereams;
} catch (error: any) { } catch (error: any) {
console.log('katgetStream error: ', error); console.log("katgetStream error: ", error);
return []; return [];
} }
} };

View File

@@ -0,0 +1,20 @@
export const catalog = [
{
title: "Latest",
filter: "/api/DramaList/List?type=0&sub=0&country=0&status=0&order=2",
},
{
title: "Hollywood",
filter: "/api/DramaList/List?type=4&sub=0&country=0&status=0&order=2",
},
{
title: "Anime",
filter: "/api/DramaList/List?type=3&sub=0&country=0&status=0&order=2",
},
{
title: "K Drama",
filter: "/api/DramaList/List?type=0&sub=0&country=0&status=0&order=2",
},
];
export const genres = [];

View File

@@ -1,14 +0,0 @@
import {kisskhCatalog, kisskhGenresList} from './kissKhCatalog';
import {kissKhGetInfo} from './kissKhGetInfo';
import {kissKhGetPosts, kissKhGetPostsSearch} from './kissKhGetPosts';
import {kissKhGetStream} from './kissKhGetStream';
import {ProviderType} from '../types';
export const kissKhProvider: ProviderType = {
catalog: kisskhCatalog,
genres: kisskhGenresList,
GetHomePosts: kissKhGetPosts,
GetMetaData: kissKhGetInfo,
GetStream: kissKhGetStream,
GetSearchPosts: kissKhGetPostsSearch,
};

View File

@@ -1,20 +0,0 @@
export const kisskhCatalog = [
{
title: 'Latest',
filter: '/api/DramaList/List?type=0&sub=0&country=0&status=0&order=2',
},
{
title: 'Hollywood',
filter: '/api/DramaList/List?type=4&sub=0&country=0&status=0&order=2',
},
{
title: 'Anime',
filter: '/api/DramaList/List?type=3&sub=0&country=0&status=0&order=2',
},
{
title: 'K Drama',
filter: '/api/DramaList/List?type=0&sub=0&country=0&status=0&order=2',
},
];
export const kisskhGenresList = [];

View File

@@ -1,6 +1,6 @@
import {Info, Link, ProviderContext} from '../types'; import { Info, Link, ProviderContext } from "../types";
export const kissKhGetInfo = async function ({ export const getMeta = async function ({
link, link,
providerContext, providerContext,
}: { }: {
@@ -15,16 +15,16 @@ export const kissKhGetInfo = async function ({
title: data.title, title: data.title,
synopsis: data.description, synopsis: data.description,
image: data.thumbnail, image: data.thumbnail,
tags: [data?.releaseDate?.split('-')[0], data?.status, data?.type], tags: [data?.releaseDate?.split("-")[0], data?.status, data?.type],
imdbId: '', imdbId: "",
type: data.episodesCount > 1 ? 'series' : 'movie', type: data.episodesCount > 1 ? "series" : "movie",
}; };
const linkList: Link[] = []; const linkList: Link[] = [];
const subLinks: Link['directLinks'] = []; const subLinks: Link["directLinks"] = [];
data?.episodes?.reverse().map((episode: any) => { data?.episodes?.reverse().map((episode: any) => {
const title = 'Episode ' + episode?.number; const title = "Episode " + episode?.number;
const link = episode?.id?.toString(); const link = episode?.id?.toString();
if (link && title) { if (link && title) {
subLinks.push({ subLinks.push({
@@ -46,11 +46,11 @@ export const kissKhGetInfo = async function ({
} catch (err) { } catch (err) {
console.error(err); console.error(err);
return { return {
title: '', title: "",
synopsis: '', synopsis: "",
image: '', image: "",
imdbId: '', imdbId: "",
type: 'movie', type: "movie",
linkList: [], linkList: [],
}; };
} }

View File

@@ -1,6 +1,6 @@
import {Post, ProviderContext} from '../types'; import { Post, ProviderContext } from "../types";
export const kissKhGetPosts = async function ({ export const getPosts = async function ({
filter, filter,
signal, signal,
providerContext, providerContext,
@@ -12,7 +12,7 @@ export const kissKhGetPosts = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl, axios } = providerContext; const { getBaseUrl, axios } = providerContext;
const baseUrl = await getBaseUrl('kissKh'); const baseUrl = await getBaseUrl("kissKh");
const url = `${baseUrl + filter}&type=0`; const url = `${baseUrl + filter}&type=0`;
try { try {
const res = await axios.get(url, { signal }); const res = await axios.get(url, { signal });
@@ -32,12 +32,12 @@ export const kissKhGetPosts = async function ({
}); });
return catalog; return catalog;
} catch (err) { } catch (err) {
console.error('kiss error ', err); console.error("kiss error ", err);
return []; return [];
} }
}; };
export const kissKhGetPostsSearch = async function ({ export const getSearchPosts = async function ({
searchQuery, searchQuery,
signal, signal,
providerContext, providerContext,
@@ -49,7 +49,7 @@ export const kissKhGetPostsSearch = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl, axios } = providerContext; const { getBaseUrl, axios } = providerContext;
const baseUrl = await getBaseUrl('kissKh'); const baseUrl = await getBaseUrl("kissKh");
const url = `${baseUrl}/api/DramaList/Search?q=${searchQuery}&type=0`; const url = `${baseUrl}/api/DramaList/Search?q=${searchQuery}&type=0`;
try { try {
const res = await axios.get(url, { signal }); const res = await axios.get(url, { signal });
@@ -69,7 +69,7 @@ export const kissKhGetPostsSearch = async function ({
}); });
return catalog; return catalog;
} catch (err) { } catch (err) {
console.error('kiss error ', err); console.error("kiss error ", err);
return []; return [];
} }
}; };

View File

@@ -1,6 +1,6 @@
import {Stream, ProviderContext, TextTrackType, TextTracks} from '../types'; import { Stream, ProviderContext, TextTrackType, TextTracks } from "../types";
export const kissKhGetStream = async function ({ export const getStream = async function ({
link: id, link: id,
providerContext, providerContext,
}: { }: {
@@ -11,9 +11,9 @@ export const kissKhGetStream = async function ({
const { axios, getBaseUrl } = providerContext; const { axios, getBaseUrl } = providerContext;
const streamLinks: Stream[] = []; const streamLinks: Stream[] = [];
const subtitles: TextTracks = []; const subtitles: TextTracks = [];
const baseUrl = await getBaseUrl('kissKh'); const baseUrl = await getBaseUrl("kissKh");
const streamUrl = const streamUrl =
'https://adorable-salamander-ecbb21.netlify.app/api/kisskh/video?id=' + "https://adorable-salamander-ecbb21.netlify.app/api/kisskh/video?id=" +
id; id;
const res = await axios.get(streamUrl); const res = await axios.get(streamUrl);
const stream = res.data?.source?.Video; const stream = res.data?.source?.Video;
@@ -22,16 +22,16 @@ export const kissKhGetStream = async function ({
subtitles.push({ subtitles.push({
title: sub?.label, title: sub?.label,
language: sub?.land, language: sub?.land,
type: sub?.src?.includes('.vtt') type: sub?.src?.includes(".vtt")
? TextTrackType.VTT ? TextTrackType.VTT
: TextTrackType.SUBRIP, : TextTrackType.SUBRIP,
uri: sub?.src, uri: sub?.src,
}); });
}); });
streamLinks.push({ streamLinks.push({
server: 'kissKh', server: "kissKh",
link: stream, link: stream,
type: 'm3u8', type: "m3u8",
subtitles, subtitles,
headers: { headers: {
referer: baseUrl, referer: baseUrl,

View File

@@ -0,0 +1,101 @@
export const catalog = [
{
title: "New",
filter: "",
},
{
title: "Netflix",
filter: "category/web-series/netflix",
},
{
title: "Amazon Prime",
filter: "category/web-series/amazon-prime-video",
},
{
title: "4K Movies",
filter: "category/movies-by-quality/2160p",
},
];
export const genres = [
{
title: "Action",
filter: "category/movies-by-genres/action/",
},
{
title: "Adventure",
filter: "category/movies-by-genres/adventure/",
},
{
title: "Animation",
filter: "category/movies-by-genres/animation/",
},
{
title: "Biography",
filter: "category/movies-by-genres/biography/",
},
{
title: "Comedy",
filter: "category/movies-by-genres/comedy/",
},
{
title: "Crime",
filter: "category/movies-by-genres/crime/",
},
{
title: "Documentary",
filter: "category/movies-by-genres/documentary/",
},
{
title: "Drama",
filter: "category/movies-by-genres/drama/",
},
{
title: "Family",
filter: "category/movies-by-genres/family/",
},
{
title: "Fantasy",
filter: "category/movies-by-genres/fantasy/",
},
{
title: "History",
filter: "category/movies-by-genres/history/",
},
{
title: "Horror",
filter: "category/movies-by-genres/horror/",
},
{
title: "Music",
filter: "category/movies-by-genres/music/",
},
{
title: "Mystery",
filter: "category/movies-by-genres/mystery/",
},
{
title: "Romance",
filter: "category/movies-by-genres/romance/",
},
{
title: "Sci-Fi",
filter: "category/movies-by-genres/sci-fi/",
},
{
title: "Sport",
filter: "category/movies-by-genres/sport/",
},
{
title: "Thriller",
filter: "category/movies-by-genres/thriller/",
},
{
title: "War",
filter: "category/movies-by-genres/war/",
},
{
title: "Western",
filter: "category/movies-by-genres/western/",
},
];

View File

@@ -0,0 +1,39 @@
import { EpisodeLink, ProviderContext } from "../types";
export const getEpisodes = async function ({
url,
providerContext,
}: {
url: string;
providerContext: ProviderContext;
}): Promise<EpisodeLink[]> {
const { axios, cheerio, commonHeaders: headers } = providerContext;
console.log("getEpisodeLinks", url);
try {
const res = await axios.get(url, { headers });
const $ = cheerio.load(res.data);
const container = $(".entry-content,.entry-inner");
$(".unili-content,.code-block-1").remove();
const episodes: EpisodeLink[] = [];
container.find("h4").each((index, element) => {
const el = $(element);
const title = el.text().replaceAll("-", "").replaceAll(":", "");
const link = el
.next("p")
.find(
'.btn-outline[style="background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;"]'
)
.parent()
.attr("href");
if (title && link) {
episodes.push({ title, link });
}
});
// console.log(episodes);
return episodes;
} catch (err) {
console.log("getEpisodeLinks error: ");
// console.error(err);
return [];
}
};

View File

@@ -1,17 +0,0 @@
import {luxGetPosts, luxGetPostsSearch} from './luxGetPosts';
import {vegaGetInfo} from '../vega/getInfo';
import {vegaGetStream} from '../vega/getStream';
import {vegaGetEpisodeLinks} from '../vega/getEpisodesLink';
import {homeList, genresList} from './luxCatalog';
import {ProviderType} from '../types';
export const luxMovies: ProviderType = {
catalog: homeList,
genres: genresList,
GetMetaData: vegaGetInfo,
GetHomePosts: luxGetPosts,
GetStream: vegaGetStream,
nonStreamableServer: ['filepress'],
GetEpisodeLinks: vegaGetEpisodeLinks,
GetSearchPosts: luxGetPostsSearch,
};

View File

@@ -1,101 +0,0 @@
export const homeList = [
{
title: 'New',
filter: '',
},
{
title: 'Netflix',
filter: 'category/web-series/netflix',
},
{
title: 'Amazon Prime',
filter: 'category/web-series/amazon-prime-video',
},
{
title: '4K Movies',
filter: 'category/movies-by-quality/2160p',
},
];
export const genresList = [
{
title: 'Action',
filter: 'category/movies-by-genres/action/',
},
{
title: 'Adventure',
filter: 'category/movies-by-genres/adventure/',
},
{
title: 'Animation',
filter: 'category/movies-by-genres/animation/',
},
{
title: 'Biography',
filter: 'category/movies-by-genres/biography/',
},
{
title: 'Comedy',
filter: 'category/movies-by-genres/comedy/',
},
{
title: 'Crime',
filter: 'category/movies-by-genres/crime/',
},
{
title: 'Documentary',
filter: 'category/movies-by-genres/documentary/',
},
{
title: 'Drama',
filter: 'category/movies-by-genres/drama/',
},
{
title: 'Family',
filter: 'category/movies-by-genres/family/',
},
{
title: 'Fantasy',
filter: 'category/movies-by-genres/fantasy/',
},
{
title: 'History',
filter: 'category/movies-by-genres/history/',
},
{
title: 'Horror',
filter: 'category/movies-by-genres/horror/',
},
{
title: 'Music',
filter: 'category/movies-by-genres/music/',
},
{
title: 'Mystery',
filter: 'category/movies-by-genres/mystery/',
},
{
title: 'Romance',
filter: 'category/movies-by-genres/romance/',
},
{
title: 'Sci-Fi',
filter: 'category/movies-by-genres/sci-fi/',
},
{
title: 'Sport',
filter: 'category/movies-by-genres/sport/',
},
{
title: 'Thriller',
filter: 'category/movies-by-genres/thriller/',
},
{
title: 'War',
filter: 'category/movies-by-genres/war/',
},
{
title: 'Western',
filter: 'category/movies-by-genres/western/',
},
];

View File

@@ -1,111 +0,0 @@
import {Post, ProviderContext} from '../types';
const headers = {
Accept:
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'Cache-Control': 'no-store',
'Accept-Language': 'en-US,en;q=0.9',
DNT: '1',
'sec-ch-ua':
'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'Sec-Fetch-Dest': 'document',
'Sec-Fetch-Mode': 'navigate',
'Sec-Fetch-Site': 'none',
'Sec-Fetch-User': '?1',
Cookie:
'ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=gaIhTNzqSvp27JCVf7qiEUfYRfwyj0Jx9rcsn774BbE-1732694853-1.2.1.1-QKgYJvmrEz08gM9qbAp70diztE2.hseO2NNi.0imIUk_gkuWUcr7U8t5Zn_z4Ov30sIGPBES1PBgMUEa.s8e8QTkQoZjgziFmoC7YdX7s2Jnt.tYCxE_s5mMLQQBYbz_94A89IYe93Y6kyLQm_L.dvUKPPiGjn_sH3qRD0g4p9oOl0SPvH0T2W_EaD0r6mVBasbgro9dAROt_6CxshXOEGeMOnoWR.ID699FKldjMUhbXJbATAffdOY6kf2sD_iwrSl4bcetTlDHd4gusTVfxSS1pL5qNjyTU9wa38soPl1wZoqFHkEGOPWz6S7FD5ikHxX0bArFem9hiDeJXctYfWz5e_Lkc6lH7nW0Rm2XS3gxCadQSg21RkSReN6kDAEecqjgJSE4zUomkWAxFZ98TSShgGWC0ridPTpdQizPDZQ; _lscache_vary=c1d682536aea2d88fbb2574666e1f0aa',
'Upgrade-Insecure-Requests': '1',
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0',
};
export const luxGetPosts = async ({
filter,
page,
providerValue,
signal,
providerContext,
}: {
filter: string;
page: number;
providerValue: string;
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> => {
const {getBaseUrl} = providerContext;
const baseUrl = await getBaseUrl('lux');
console.log('vegaGetPosts baseUrl:', providerValue, baseUrl);
const url = `${baseUrl}/${filter}/page/${page}/`;
console.log('lux url:', url);
return posts(url, signal, providerContext);
};
export const luxGetPostsSearch = async ({
searchQuery,
page,
providerValue,
signal,
providerContext,
}: {
searchQuery: string;
page: number;
providerValue: string;
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> => {
const {getBaseUrl} = providerContext;
const baseUrl = await getBaseUrl('lux');
console.log('vegaGetPosts baseUrl:', providerValue, baseUrl);
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
console.log('lux url:', url);
return posts(url, signal, providerContext);
};
async function posts(
url: string,
signal: AbortSignal,
providerContext: ProviderContext,
): Promise<Post[]> {
try {
const {axios, cheerio} = providerContext;
const urlRes = await axios.get(url, {headers, signal});
const $ = cheerio.load(urlRes.data);
const posts: Post[] = [];
$('.blog-items')
?.children('article')
?.each((index, element) => {
const post = {
title:
$(element)
?.find('a')
?.attr('title')
?.replace('Download', '')
?.match(/^(.*?)\s*\((\d{4})\)|^(.*?)\s*\((Season \d+)\)/)?.[0] ||
$(element)?.find('a')?.attr('title')?.replace('Download', '') ||
'',
link: $(element)?.find('a')?.attr('href') || '',
image:
$(element).find('a').find('img').attr('data-lazy-src') ||
$(element).find('a').find('img').attr('data-src') ||
$(element).find('a').find('img').attr('src') ||
'',
};
if (post.image.startsWith('//')) {
post.image = 'https:' + post.image;
}
posts.push(post);
});
// console.log(posts);
return posts;
} catch (error) {
console.error('vegaGetPosts error:', error);
return [];
}
}

View File

@@ -1,27 +1,27 @@
import {Info, Link, ProviderContext} from '../types'; import { Info, Link, ProviderContext } from "../types";
const headers = { const headers = {
Accept: Accept:
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
'Cache-Control': 'no-store', "Cache-Control": "no-store",
'Accept-Language': 'en-US,en;q=0.9', "Accept-Language": "en-US,en;q=0.9",
DNT: '1', DNT: "1",
'sec-ch-ua': "sec-ch-ua":
'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"', '"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',
'sec-ch-ua-mobile': '?0', "sec-ch-ua-mobile": "?0",
'sec-ch-ua-platform': '"Windows"', "sec-ch-ua-platform": '"Windows"',
'Sec-Fetch-Dest': 'document', "Sec-Fetch-Dest": "document",
'Sec-Fetch-Mode': 'navigate', "Sec-Fetch-Mode": "navigate",
'Sec-Fetch-Site': 'none', "Sec-Fetch-Site": "none",
'Sec-Fetch-User': '?1', "Sec-Fetch-User": "?1",
Cookie: Cookie:
'_lscache_vary=62abf8b96599676eb8ec211cffaeb8ff; ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=n4Y1XTKZ5TfIMBNQuAXzerwKpx0U35KoOm3imfT0GpU-1732097818-1.2.1.1-ZeAnEu.8D9TSZHYDoj7vwo1A1rpdKl304ZpaBn_QbAQOr211JFAb7.JRQU3EL2eIy1Dfl8HhYvH7_259.22lUz8gbchHcQ8hvfuQXMtFMCbqDBLzjNUZa9stuk.39l28IcPhH9Z2szsf3SGtNI1sAfo66Djt7sOReLK3lHw9UkJp7BdGqt6a2X9qAc8EsAI3lE480Tmt0fkHv14Oc30LSbPB_WwFmiqAki2W.Gv9hV7TN_QBFESleTDlXd.6KGflfd4.KwWF7rpSRo_cgoc9ALLLIafpxHVbe7_g5r7zvpml_Pj8fEL75fw.1GBuy16bciHBuB8s_kahuJYUnhtQFFgfTQl8_Gn6KeovBWx.PJ7nFv5sklHUfAyBVq3t30xKe8ZDydsQ_G.yipfj_In5GmmWcXGb6E4.bioDOwW_sKLtxwdTQt7Nu.RkILX_mKvXNpyLqflIVj8G7X5E8I.unw', "_lscache_vary=62abf8b96599676eb8ec211cffaeb8ff; ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=n4Y1XTKZ5TfIMBNQuAXzerwKpx0U35KoOm3imfT0GpU-1732097818-1.2.1.1-ZeAnEu.8D9TSZHYDoj7vwo1A1rpdKl304ZpaBn_QbAQOr211JFAb7.JRQU3EL2eIy1Dfl8HhYvH7_259.22lUz8gbchHcQ8hvfuQXMtFMCbqDBLzjNUZa9stuk.39l28IcPhH9Z2szsf3SGtNI1sAfo66Djt7sOReLK3lHw9UkJp7BdGqt6a2X9qAc8EsAI3lE480Tmt0fkHv14Oc30LSbPB_WwFmiqAki2W.Gv9hV7TN_QBFESleTDlXd.6KGflfd4.KwWF7rpSRo_cgoc9ALLLIafpxHVbe7_g5r7zvpml_Pj8fEL75fw.1GBuy16bciHBuB8s_kahuJYUnhtQFFgfTQl8_Gn6KeovBWx.PJ7nFv5sklHUfAyBVq3t30xKe8ZDydsQ_G.yipfj_In5GmmWcXGb6E4.bioDOwW_sKLtxwdTQt7Nu.RkILX_mKvXNpyLqflIVj8G7X5E8I.unw",
'Upgrade-Insecure-Requests': '1', "Upgrade-Insecure-Requests": "1",
'User-Agent': "User-Agent":
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0', "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0",
}; };
export const vegaGetInfo = async ({ export const getMeta = async ({
link, link,
providerContext, providerContext,
}: { }: {
@@ -31,8 +31,8 @@ export const vegaGetInfo = async ({
try { try {
const { axios, cheerio } = providerContext; const { axios, cheerio } = providerContext;
const url = link; const url = link;
console.log('url', url); console.log("url", url);
const baseUrl = url.split('/').slice(0, 3).join('/'); const baseUrl = url.split("/").slice(0, 3).join("/");
const response = await axios.get(url, { const response = await axios.get(url, {
headers: { headers: {
...headers, ...headers,
@@ -40,92 +40,93 @@ export const vegaGetInfo = async ({
}, },
}); });
const $ = cheerio.load(response.data); const $ = cheerio.load(response.data);
const infoContainer = $('.entry-content,.post-inner'); const infoContainer = $(".entry-content,.post-inner");
const heading = infoContainer?.find('h3'); const heading = infoContainer?.find("h3");
const imdbId = const imdbId =
heading?.next('p')?.find('a')?.[0]?.attribs?.href?.match(/tt\d+/g)?.[0] || //@ts-ignore
heading?.next("p")?.find("a")?.[0]?.attribs?.href?.match(/tt\d+/g)?.[0] ||
infoContainer.text().match(/tt\d+/g)?.[0] || infoContainer.text().match(/tt\d+/g)?.[0] ||
''; "";
// console.log(imdbId) // console.log(imdbId)
const type = heading?.next('p')?.text()?.includes('Series Name') const type = heading?.next("p")?.text()?.includes("Series Name")
? 'series' ? "series"
: 'movie'; : "movie";
// console.log(type); // console.log(type);
// title // title
const titleRegex = /Name: (.+)/; const titleRegex = /Name: (.+)/;
const title = heading?.next('p')?.text()?.match(titleRegex)?.[1] || ''; const title = heading?.next("p")?.text()?.match(titleRegex)?.[1] || "";
// console.log(title); // console.log(title);
// synopsis // synopsis
const synopsisNode = infoContainer?.find('p')?.next('h3,h4')?.next('p')?.[0] const synopsisNode = //@ts-ignore
?.children?.[0]; infoContainer?.find("p")?.next("h3,h4")?.next("p")?.[0]?.children?.[0];
const synopsis = const synopsis =
synopsisNode && 'data' in synopsisNode ? synopsisNode.data : ''; synopsisNode && "data" in synopsisNode ? synopsisNode.data : "";
// console.log(synopsis); // console.log(synopsis);
// image // image
let image = let image =
infoContainer?.find('img[data-lazy-src]')?.attr('data-lazy-src') || ''; infoContainer?.find("img[data-lazy-src]")?.attr("data-lazy-src") || "";
if (image.startsWith('//')) { if (image.startsWith("//")) {
image = 'https:' + image; image = "https:" + image;
} }
// console.log(image); // console.log(image);
// console.log({title, synopsis, image, imdbId, type}); // console.log({title, synopsis, image, imdbId, type});
/// Links /// Links
const hr = infoContainer?.first()?.find('hr'); const hr = infoContainer?.first()?.find("hr");
const list = hr?.nextUntil('hr'); const list = hr?.nextUntil("hr");
const links: Link[] = []; const links: Link[] = [];
list.each((index, element: any) => { list.each((index, element: any) => {
element = $(element); element = $(element);
// title // title
const title = element?.text() || ''; const title = element?.text() || "";
const quality = element?.text().match(/\d+p\b/)?.[0] || ''; const quality = element?.text().match(/\d+p\b/)?.[0] || "";
// console.log(title); // console.log(title);
// movieLinks // movieLinks
const movieLinks = element const movieLinks = element
?.next() ?.next()
.find('.dwd-button') .find(".dwd-button")
.text() .text()
.toLowerCase() .toLowerCase()
.includes('download') .includes("download")
? element?.next().find('.dwd-button')?.parent()?.attr('href') ? element?.next().find(".dwd-button")?.parent()?.attr("href")
: ''; : "";
// episode links // episode links
const vcloudLinks = element const vcloudLinks = element
?.next() ?.next()
.find( .find(
".btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;'],.btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: #fdf8f2;']", ".btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;'],.btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: #fdf8f2;']"
) )
?.parent() ?.parent()
?.attr('href'); ?.attr("href");
console.log(title); console.log(title);
const episodesLink = const episodesLink =
(vcloudLinks (vcloudLinks
? vcloudLinks ? vcloudLinks
: element : element
?.next() ?.next()
.find('.dwd-button') .find(".dwd-button")
.text() .text()
.toLowerCase() .toLowerCase()
.includes('episode') .includes("episode")
? element?.next().find('.dwd-button')?.parent()?.attr('href') ? element?.next().find(".dwd-button")?.parent()?.attr("href")
: '') || : "") ||
element element
?.next() ?.next()
.find( .find(
".btn-outline[style='background:linear-gradient(135deg,#0ebac3,#09d261); color: white;']", ".btn-outline[style='background:linear-gradient(135deg,#0ebac3,#09d261); color: white;']"
) )
?.parent() ?.parent()
?.attr('href'); ?.attr("href");
if (movieLinks || episodesLink) { if (movieLinks || episodesLink) {
links.push({ links.push({
title, title,
directLinks: movieLinks directLinks: movieLinks
? [{title: 'Movie', link: movieLinks, type: 'movie'}] ? [{ title: "Movie", link: movieLinks, type: "movie" }]
: [], : [],
episodesLink, episodesLink,
quality, quality,
@@ -142,15 +143,15 @@ export const vegaGetInfo = async ({
linkList: links, linkList: links,
}; };
} catch (error) { } catch (error) {
console.log('getInfo error'); console.log("getInfo error");
console.error(error); console.error(error);
// ToastAndroid.show('No response', ToastAndroid.SHORT); // ToastAndroid.show('No response', ToastAndroid.SHORT);
return { return {
title: '', title: "",
synopsis: '', synopsis: "",
image: '', image: "",
imdbId: '', imdbId: "",
type: '', type: "",
linkList: [], linkList: [],
}; };
} }

View File

@@ -0,0 +1,111 @@
import { Post, ProviderContext } from "../types";
const headers = {
Accept:
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"Cache-Control": "no-store",
"Accept-Language": "en-US,en;q=0.9",
DNT: "1",
"sec-ch-ua":
'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": '"Windows"',
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-Site": "none",
"Sec-Fetch-User": "?1",
Cookie:
"ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=gaIhTNzqSvp27JCVf7qiEUfYRfwyj0Jx9rcsn774BbE-1732694853-1.2.1.1-QKgYJvmrEz08gM9qbAp70diztE2.hseO2NNi.0imIUk_gkuWUcr7U8t5Zn_z4Ov30sIGPBES1PBgMUEa.s8e8QTkQoZjgziFmoC7YdX7s2Jnt.tYCxE_s5mMLQQBYbz_94A89IYe93Y6kyLQm_L.dvUKPPiGjn_sH3qRD0g4p9oOl0SPvH0T2W_EaD0r6mVBasbgro9dAROt_6CxshXOEGeMOnoWR.ID699FKldjMUhbXJbATAffdOY6kf2sD_iwrSl4bcetTlDHd4gusTVfxSS1pL5qNjyTU9wa38soPl1wZoqFHkEGOPWz6S7FD5ikHxX0bArFem9hiDeJXctYfWz5e_Lkc6lH7nW0Rm2XS3gxCadQSg21RkSReN6kDAEecqjgJSE4zUomkWAxFZ98TSShgGWC0ridPTpdQizPDZQ; _lscache_vary=c1d682536aea2d88fbb2574666e1f0aa",
"Upgrade-Insecure-Requests": "1",
"User-Agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0",
};
export const getPosts = async ({
filter,
page,
providerValue,
signal,
providerContext,
}: {
filter: string;
page: number;
providerValue: string;
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> => {
const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl("lux");
console.log("vegaGetPosts baseUrl:", providerValue, baseUrl);
const url = `${baseUrl}/${filter}/page/${page}/`;
console.log("lux url:", url);
return posts(url, signal, providerContext);
};
export const getSearchPosts = async ({
searchQuery,
page,
providerValue,
signal,
providerContext,
}: {
searchQuery: string;
page: number;
providerValue: string;
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> => {
const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl("lux");
console.log("vegaGetPosts baseUrl:", providerValue, baseUrl);
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
console.log("lux url:", url);
return posts(url, signal, providerContext);
};
async function posts(
url: string,
signal: AbortSignal,
providerContext: ProviderContext
): Promise<Post[]> {
try {
const { axios, cheerio } = providerContext;
const urlRes = await axios.get(url, { headers, signal });
const $ = cheerio.load(urlRes.data);
const posts: Post[] = [];
$(".blog-items")
?.children("article")
?.each((index, element) => {
const post = {
title:
$(element)
?.find("a")
?.attr("title")
?.replace("Download", "")
?.match(/^(.*?)\s*\((\d{4})\)|^(.*?)\s*\((Season \d+)\)/)?.[0] ||
$(element)?.find("a")?.attr("title")?.replace("Download", "") ||
"",
link: $(element)?.find("a")?.attr("href") || "",
image:
$(element).find("a").find("img").attr("data-lazy-src") ||
$(element).find("a").find("img").attr("data-src") ||
$(element).find("a").find("img").attr("src") ||
"",
};
if (post.image.startsWith("//")) {
post.image = "https:" + post.image;
}
posts.push(post);
});
// console.log(posts);
return posts;
} catch (error) {
console.error("vegaGetPosts error:", error);
return [];
}
}

View File

@@ -1,27 +1,27 @@
import {ProviderContext, Stream} from '../types'; import { ProviderContext, Stream } from "../types";
const headers = { const headers = {
Accept: Accept:
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
'Cache-Control': 'no-store', "Cache-Control": "no-store",
'Accept-Language': 'en-US,en;q=0.9', "Accept-Language": "en-US,en;q=0.9",
DNT: '1', DNT: "1",
'sec-ch-ua': "sec-ch-ua":
'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"', '"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',
'sec-ch-ua-mobile': '?0', "sec-ch-ua-mobile": "?0",
'sec-ch-ua-platform': '"Windows"', "sec-ch-ua-platform": '"Windows"',
'Sec-Fetch-Dest': 'document', "Sec-Fetch-Dest": "document",
'Sec-Fetch-Mode': 'navigate', "Sec-Fetch-Mode": "navigate",
'Sec-Fetch-Site': 'none', "Sec-Fetch-Site": "none",
'Sec-Fetch-User': '?1', "Sec-Fetch-User": "?1",
Cookie: Cookie:
'_lscache_vary=62abf8b96599676eb8ec211cffaeb8ff; ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=n4Y1XTKZ5TfIMBNQuAXzerwKpx0U35KoOm3imfT0GpU-1732097818-1.2.1.1-ZeAnEu.8D9TSZHYDoj7vwo1A1rpdKl304ZpaBn_QbAQOr211JFAb7.JRQU3EL2eIy1Dfl8HhYvH7_259.22lUz8gbchHcQ8hvfuQXMtFMCbqDBLzjNUZa9stuk.39l28IcPhH9Z2szsf3SGtNI1sAfo66Djt7sOReLK3lHw9UkJp7BdGqt6a2X9qAc8EsAI3lE480Tmt0fkHv14Oc30LSbPB_WwFmiqAki2W.Gv9hV7TN_QBFESleTDlXd.6KGflfd4.KwWF7rpSRo_cgoc9ALLLIafpxHVbe7_g5r7zvpml_Pj8fEL75fw.1GBuy16bciHBuB8s_kahuJYUnhtQFFgfTQl8_Gn6KeovBWx.PJ7nFv5sklHUfAyBVq3t30xKe8ZDydsQ_G.yipfj_In5GmmWcXGb6E4.bioDOwW_sKLtxwdTQt7Nu.RkILX_mKvXNpyLqflIVj8G7X5E8I.unw', "_lscache_vary=62abf8b96599676eb8ec211cffaeb8ff; ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=n4Y1XTKZ5TfIMBNQuAXzerwKpx0U35KoOm3imfT0GpU-1732097818-1.2.1.1-ZeAnEu.8D9TSZHYDoj7vwo1A1rpdKl304ZpaBn_QbAQOr211JFAb7.JRQU3EL2eIy1Dfl8HhYvH7_259.22lUz8gbchHcQ8hvfuQXMtFMCbqDBLzjNUZa9stuk.39l28IcPhH9Z2szsf3SGtNI1sAfo66Djt7sOReLK3lHw9UkJp7BdGqt6a2X9qAc8EsAI3lE480Tmt0fkHv14Oc30LSbPB_WwFmiqAki2W.Gv9hV7TN_QBFESleTDlXd.6KGflfd4.KwWF7rpSRo_cgoc9ALLLIafpxHVbe7_g5r7zvpml_Pj8fEL75fw.1GBuy16bciHBuB8s_kahuJYUnhtQFFgfTQl8_Gn6KeovBWx.PJ7nFv5sklHUfAyBVq3t30xKe8ZDydsQ_G.yipfj_In5GmmWcXGb6E4.bioDOwW_sKLtxwdTQt7Nu.RkILX_mKvXNpyLqflIVj8G7X5E8I.unw",
'Upgrade-Insecure-Requests': '1', "Upgrade-Insecure-Requests": "1",
'User-Agent': "User-Agent":
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0', "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0",
}; };
export async function vegaGetStream({ export async function getStream({
link, link,
type, type,
signal, signal,
@@ -36,8 +36,8 @@ export async function vegaGetStream({
const { hubcloudExtracter } = extractors; const { hubcloudExtracter } = extractors;
try { try {
const streamLinks: Stream[] = []; const streamLinks: Stream[] = [];
console.log('dotlink', link); console.log("dotlink", link);
if (type === 'movie') { if (type === "movie") {
// vlink // vlink
const dotlinkRes = await axios(`${link}`, { headers }); const dotlinkRes = await axios(`${link}`, { headers });
const dotlinkText = dotlinkRes.data; const dotlinkText = dotlinkRes.data;
@@ -50,66 +50,66 @@ export async function vegaGetStream({
try { try {
const $ = cheerio.load(dotlinkText); const $ = cheerio.load(dotlinkText);
const filepressLink = $( const filepressLink = $(
'.btn.btn-sm.btn-outline[style="background:linear-gradient(135deg,rgb(252,185,0) 0%,rgb(0,0,0)); color: #fdf8f2;"]', '.btn.btn-sm.btn-outline[style="background:linear-gradient(135deg,rgb(252,185,0) 0%,rgb(0,0,0)); color: #fdf8f2;"]'
) )
.parent() .parent()
.attr('href'); .attr("href");
// console.log('filepressLink', filepressLink); // console.log('filepressLink', filepressLink);
const filepressID = filepressLink?.split('/').pop(); const filepressID = filepressLink?.split("/").pop();
const filepressBaseUrl = filepressLink const filepressBaseUrl = filepressLink
?.split('/') ?.split("/")
.slice(0, -2) .slice(0, -2)
.join('/'); .join("/");
// console.log('filepressID', filepressID); // console.log('filepressID', filepressID);
// console.log('filepressBaseUrl', filepressBaseUrl); // console.log('filepressBaseUrl', filepressBaseUrl);
const filepressTokenRes = await axios.post( const filepressTokenRes = await axios.post(
filepressBaseUrl + '/api/file/downlaod/', filepressBaseUrl + "/api/file/downlaod/",
{ {
id: filepressID, id: filepressID,
method: 'indexDownlaod', method: "indexDownlaod",
captchaValue: null, captchaValue: null,
}, },
{ {
headers: { headers: {
'Content-Type': 'application/json', "Content-Type": "application/json",
Referer: filepressBaseUrl, Referer: filepressBaseUrl,
}, },
}, }
); );
// console.log('filepressTokenRes', filepressTokenRes.data); // console.log('filepressTokenRes', filepressTokenRes.data);
if (filepressTokenRes.data?.status) { if (filepressTokenRes.data?.status) {
const filepressToken = filepressTokenRes.data?.data; const filepressToken = filepressTokenRes.data?.data;
const filepressStreamLink = await axios.post( const filepressStreamLink = await axios.post(
filepressBaseUrl + '/api/file/downlaod2/', filepressBaseUrl + "/api/file/downlaod2/",
{ {
id: filepressToken, id: filepressToken,
method: 'indexDownlaod', method: "indexDownlaod",
captchaValue: null, captchaValue: null,
}, },
{ {
headers: { headers: {
'Content-Type': 'application/json', "Content-Type": "application/json",
Referer: filepressBaseUrl, Referer: filepressBaseUrl,
}, },
}, }
); );
// console.log('filepressStreamLink', filepressStreamLink.data); // console.log('filepressStreamLink', filepressStreamLink.data);
streamLinks.push({ streamLinks.push({
server: 'filepress', server: "filepress",
link: filepressStreamLink.data?.data?.[0], link: filepressStreamLink.data?.data?.[0],
type: 'mkv', type: "mkv",
}); });
} }
} catch (error) { } catch (error) {
console.log('filepress error: '); console.log("filepress error: ");
// console.error(error); // console.error(error);
} }
} }
return await hubcloudExtracter(link, signal); return await hubcloudExtracter(link, signal);
} catch (error: any) { } catch (error: any) {
console.log('getStream error: ', error); console.log("getStream error: ", error);
if (error.message.includes('Aborted')) { if (error.message.includes("Aborted")) {
} else { } else {
} }
return []; return [];

View File

@@ -1,85 +1,85 @@
export const catalogList = [ export const catalog = [
{ {
title: 'Latest', title: "Latest",
filter: '', filter: "",
}, },
{ {
title: 'Netflix', title: "Netflix",
filter: '/ott/netflix', filter: "/ott/netflix",
}, },
{ {
title: 'HBO Max', title: "HBO Max",
filter: '/ott/hbo-max', filter: "/ott/hbo-max",
}, },
{ {
title: 'Amazon Prime', title: "Amazon Prime",
filter: '/ott/amazon-prime-video', filter: "/ott/amazon-prime-video",
}, },
]; ];
export const modGenresList = [ export const genres = [
{ {
title: 'Apple TV+', title: "Apple TV+",
filter: '/ott/apple-tv', filter: "/ott/apple-tv",
}, },
{ {
title: 'Disney+', title: "Disney+",
filter: '/ott/disney-plus', filter: "/ott/disney-plus",
}, },
{ {
title: 'Hulu', title: "Hulu",
filter: '/ott/hulu', filter: "/ott/hulu",
}, },
{ {
title: 'Crunchyroll', title: "Crunchyroll",
filter: '/ott/crunchyroll', filter: "/ott/crunchyroll",
}, },
{ {
title: 'Action', title: "Action",
filter: '/movies-by-genre/action/', filter: "/movies-by-genre/action/",
}, },
{ {
title: 'Adventure', title: "Adventure",
filter: '/movies-by-genre/adventure/', filter: "/movies-by-genre/adventure/",
}, },
{ {
title: 'Animation', title: "Animation",
filter: '/movies-by-genre/animated/', filter: "/movies-by-genre/animated/",
}, },
{ {
title: 'Comedy', title: "Comedy",
filter: '/movies-by-genre/comedy/', filter: "/movies-by-genre/comedy/",
}, },
{ {
title: 'Crime', title: "Crime",
filter: '/movies-by-genre/crime/', filter: "/movies-by-genre/crime/",
}, },
{ {
title: 'Documentary', title: "Documentary",
filter: '/movies-by-genre/documentary/', filter: "/movies-by-genre/documentary/",
}, },
{ {
title: 'Fantasy', title: "Fantasy",
filter: '/movies-by-genre/fantasy/', filter: "/movies-by-genre/fantasy/",
}, },
{ {
title: 'Horror', title: "Horror",
filter: '/movies-by-genre/horror/', filter: "/movies-by-genre/horror/",
}, },
{ {
title: 'Mystery', title: "Mystery",
filter: '/movies-by-genre/mystery/', filter: "/movies-by-genre/mystery/",
}, },
{ {
title: 'Romance', title: "Romance",
filter: '/movies-by-genre/romance/', filter: "/movies-by-genre/romance/",
}, },
{ {
title: 'Thriller', title: "Thriller",
filter: '/movies-by-genre/thriller/', filter: "/movies-by-genre/thriller/",
}, },
{ {
title: 'Sci-Fi', title: "Sci-Fi",
filter: '/movies-by-genre/sci-fi/', filter: "/movies-by-genre/sci-fi/",
}, },
]; ];

52
providers/mod/episodes.ts Normal file
View File

@@ -0,0 +1,52 @@
import { EpisodeLink, ProviderContext } from "../types";
export const getEpisodes = async function ({
url,
providerContext,
}: {
url: string;
providerContext: ProviderContext;
}): Promise<EpisodeLink[]> {
const { axios, cheerio } = providerContext;
try {
if (url.includes("url=")) {
url = atob(url.split("url=")[1]);
}
const res = await axios.get(url);
const html = res.data;
let $ = cheerio.load(html);
if (url.includes("url=")) {
const newUrl = $("meta[http-equiv='refresh']")
.attr("content")
?.split("url=")[1];
const res2 = await axios.get(newUrl || url);
const html2 = res2.data;
$ = cheerio.load(html2);
}
const episodeLinks: EpisodeLink[] = [];
$("h3,h4").map((i, element) => {
const seriesTitle = $(element).text();
const episodesLink = $(element).find("a").attr("href");
if (episodesLink && episodesLink !== "#") {
episodeLinks.push({
title: seriesTitle.trim() || "No title found",
link: episodesLink || "",
});
}
});
$("a.maxbutton").map((i, element) => {
const seriesTitle = $(element).children("span").text();
const episodesLink = $(element).attr("href");
if (episodesLink && episodesLink !== "#") {
episodeLinks.push({
title: seriesTitle.trim() || "No title found",
link: episodesLink || "",
});
}
});
return episodeLinks;
} catch (err) {
console.error(err);
return [];
}
};

View File

@@ -1,17 +0,0 @@
import {modGenresList, catalogList} from './catalog';
import {modGetInfo} from './modGetInfo';
import {modGetEpisodeLinks} from './modGetEpisodesList';
import {modGetPosts, modGetPostsSearch} from './modGetPosts';
import {modGetStream} from './modGetStream';
import {ProviderType} from '../types';
export const modMovies: ProviderType = {
catalog: catalogList,
genres: modGenresList,
GetMetaData: modGetInfo,
GetHomePosts: modGetPosts,
GetStream: modGetStream,
GetEpisodeLinks: modGetEpisodeLinks,
// nonStreamableServer: ['Gdrive-Instant'],
GetSearchPosts: modGetPostsSearch,
};

71
providers/mod/meta.ts Normal file
View File

@@ -0,0 +1,71 @@
import { Info, Link, ProviderContext } from "../types";
export const getMeta = async function ({
link,
providerContext,
}: {
link: string;
providerContext: ProviderContext;
}): Promise<Info> {
try {
const { axios, cheerio } = providerContext;
const url = link;
const res = await axios.get(url);
const data = res.data;
const $ = cheerio.load(data);
const meta = {
title: $(".imdbwp__title").text(),
synopsis: $(".imdbwp__teaser").text(),
image: $(".imdbwp__thumb").find("img").attr("src") || "",
imdbId: $(".imdbwp__link").attr("href")?.split("/")[4] || "",
type: $(".thecontent").text().toLocaleLowerCase().includes("season")
? "series"
: "movie",
};
const links: Link[] = [];
$("h3,h4").map((i, element) => {
const seriesTitle = $(element).text();
// const batchZipLink = $(element)
// .next("p")
// .find(".maxbutton-batch-zip,.maxbutton-zip-download")
// .attr("href");
const episodesLink = $(element)
.next("p")
.find(
".maxbutton-episode-links,.maxbutton-g-drive,.maxbutton-af-download"
)
.attr("href");
const movieLink = $(element)
.next("p")
.find(".maxbutton-download-links")
.attr("href");
if (
movieLink ||
(episodesLink && episodesLink !== "javascript:void(0);")
) {
links.push({
title: seriesTitle.replace("Download ", "").trim() || "Download",
episodesLink: episodesLink || "",
directLinks: movieLink
? [{ link: movieLink, title: "Movie", type: "movie" }]
: [],
quality: seriesTitle?.match(/\d+p\b/)?.[0] || "",
});
}
});
// console.log('mod meta', links);
return { ...meta, linkList: links };
} catch (err) {
console.error(err);
return {
title: "",
synopsis: "",
image: "",
imdbId: "",
type: "movie",
linkList: [],
};
}
};

View File

@@ -1,52 +0,0 @@
import {EpisodeLink, ProviderContext} from '../types';
export const modGetEpisodeLinks = async function ({
url,
providerContext,
}: {
url: string;
providerContext: ProviderContext;
}): Promise<EpisodeLink[]> {
const {axios, cheerio} = providerContext;
try {
if (url.includes('url=')) {
url = atob(url.split('url=')[1]);
}
const res = await axios.get(url);
const html = res.data;
let $ = cheerio.load(html);
if (url.includes('url=')) {
const newUrl = $("meta[http-equiv='refresh']")
.attr('content')
?.split('url=')[1];
const res2 = await axios.get(newUrl || url);
const html2 = res2.data;
$ = cheerio.load(html2);
}
const episodeLinks: EpisodeLink[] = [];
$('h3,h4').map((i, element) => {
const seriesTitle = $(element).text();
const episodesLink = $(element).find('a').attr('href');
if (episodesLink && episodesLink !== '#') {
episodeLinks.push({
title: seriesTitle.trim() || 'No title found',
link: episodesLink || '',
});
}
});
$('a.maxbutton').map((i, element) => {
const seriesTitle = $(element).children('span').text();
const episodesLink = $(element).attr('href');
if (episodesLink && episodesLink !== '#') {
episodeLinks.push({
title: seriesTitle.trim() || 'No title found',
link: episodesLink || '',
});
}
});
return episodeLinks;
} catch (err) {
console.error(err);
return [];
}
};

View File

@@ -1,71 +0,0 @@
import {Info, Link, ProviderContext} from '../types';
export const modGetInfo = async function ({
link,
providerContext,
}: {
link: string;
providerContext: ProviderContext;
}): Promise<Info> {
try {
const {axios, cheerio} = providerContext;
const url = link;
const res = await axios.get(url);
const data = res.data;
const $ = cheerio.load(data);
const meta = {
title: $('.imdbwp__title').text(),
synopsis: $('.imdbwp__teaser').text(),
image: $('.imdbwp__thumb').find('img').attr('src') || '',
imdbId: $('.imdbwp__link').attr('href')?.split('/')[4] || '',
type: $('.thecontent').text().toLocaleLowerCase().includes('season')
? 'series'
: 'movie',
};
const links: Link[] = [];
$('h3,h4').map((i, element) => {
const seriesTitle = $(element).text();
// const batchZipLink = $(element)
// .next("p")
// .find(".maxbutton-batch-zip,.maxbutton-zip-download")
// .attr("href");
const episodesLink = $(element)
.next('p')
.find(
'.maxbutton-episode-links,.maxbutton-g-drive,.maxbutton-af-download',
)
.attr('href');
const movieLink = $(element)
.next('p')
.find('.maxbutton-download-links')
.attr('href');
if (
movieLink ||
(episodesLink && episodesLink !== 'javascript:void(0);')
) {
links.push({
title: seriesTitle.replace('Download ', '').trim() || 'Download',
episodesLink: episodesLink || '',
directLinks: movieLink
? [{link: movieLink, title: 'Movie', type: 'movie'}]
: [],
quality: seriesTitle?.match(/\d+p\b/)?.[0] || '',
});
}
});
// console.log('mod meta', links);
return {...meta, linkList: links};
} catch (err) {
console.error(err);
return {
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 modGetPosts = async function ({ export const getPosts = async function ({
filter, filter,
page, page,
signal, signal,
@@ -13,12 +13,12 @@ export const modGetPosts = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl, axios, cheerio } = providerContext; const { getBaseUrl, axios, cheerio } = providerContext;
const baseUrl = await getBaseUrl('Moviesmod'); const baseUrl = await getBaseUrl("Moviesmod");
const url = `${baseUrl + filter}/page/${page}/`; const url = `${baseUrl + filter}/page/${page}/`;
return posts({ url, signal, axios, cheerio }); return posts({ url, signal, axios, cheerio });
}; };
export const modGetPostsSearch = async function ({ export const getSearchPosts = async function ({
searchQuery, searchQuery,
page, page,
signal, signal,
@@ -31,7 +31,7 @@ export const modGetPostsSearch = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl, axios, cheerio } = providerContext; const { getBaseUrl, axios, cheerio } = providerContext;
const baseUrl = await getBaseUrl('Moviesmod'); const baseUrl = await getBaseUrl("Moviesmod");
const url = `${baseUrl}/search/${searchQuery}/page/${page}/`; const url = `${baseUrl}/search/${searchQuery}/page/${page}/`;
return posts({ url, signal, axios, cheerio }); return posts({ url, signal, axios, cheerio });
}; };
@@ -44,20 +44,20 @@ async function posts({
}: { }: {
url: string; url: string;
signal: AbortSignal; signal: AbortSignal;
axios: ProviderContext['axios']; axios: ProviderContext["axios"];
cheerio: ProviderContext['cheerio']; cheerio: ProviderContext["cheerio"];
}): Promise<Post[]> { }): Promise<Post[]> {
try { try {
const res = await axios.get(url, { signal }); const res = await axios.get(url, { signal });
const data = res.data; const data = res.data;
const $ = cheerio.load(data); const $ = cheerio.load(data);
const catalog: Post[] = []; const catalog: Post[] = [];
$('.post-cards') $(".post-cards")
.find('article') .find("article")
.map((i, element) => { .map((i, element) => {
const title = $(element).find('a').attr('title'); const title = $(element).find("a").attr("title");
const link = $(element).find('a').attr('href'); const link = $(element).find("a").attr("href");
const image = $(element).find('img').attr('src'); const image = $(element).find("img").attr("src");
if (title && link && image) { if (title && link && image) {
catalog.push({ catalog.push({
title: title, title: title,
@@ -68,7 +68,7 @@ async function posts({
}); });
return catalog; return catalog;
} catch (err) { } catch (err) {
console.error('modGetPosts error ', err); console.error("modGetPosts error ", err);
return []; return [];
} }
} }

View File

@@ -1,26 +1,26 @@
import {Stream, ProviderContext, EpisodeLink} from '../types'; import { Stream, ProviderContext, EpisodeLink } from "../types";
const headers = { const headers = {
Accept: Accept:
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
'Cache-Control': 'no-store', "Cache-Control": "no-store",
'Accept-Language': 'en-US,en;q=0.9', "Accept-Language": "en-US,en;q=0.9",
DNT: '1', DNT: "1",
'sec-ch-ua': "sec-ch-ua":
'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"', '"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',
'sec-ch-ua-mobile': '?0', "sec-ch-ua-mobile": "?0",
'sec-ch-ua-platform': '"Windows"', "sec-ch-ua-platform": '"Windows"',
'Sec-Fetch-Dest': 'document', "Sec-Fetch-Dest": "document",
'Sec-Fetch-Mode': 'navigate', "Sec-Fetch-Mode": "navigate",
Cookie: 'popads_user_id=6ba8fe60a481387a3249f05aa058822d', Cookie: "popads_user_id=6ba8fe60a481387a3249f05aa058822d",
'Sec-Fetch-Site': 'none', "Sec-Fetch-Site": "none",
'Sec-Fetch-User': '?1', "Sec-Fetch-User": "?1",
'Upgrade-Insecure-Requests': '1', "Upgrade-Insecure-Requests": "1",
'User-Agent': "User-Agent":
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0', "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0",
}; };
export const modGetStream = async function ({ export const getStream = async function ({
link: url, link: url,
type, type,
providerContext, providerContext,
@@ -40,38 +40,38 @@ export const modGetStream = async function ({
}): Promise<EpisodeLink[]> { }): Promise<EpisodeLink[]> {
const { axios, cheerio } = providerContext; const { axios, cheerio } = providerContext;
try { try {
if (url.includes('url=')) { if (url.includes("url=")) {
url = atob(url.split('url=')[1]); url = atob(url.split("url=")[1]);
} }
const res = await axios.get(url); const res = await axios.get(url);
const html = res.data; const html = res.data;
let $ = cheerio.load(html); let $ = cheerio.load(html);
if (url.includes('url=')) { if (url.includes("url=")) {
const newUrl = $("meta[http-equiv='refresh']") const newUrl = $("meta[http-equiv='refresh']")
.attr('content') .attr("content")
?.split('url=')[1]; ?.split("url=")[1];
const res2 = await axios.get(newUrl || url); const res2 = await axios.get(newUrl || url);
const html2 = res2.data; const html2 = res2.data;
$ = cheerio.load(html2); $ = cheerio.load(html2);
} }
const episodeLinks: EpisodeLink[] = []; const episodeLinks: EpisodeLink[] = [];
$('h3,h4').map((i, element) => { $("h3,h4").map((i, element) => {
const seriesTitle = $(element).text(); const seriesTitle = $(element).text();
const episodesLink = $(element).find('a').attr('href'); const episodesLink = $(element).find("a").attr("href");
if (episodesLink && episodesLink !== '#') { if (episodesLink && episodesLink !== "#") {
episodeLinks.push({ episodeLinks.push({
title: seriesTitle.trim() || 'No title found', title: seriesTitle.trim() || "No title found",
link: episodesLink || '', link: episodesLink || "",
}); });
} }
}); });
$('a.maxbutton').map((i, element) => { $("a.maxbutton").map((i, element) => {
const seriesTitle = $(element).children('span').text(); const seriesTitle = $(element).children("span").text();
const episodesLink = $(element).attr('href'); const episodesLink = $(element).attr("href");
if (episodesLink && episodesLink !== '#') { if (episodesLink && episodesLink !== "#") {
episodeLinks.push({ episodeLinks.push({
title: seriesTitle.trim() || 'No title found', title: seriesTitle.trim() || "No title found",
link: episodesLink || '', link: episodesLink || "",
}); });
} }
}); });
@@ -81,8 +81,8 @@ export const modGetStream = async function ({
return []; return [];
} }
}; };
console.log('modGetStream', type, url); console.log("modGetStream", type, url);
if (type === 'movie') { if (type === "movie") {
const servers = await modGetEpisodeLinks({ url, providerContext }); const servers = await modGetEpisodeLinks({ url, providerContext });
url = servers[0].link || url; url = servers[0].link || url;
} }
@@ -103,17 +103,17 @@ export const modGetStream = async function ({
const $drive = cheerio.load(driveHtml); const $drive = cheerio.load(driveHtml);
try { try {
const resumeBot = $drive('.btn.btn-light').attr('href') || ''; const resumeBot = $drive(".btn.btn-light").attr("href") || "";
const resumeBotRes = await axios.get(resumeBot, { headers }); const resumeBotRes = await axios.get(resumeBot, { headers });
const resumeBotToken = resumeBotRes.data.match( const resumeBotToken = resumeBotRes.data.match(
/formData\.append\('token', '([a-f0-9]+)'\)/, /formData\.append\('token', '([a-f0-9]+)'\)/
)[1]; )[1];
const resumeBotBody = new FormData(); const resumeBotBody = new FormData();
resumeBotBody.append('token', resumeBotToken); resumeBotBody.append("token", resumeBotToken);
const resumeBotPath = resumeBotRes.data.match( const resumeBotPath = resumeBotRes.data.match(
/fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/, /fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/
)[1]; )[1];
const resumeBotBaseUrl = resumeBot.split('/download')[0]; const resumeBotBaseUrl = resumeBot.split("/download")[0];
// console.log( // console.log(
// 'resumeBotPath', // 'resumeBotPath',
// resumeBotBaseUrl + '/download?id=' + resumeBotPath, // resumeBotBaseUrl + '/download?id=' + resumeBotPath,
@@ -121,84 +121,84 @@ export const modGetStream = async function ({
// console.log('resumeBotBody', resumeBotToken); // console.log('resumeBotBody', resumeBotToken);
const resumeBotDownload = await fetch( const resumeBotDownload = await fetch(
resumeBotBaseUrl + '/download?id=' + resumeBotPath, resumeBotBaseUrl + "/download?id=" + resumeBotPath,
{ {
method: 'POST', method: "POST",
body: resumeBotBody, body: resumeBotBody,
headers: { headers: {
Referer: resumeBot, Referer: resumeBot,
Cookie: 'PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308', Cookie: "PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308",
},
}, },
}
); );
const resumeBotDownloadData = await resumeBotDownload.json(); const resumeBotDownloadData = await resumeBotDownload.json();
console.log('resumeBotDownloadData', resumeBotDownloadData.url); console.log("resumeBotDownloadData", resumeBotDownloadData.url);
servers.push({ servers.push({
server: 'ResumeBot', server: "ResumeBot",
link: resumeBotDownloadData.url, link: resumeBotDownloadData.url,
type: 'mkv', type: "mkv",
}); });
} catch (err) { } catch (err) {
console.log('ResumeBot link not found', err); console.log("ResumeBot link not found", err);
} }
// CF workers type 1 // CF workers type 1
try { try {
const cfWorkersLink = driveLink.replace('/file', '/wfile') + '?type=1'; const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=1";
const cfWorkersRes = await axios.get(cfWorkersLink, { headers }); const cfWorkersRes = await axios.get(cfWorkersLink, { headers });
const cfWorkersHtml = cfWorkersRes.data; const cfWorkersHtml = cfWorkersRes.data;
const $cfWorkers = cheerio.load(cfWorkersHtml); const $cfWorkers = cheerio.load(cfWorkersHtml);
const cfWorkersStream = $cfWorkers('.btn-success'); const cfWorkersStream = $cfWorkers(".btn-success");
cfWorkersStream.each((i, el) => { cfWorkersStream.each((i, el) => {
const link = el.attribs.href; const link = (el as any).attribs?.href;
if (link) { if (link) {
servers.push({ servers.push({
server: 'Cf Worker 1.' + i, server: "Cf Worker 1." + i,
link: link, link: link,
type: 'mkv', type: "mkv",
}); });
} }
}); });
} catch (err) { } catch (err) {
console.log('CF workers link not found', err); console.log("CF workers link not found", err);
} }
// CF workers type 2 // CF workers type 2
try { try {
const cfWorkersLink = driveLink.replace('/file', '/wfile') + '?type=2'; const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=2";
const cfWorkersRes = await axios.get(cfWorkersLink, { headers }); const cfWorkersRes = await axios.get(cfWorkersLink, { headers });
const cfWorkersHtml = cfWorkersRes.data; const cfWorkersHtml = cfWorkersRes.data;
const $cfWorkers = cheerio.load(cfWorkersHtml); const $cfWorkers = cheerio.load(cfWorkersHtml);
const cfWorkersStream = $cfWorkers('.btn-success'); const cfWorkersStream = $cfWorkers(".btn-success");
cfWorkersStream.each((i, el) => { cfWorkersStream.each((i, el) => {
const link = el.attribs.href; const link = (el as any).attribs?.href;
if (link) { if (link) {
servers.push({ servers.push({
server: 'Cf Worker 2.' + i, server: "Cf Worker 2." + i,
link: link, link: link,
type: 'mkv', type: "mkv",
}); });
} }
}); });
} catch (err) { } catch (err) {
console.log('CF workers link not found', err); console.log("CF workers link not found", err);
} }
// gdrive // gdrive
//instant link //instant link
try { try {
const seed = $drive('.btn-danger').attr('href') || ''; const seed = $drive(".btn-danger").attr("href") || "";
const instantToken = seed.split('=')[1]; const instantToken = seed.split("=")[1];
// console.log('InstantToken', instantToken); // console.log('InstantToken', instantToken);
const InstantFromData = new FormData(); const InstantFromData = new FormData();
InstantFromData.append('keys', instantToken); InstantFromData.append("keys", instantToken);
const videoSeedUrl = seed.split('/').slice(0, 3).join('/') + '/api'; const videoSeedUrl = seed.split("/").slice(0, 3).join("/") + "/api";
// console.log('videoSeedUrl', videoSeedUrl); // console.log('videoSeedUrl', videoSeedUrl);
const instantLinkRes = await fetch(videoSeedUrl, { const instantLinkRes = await fetch(videoSeedUrl, {
method: 'POST', method: "POST",
body: InstantFromData, body: InstantFromData,
headers: { headers: {
'x-token': videoSeedUrl, "x-token": videoSeedUrl,
}, },
}); });
const instantLinkData = await instantLinkRes.json(); const instantLinkData = await instantLinkRes.json();
@@ -206,32 +206,32 @@ export const modGetStream = async function ({
if (instantLinkData.error === false) { if (instantLinkData.error === false) {
const instantLink = instantLinkData.url; const instantLink = instantLinkData.url;
servers.push({ servers.push({
server: 'Gdrive-Instant', server: "Gdrive-Instant",
link: instantLink, link: instantLink,
type: 'mkv', type: "mkv",
}); });
} else { } else {
console.log('Instant link not found', instantLinkData); console.log("Instant link not found", instantLinkData);
} }
} catch (err) { } catch (err) {
console.log('Instant link not found', err); console.log("Instant link not found", err);
} }
return servers; return servers;
} catch (err) { } catch (err) {
console.log('getStream error', err); console.log("getStream error", err);
return []; return [];
} }
}; };
const isDriveLink = async (ddl: string) => { const isDriveLink = async (ddl: string) => {
if (ddl.includes('drive')) { if (ddl.includes("drive")) {
const driveLeach = await fetch(ddl); const driveLeach = await fetch(ddl);
const driveLeachData = await driveLeach.text(); const driveLeachData = await driveLeach.text();
const pathMatch = driveLeachData.match( const pathMatch = driveLeachData.match(
/window\.location\.replace\("([^"]+)"\)/, /window\.location\.replace\("([^"]+)"\)/
); );
const path = pathMatch?.[1]; const path = pathMatch?.[1];
const mainUrl = ddl.split('/')[2]; const mainUrl = ddl.split("/")[2];
console.log(`driveUrl = https://${mainUrl}${path}`); console.log(`driveUrl = https://${mainUrl}${path}`);
return `https://${mainUrl}${path}`; return `https://${mainUrl}${path}`;
} else { } else {
@@ -242,11 +242,11 @@ const isDriveLink = async (ddl: string) => {
async function modExtractor(url: string, providerContext: ProviderContext) { async function modExtractor(url: string, providerContext: ProviderContext) {
const { axios, cheerio } = providerContext; const { axios, cheerio } = providerContext;
try { try {
const wpHttp = url.split('sid=')[1]; const wpHttp = url.split("sid=")[1];
var bodyFormData0 = new FormData(); var bodyFormData0 = new FormData();
bodyFormData0.append('_wp_http', wpHttp); bodyFormData0.append("_wp_http", wpHttp);
const res = await fetch(url.split('?')[0], { const res = await fetch(url.split("?")[0], {
method: 'POST', method: "POST",
body: bodyFormData0, body: bodyFormData0,
}); });
const data = await res.text(); const data = await res.text();
@@ -255,25 +255,25 @@ async function modExtractor(url: string, providerContext: ProviderContext) {
const $ = cheerio.load(html); const $ = cheerio.load(html);
// find input with name="_wp_http2" // find input with name="_wp_http2"
const wpHttp2 = $('input').attr('name', '_wp_http2').val(); const wpHttp2 = $("input").attr("name", "_wp_http2").val();
// console.log('wpHttp2', wpHttp2); // console.log('wpHttp2', wpHttp2);
// form data // form data
var bodyFormData = new FormData(); var bodyFormData = new FormData();
bodyFormData.append('_wp_http2', wpHttp2); bodyFormData.append("_wp_http2", wpHttp2);
const formUrl1 = $('form').attr('action'); const formUrl1 = $("form").attr("action");
const formUrl = formUrl1 || url.split('?')[0]; const formUrl = formUrl1 || url.split("?")[0];
const res2 = await fetch(formUrl, { const res2 = await fetch(formUrl, {
method: 'POST', method: "POST",
body: bodyFormData, body: bodyFormData,
}); });
const html2: any = await res2.text(); const html2: any = await res2.text();
const link = html2.match(/setAttribute\("href",\s*"(.*?)"/)[1]; const link = html2.match(/setAttribute\("href",\s*"(.*?)"/)[1];
console.log(link); console.log(link);
const cookie = link.split('=')[1]; const cookie = link.split("=")[1];
console.log('cookie', cookie); console.log("cookie", cookie);
const downloadLink = await axios.get(link, { const downloadLink = await axios.get(link, {
headers: { headers: {
@@ -283,6 +283,6 @@ async function modExtractor(url: string, providerContext: ProviderContext) {
}); });
return downloadLink; return downloadLink;
} catch (err) { } catch (err) {
console.log('modGetStream error', err); console.log("modGetStream error", err);
} }
} }

View File

@@ -1,8 +1,8 @@
import {allCatalog, allGenresList} from '../autoEmbed/allCatalog'; import { allCatalog, allGenresList } from "../autoEmbed/catalog";
import {allGetInfo} from '../autoEmbed/allGetInfo'; import { allGetInfo } from../autoEmbed/metafo";
import {allGetPost, allGetSearchPosts} from '../autoEmbed/allGetPost'; import { allGetPost, allGetSearchPosts } from "../autoEmbed/posts";
import {ProviderType} from '../types'; import { ProviderType } from "../types";
import {mpGetStream} from './mpGetStream'; import { mpGetStream } from "./stream";
export const moviesApi: ProviderType = { export const moviesApi: ProviderType = {
catalog: allCatalog, catalog: allCatalog,

View File

@@ -0,0 +1,77 @@
export const catalog = [
{
title: "Trending",
filter: "/trending/",
},
{
title: "Netflix",
filter: "/genre/netflix/",
},
{
title: "Amazon Prime",
filter: "/genre/amazon-prime/",
},
{
title: "Disney Hotstar",
filter: "/genre/disney-hotstar/",
},
];
export const genres = [
{
title: "Action",
filter: "/genre/action/",
},
{
title: "Adventure",
filter: "/genre/adventure/",
},
{
title: "Animation",
filter: "/genre/animation/",
},
{
title: "Comedy",
filter: "/genre/comedy/",
},
{
title: "Crime",
filter: "/genre/crime/",
},
{
title: "Drama",
filter: "/genre/drama/",
},
{
title: "Family",
filter: "/genre/family/",
},
{
title: "Fantasy",
filter: "/genre/fantasy/",
},
{
title: "History",
filter: "/genre/history/",
},
{
title: "Horror",
filter: "/genre/horror/",
},
{
title: "Mystery",
filter: "/genre/mystery/",
},
{
title: "Romance",
filter: "/genre/romance/",
},
{
title: "Science Fiction",
filter: "/genre/science-fiction/",
},
{
title: "Thriller",
filter: "/genre/thriller/",
},
];

View File

@@ -1,14 +0,0 @@
import {multiGenresList, multiCatalog} from './multiCatalog';
import {multiGetInfo} from './multiGetInfo';
import {multiGetPosts, multiGetPostsSearch} from './multiPosts';
import {multiGetStream} from './multiGetStream';
import {ProviderType} from '../types';
export const multiMovies: ProviderType = {
catalog: multiCatalog,
genres: multiGenresList,
GetMetaData: multiGetInfo,
GetHomePosts: multiGetPosts,
GetStream: multiGetStream,
GetSearchPosts: multiGetPostsSearch,
};

View File

@@ -1,6 +1,6 @@
import {Info, Link, ProviderContext} from '../types'; import { Info, Link, ProviderContext } from "../types";
export const multiGetInfo = async function ({ export const getMeta = async function ({
link, link,
providerContext, providerContext,
}: { }: {
@@ -13,34 +13,34 @@ export const multiGetInfo = async function ({
const res = await axios.get(url); const res = await axios.get(url);
const data = res.data; const data = res.data;
const $ = cheerio.load(data); const $ = cheerio.load(data);
const type = url.includes('tvshows') ? 'series' : 'movie'; const type = url.includes("tvshows") ? "series" : "movie";
const imdbId = ''; const imdbId = "";
const title = url.split('/')[4].replace(/-/g, ' '); const title = url.split("/")[4].replace(/-/g, " ");
const image = $('.g-item').find('a').attr('href') || ''; const image = $(".g-item").find("a").attr("href") || "";
const synopsis = $('.wp-content').find('p').text() || ''; const synopsis = $(".wp-content").find("p").text() || "";
// Links // Links
const links: Link[] = []; const links: Link[] = [];
if (type === 'series') { if (type === "series") {
$('#seasons') $("#seasons")
.children() .children()
.map((i, element) => { .map((i, element) => {
const title = $(element) const title = $(element)
.find('.title') .find(".title")
.children() .children()
.remove() .remove()
.end() .end()
.text(); .text();
let episodesList: { title: string; link: string }[] = []; let episodesList: { title: string; link: string }[] = [];
$(element) $(element)
.find('.episodios') .find(".episodios")
.children() .children()
.map((i, element) => { .map((i, element) => {
const title = const title =
'Episode' + "Episode" +
$(element).find('.numerando').text().trim().split('-')[1]; $(element).find(".numerando").text().trim().split("-")[1];
const link = $(element).find('a').attr('href'); const link = $(element).find("a").attr("href");
if (title && link) { if (title && link) {
episodesList.push({ title, link }); episodesList.push({ title, link });
} }
@@ -55,7 +55,7 @@ export const multiGetInfo = async function ({
} else { } else {
links.push({ links.push({
title: title, title: title,
directLinks: [{title: title, link: url.slice(0, -1), type: 'movie'}], directLinks: [{ title: title, link: url.slice(0, -1), type: "movie" }],
}); });
} }
// console.log('multi meta', links); // console.log('multi meta', links);
@@ -71,11 +71,11 @@ export const multiGetInfo = async function ({
} catch (err) { } catch (err) {
console.error(err); console.error(err);
return { return {
title: '', title: "",
synopsis: '', synopsis: "",
image: '', image: "",
imdbId: '', imdbId: "",
type: 'movie', type: "movie",
linkList: [], linkList: [],
}; };
} }

View File

@@ -1,77 +0,0 @@
export const multiCatalog = [
{
title: 'Trending',
filter: '/trending/',
},
{
title: 'Netflix',
filter: '/genre/netflix/',
},
{
title: 'Amazon Prime',
filter: '/genre/amazon-prime/',
},
{
title: 'Disney Hotstar',
filter: '/genre/disney-hotstar/',
},
];
export const multiGenresList = [
{
title: 'Action',
filter: '/genre/action/',
},
{
title: 'Adventure',
filter: '/genre/adventure/',
},
{
title: 'Animation',
filter: '/genre/animation/',
},
{
title: 'Comedy',
filter: '/genre/comedy/',
},
{
title: 'Crime',
filter: '/genre/crime/',
},
{
title: 'Drama',
filter: '/genre/drama/',
},
{
title: 'Family',
filter: '/genre/family/',
},
{
title: 'Fantasy',
filter: '/genre/fantasy/',
},
{
title: 'History',
filter: '/genre/history/',
},
{
title: 'Horror',
filter: '/genre/horror/',
},
{
title: 'Mystery',
filter: '/genre/mystery/',
},
{
title: 'Romance',
filter: '/genre/romance/',
},
{
title: 'Science Fiction',
filter: '/genre/science-fiction/',
},
{
title: 'Thriller',
filter: '/genre/thriller/',
},
];

View File

@@ -1,6 +1,6 @@
import {Post, ProviderContext} from '../types'; import { Post, ProviderContext } from "../types";
export const multiGetPosts = async function ({ export const getPosts = async function ({
filter, filter,
page, page,
signal, signal,
@@ -13,12 +13,12 @@ export const multiGetPosts = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl, cheerio } = providerContext; const { getBaseUrl, cheerio } = providerContext;
const baseUrl = await getBaseUrl('multi'); const baseUrl = await getBaseUrl("multi");
const url = `${baseUrl + filter}page/${page}/`; const url = `${baseUrl + filter}page/${page}/`;
return posts({ url, signal, cheerio }); return posts({ url, signal, cheerio });
}; };
export const multiGetPostsSearch = async function ({ export const getSearchPosts = async function ({
searchQuery, searchQuery,
signal, signal,
@@ -31,7 +31,7 @@ export const multiGetPostsSearch = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<Post[]> { }): Promise<Post[]> {
const { getBaseUrl, cheerio } = providerContext; const { getBaseUrl, cheerio } = providerContext;
const baseUrl = await getBaseUrl('multi'); const baseUrl = await getBaseUrl("multi");
const url = `${baseUrl}/?s=${searchQuery}`; const url = `${baseUrl}/?s=${searchQuery}`;
return posts({ url, signal, cheerio }); return posts({ url, signal, cheerio });
}; };
@@ -43,21 +43,21 @@ async function posts({
}: { }: {
url: string; url: string;
signal: AbortSignal; signal: AbortSignal;
cheerio: ProviderContext['cheerio']; cheerio: ProviderContext["cheerio"];
}): Promise<Post[]> { }): Promise<Post[]> {
try { try {
const res = await fetch(url, { signal }); const res = await fetch(url, { signal });
const data = await res.text(); const data = await res.text();
const $ = cheerio.load(data); const $ = cheerio.load(data);
const catalog: Post[] = []; const catalog: Post[] = [];
$('.items.full') $(".items.full")
.children() .children()
.map((i, element) => { .map((i, element) => {
const title = $(element).find('.poster').find('img').attr('alt'); const title = $(element).find(".poster").find("img").attr("alt");
const link = $(element).find('.poster').find('a').attr('href'); const link = $(element).find(".poster").find("a").attr("href");
const image = const image =
$(element).find('.poster').find('img').attr('data-src') || $(element).find(".poster").find("img").attr("data-src") ||
$(element).find('.poster').find('img').attr('src'); $(element).find(".poster").find("img").attr("src");
if (title && link && image) { if (title && link && image) {
catalog.push({ catalog.push({
title: title, title: title,
@@ -68,7 +68,7 @@ async function posts({
}); });
return catalog; return catalog;
} catch (err) { } catch (err) {
console.error('multiGetPosts error ', err); console.error("multiGetPosts error ", err);
return []; return [];
} }
} }

View File

@@ -1,6 +1,6 @@
import {Stream, ProviderContext, TextTracks, TextTrackType} from '../types'; import { Stream, ProviderContext, TextTracks, TextTrackType } from "../types";
export const multiGetStream = async function ({ export const getStream = async function ({
link: url, link: url,
providerContext, providerContext,
}: { }: {
@@ -10,14 +10,14 @@ export const multiGetStream = async function ({
}): Promise<Stream[]> { }): Promise<Stream[]> {
const { axios, cheerio } = providerContext; const { axios, cheerio } = providerContext;
const headers = { const headers = {
'sec-ch-ua': "sec-ch-ua":
'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"', '"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',
'sec-ch-ua-mobile': '?0', "sec-ch-ua-mobile": "?0",
'sec-ch-ua-platform': '"Windows"', "sec-ch-ua-platform": '"Windows"',
Referer: 'https://multimovies.online/', Referer: "https://multimovies.online/",
'Sec-Fetch-User': '?1', "Sec-Fetch-User": "?1",
'User-Agent': "User-Agent":
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0', "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0",
}; };
try { try {
@@ -25,53 +25,53 @@ export const multiGetStream = async function ({
const html = res.data; const html = res.data;
const $ = cheerio.load(html); const $ = cheerio.load(html);
const streamLinks: Stream[] = []; const streamLinks: Stream[] = [];
const postId = $('#player-option-1').attr('data-post'); const postId = $("#player-option-1").attr("data-post");
const nume = $('#player-option-1').attr('data-nume'); const nume = $("#player-option-1").attr("data-nume");
const typeValue = $('#player-option-1').attr('data-type'); const typeValue = $("#player-option-1").attr("data-type");
const baseUrl = url.split('/').slice(0, 3).join('/'); const baseUrl = url.split("/").slice(0, 3).join("/");
console.log('baseUrl', baseUrl); console.log("baseUrl", baseUrl);
const formData = new FormData(); const formData = new FormData();
formData.append('action', 'doo_player_ajax'); formData.append("action", "doo_player_ajax");
formData.append('post', postId); formData.append("post", postId || "");
formData.append('nume', nume); formData.append("nume", nume || "");
formData.append('type', typeValue); formData.append("type", typeValue || "");
console.log('formData', formData); console.log("formData", formData);
const playerRes = await fetch(`${baseUrl}/wp-admin/admin-ajax.php`, { const playerRes = await fetch(`${baseUrl}/wp-admin/admin-ajax.php`, {
headers: headers, headers: headers,
body: formData, body: formData,
method: 'POST', method: "POST",
}); });
const playerData = await playerRes.json(); const playerData = await playerRes.json();
console.log('playerData', playerData); console.log("playerData", playerData);
let ifameUrl = let ifameUrl =
playerData?.embed_url?.match(/<iframe[^>]+src="([^"]+)"[^>]*>/i)?.[1] || playerData?.embed_url?.match(/<iframe[^>]+src="([^"]+)"[^>]*>/i)?.[1] ||
playerData?.embed_url; playerData?.embed_url;
console.log('ifameUrl', ifameUrl); console.log("ifameUrl", ifameUrl);
if (!ifameUrl.includes('multimovies')) { if (!ifameUrl.includes("multimovies")) {
let playerBaseUrl = ifameUrl.split('/').slice(0, 3).join('/'); let playerBaseUrl = ifameUrl.split("/").slice(0, 3).join("/");
const newPlayerBaseUrl = await axios.head(playerBaseUrl, { headers }); const newPlayerBaseUrl = await axios.head(playerBaseUrl, { headers });
if (newPlayerBaseUrl) { if (newPlayerBaseUrl) {
playerBaseUrl = newPlayerBaseUrl.request?.responseURL playerBaseUrl = newPlayerBaseUrl.request?.responseURL
?.split('/') ?.split("/")
.slice(0, 3) .slice(0, 3)
.join('/'); .join("/");
} }
const playerId = ifameUrl.split('/').pop(); const playerId = ifameUrl.split("/").pop();
const NewformData = new FormData(); const NewformData = new FormData();
NewformData.append('sid', playerId); NewformData.append("sid", playerId);
console.log( console.log(
'NewformData', "NewformData",
playerBaseUrl + '/embedhelper.php', playerBaseUrl + "/embedhelper.php",
NewformData, NewformData
); );
const playerRes = await fetch(`${playerBaseUrl}/embedhelper.php`, { const playerRes = await fetch(`${playerBaseUrl}/embedhelper.php`, {
headers: headers, headers: headers,
body: NewformData, body: NewformData,
method: 'POST', method: "POST",
}); });
const playerData = await playerRes.json(); const playerData = await playerRes.json();
// console.log('playerData', playerData); // console.log('playerData', playerData);
@@ -80,7 +80,7 @@ export const multiGetStream = async function ({
JSON.parse(atob(playerData?.mresult))?.smwh || JSON.parse(atob(playerData?.mresult))?.smwh ||
playerData?.mresult?.smwh; playerData?.mresult?.smwh;
const newIframeUrl = siteUrl + siteId; const newIframeUrl = siteUrl + siteId;
console.log('newIframeUrl', newIframeUrl); console.log("newIframeUrl", newIframeUrl);
if (newIframeUrl) { if (newIframeUrl) {
ifameUrl = newIframeUrl; ifameUrl = newIframeUrl;
} }
@@ -97,7 +97,7 @@ export const multiGetStream = async function ({
var functionRegex = var functionRegex =
/eval\(function\((.*?)\)\{.*?return p\}.*?\('(.*?)'\.split/; /eval\(function\((.*?)\)\{.*?return p\}.*?\('(.*?)'\.split/;
var match = functionRegex.exec(iframeData); var match = functionRegex.exec(iframeData);
let p = ''; let p = "";
if (match) { if (match) {
// var params = match[1].split(',').map(param => param.trim()); // var params = match[1].split(',').map(param => param.trim());
var encodedString = match[2]; var encodedString = match[2];
@@ -107,19 +107,19 @@ export const multiGetStream = async function ({
p = encodedString.split("',36,")?.[0].trim(); p = encodedString.split("',36,")?.[0].trim();
let a = 36; let a = 36;
let c = encodedString.split("',36,")[1].slice(2).split('|').length; let c = encodedString.split("',36,")[1].slice(2).split("|").length;
let k = encodedString.split("',36,")[1].slice(2).split('|'); let k = encodedString.split("',36,")[1].slice(2).split("|");
while (c--) { while (c--) {
if (k[c]) { if (k[c]) {
var regex = new RegExp('\\b' + c.toString(a) + '\\b', 'g'); var regex = new RegExp("\\b" + c.toString(a) + "\\b", "g");
p = p.replace(regex, k[c]); p = p.replace(regex, k[c]);
} }
} }
// console.log('Decoded String:', p); // console.log('Decoded String:', p);
} else { } else {
console.log('No match found'); console.log("No match found");
} }
const streamUrl = p?.match(/https?:\/\/[^"]+?\.m3u8[^"]*/)?.[0]; const streamUrl = p?.match(/https?:\/\/[^"]+?\.m3u8[^"]*/)?.[0];
@@ -138,13 +138,13 @@ export const multiGetStream = async function ({
}); });
}); });
} }
console.log('streamUrl', streamUrl); console.log("streamUrl", streamUrl);
console.log('newUrl', streamUrl?.replace(/&i=\d+,'\.4&/, '&i=0.4&')); console.log("newUrl", streamUrl?.replace(/&i=\d+,'\.4&/, "&i=0.4&"));
if (streamUrl) { if (streamUrl) {
streamLinks.push({ streamLinks.push({
server: 'Multi', server: "Multi",
link: streamUrl.replace(/&i=\d+,'\.4&/, '&i=0.4&'), link: streamUrl.replace(/&i=\d+,'\.4&/, "&i=0.4&"),
type: 'm3u8', type: "m3u8",
subtitles: subtitles, subtitles: subtitles,
}); });
} }

View File

@@ -0,0 +1,16 @@
export const catalog = [
{
title: "Home",
filter: "/mobile/home?app=1",
},
{
title: "Series",
filter: "/mobile/series",
},
{
title: "Movies",
filter: "/mobile/movies",
},
];
export const genres = [];

View File

@@ -0,0 +1,49 @@
import { EpisodeLink, ProviderContext } from "../types";
export const getEpisodes = async function ({
url: link,
providerContext,
}: {
url: string;
providerContext: ProviderContext;
}): Promise<EpisodeLink[]> {
const { getBaseUrl, axios } = providerContext;
let providerValue = "netflixMirror";
try {
const baseUrl = await getBaseUrl("nfMirror");
const url =
`${baseUrl}${
providerValue === "netflixMirror"
? "/episodes.php?s="
: "/pv/episodes.php?s="
}` +
link +
"&t=" +
Math.round(new Date().getTime() / 1000);
console.log("nfEpisodesUrl", url);
const res = await axios.get(url, {
headers: {
"Content-Type": "application/json",
"User-Agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36",
"Accept-Language": "en-US,en;q=0.9",
},
});
const data = res.data;
console.log("nfEpisodes", data);
const episodeList: EpisodeLink[] = [];
data?.episodes?.map((episode: any) => {
episodeList.push({
title: "Episode " + episode?.ep.replace("E", ""),
link: episode?.id,
});
});
return episodeList;
} catch (err) {
console.error("nfGetEpisodes error", err);
return [];
}
};

View File

@@ -1,16 +0,0 @@
import {nfCatalog, nfGenresList} from './nfCatalog';
import {nfGetInfo} from './nfGetInfo';
import {nfGetPost, nfGetPostsSearch} from './nfGetPost';
import {nfGetEpisodes} from './nfGetEpisodes';
import {nfGetStream} from './nfGetSteam';
import {ProviderType} from '../types';
export const netflixMirror: ProviderType = {
catalog: nfCatalog,
genres: nfGenresList,
GetMetaData: nfGetInfo,
GetHomePosts: nfGetPost,
GetStream: nfGetStream,
GetEpisodeLinks: nfGetEpisodes,
GetSearchPosts: nfGetPostsSearch,
};

View File

@@ -1,46 +1,46 @@
import {Info, Link} from '../types'; import { Info, Link } from "../types";
export const nfGetInfo = async function ({ export const getMeta = async function ({
link, link,
}: { }: {
link: string; link: string;
}): Promise<Info> { }): Promise<Info> {
let providerValue = 'netflixMirror'; let providerValue = "netflixMirror";
try { try {
const isPrime = const isPrime =
providerValue === 'primeMirror' ? 'isPrime=true' : 'isPrime=false'; providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false";
const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${encodeURIComponent( const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${encodeURIComponent(
link, link
)}`; )}`;
console.log('nfifo', url); console.log("nfifo", url);
const res = await fetch(url, { const res = await fetch(url, {
credentials: 'omit', credentials: "omit",
}); });
const data = await res.json(); const data = await res.json();
const id = link.split('id=')[1]?.split('&')[0]; const id = link.split("id=")[1]?.split("&")[0];
const meta = { const meta = {
title: data.title, title: data.title,
synopsis: data.desc, synopsis: data.desc,
image: `https://img.nfmirrorcdn.top/poster/h/${id}.jpg`, image: `https://img.nfmirrorcdn.top/poster/h/${id}.jpg`,
cast: data?.short_cast?.split(','), cast: data?.short_cast?.split(","),
tags: [data?.year, data?.hdsd, ...data?.thismovieis?.split(',')], tags: [data?.year, data?.hdsd, ...data?.thismovieis?.split(",")],
imdbId: '', imdbId: "",
type: 'series', type: "series",
}; };
console.log('nfinfo', meta); console.log("nfinfo", meta);
const linkList: Link[] = []; const linkList: Link[] = [];
if (data?.season?.length > 0) { if (data?.season?.length > 0) {
data.season.map((season: any) => { data.season.map((season: any) => {
linkList.push({ linkList.push({
title: 'Season ' + season?.s, title: "Season " + season?.s,
episodesLink: season?.id, episodesLink: season?.id,
}); });
}); });
} else { } else {
linkList.push({ linkList.push({
title: meta.title, title: meta.title,
directLinks: [{link: id, title: 'Movie', type: 'movie'}], directLinks: [{ link: id, title: "Movie", type: "movie" }],
}); });
} }
@@ -52,11 +52,11 @@ export const nfGetInfo = async function ({
} catch (err) { } catch (err) {
console.error(err); console.error(err);
return { return {
title: '', title: "",
synopsis: '', synopsis: "",
image: '', image: "",
imdbId: '', imdbId: "",
type: '', type: "",
linkList: [], linkList: [],
}; };
} }

View File

@@ -1,16 +0,0 @@
export const nfCatalog = [
{
title: 'Home',
filter: '/mobile/home?app=1',
},
{
title: 'Series',
filter: '/mobile/series',
},
{
title: 'Movies',
filter: '/mobile/movies',
},
];
export const nfGenresList = [];

View File

@@ -1,49 +0,0 @@
import {EpisodeLink, ProviderContext} from '../types';
export const nfGetEpisodes = async function ({
url: link,
providerContext,
}: {
url: string;
providerContext: ProviderContext;
}): Promise<EpisodeLink[]> {
const {getBaseUrl, axios} = providerContext;
let providerValue = 'netflixMirror';
try {
const baseUrl = await getBaseUrl('nfMirror');
const url =
`${baseUrl}${
providerValue === 'netflixMirror'
? '/episodes.php?s='
: '/pv/episodes.php?s='
}` +
link +
'&t=' +
Math.round(new Date().getTime() / 1000);
console.log('nfEpisodesUrl', url);
const res = await axios.get(url, {
headers: {
'Content-Type': 'application/json',
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36',
'Accept-Language': 'en-US,en;q=0.9',
},
});
const data = res.data;
console.log('nfEpisodes', data);
const episodeList: EpisodeLink[] = [];
data?.episodes?.map((episode: any) => {
episodeList.push({
title: 'Episode ' + episode?.ep.replace('E', ''),
link: episode?.id,
});
});
return episodeList;
} catch (err) {
console.error('nfGetEpisodes error', err);
return [];
}
};

Some files were not shown because too many files have changed in this diff Show More