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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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,
providerContext,
}: {
@@ -8,7 +8,7 @@ export const clsEpisodeLinks = async function ({
providerContext: ProviderContext;
}): Promise<EpisodeLink[]> {
try {
if (!url.includes('luxelinks') || url.includes('luxecinema')) {
if (!url.includes("luxelinks") || url.includes("luxecinema")) {
const res = await providerContext.axios.get(url, {
headers: providerContext.commonHeaders,
});
@@ -18,14 +18,14 @@ export const clsEpisodeLinks = async function ({
url = encodedLink ? atob(encodedLink) : url;
} else {
const redirectUrlRes = await fetch(
'https://ext.8man.me/api/cinemaluxe',
"https://ext.8man.me/api/cinemaluxe",
{
method: 'POST',
method: "POST",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
},
body: JSON.stringify({url}),
},
body: JSON.stringify({ url }),
}
);
const redirectUrl = await redirectUrlRes.json();
url = redirectUrl?.redirectUrl || url;
@@ -37,37 +37,37 @@ export const clsEpisodeLinks = async function ({
const html = res.data;
let $ = providerContext.cheerio.load(html);
const episodeLinks: EpisodeLink[] = [];
if (url.includes('luxedrive')) {
if (url.includes("luxedrive")) {
episodeLinks.push({
title: 'Movie',
title: "Movie",
link: url,
});
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) => {
const title = $(element).text()?.trim();
const link = $(element).attr('href');
const link = $(element).attr("href");
if (
title &&
link &&
!title.includes('Batch') &&
!title.toLowerCase().includes('zip')
!title.includes("Batch") &&
!title.toLowerCase().includes("zip")
) {
episodeLinks.push({
title: title
.replace(/\(\d{4}\)/, '')
.replace('Download', 'Movie')
.replace('⚡', '')
.replace(/\(\d{4}\)/, "")
.replace("Download", "Movie")
.replace("⚡", "")
.trim(),
link,
});
}
},
}
);
return episodeLinks;
} catch (err) {
console.error('cl episode links', err);
console.error("cl episode links", err);
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,
providerContext,
}: {
@@ -14,36 +14,36 @@ export const clGetInfo = async function ({
});
const data = res.data;
const $ = providerContext.cheerio.load(data);
const type = url.includes('tvshows') ? 'series' : 'movie';
const imdbId = '';
const title = url.split('/')[4].replace(/-/g, ' ');
const image = $('.g-item').find('a').attr('href') || '';
const synopsis = $('.wp-content').text().trim();
const tags = $('.sgeneros')
const type = url.includes("tvshows") ? "series" : "movie";
const imdbId = "";
const title = url.split("/")[4].replace(/-/g, " ");
const image = $(".g-item").find("a").attr("href") || "";
const synopsis = $(".wp-content").text().trim();
const tags = $(".sgeneros")
.children()
.map((i, element) => $(element).text())
.get()
.slice(3);
const rating = Number($('#repimdb').find('strong').text())
const rating = Number($("#repimdb").find("strong").text())
.toFixed(1)
.toString();
const links: Link[] = [];
$('.mb-center.maxbutton-5-center,.ep-button-container').map(
$(".mb-center.maxbutton-5-center,.ep-button-container").map(
(i, element) => {
const title = $(element)
.text()
.replace('\u2b07Download', '')
.replace('\u2b07 Download', '')
.replace("\u2b07Download", "")
.replace("\u2b07 Download", "")
.trim();
const link = $(element).find('a').attr('href');
const link = $(element).find("a").attr("href");
if (title && link) {
links.push({
title,
episodesLink: link,
quality: title?.match(/\d+P\b/)?.[0].replace('P', 'p') || '',
quality: title?.match(/\d+P\b/)?.[0].replace("P", "p") || "",
});
}
},
}
);
return {
title,
@@ -58,11 +58,11 @@ export const clGetInfo = async function ({
} catch (err) {
console.error(err);
return {
title: '',
synopsis: '',
image: '',
imdbId: '',
type: 'movie',
title: "",
synopsis: "",
image: "",
imdbId: "",
type: "movie",
linkList: [],
};
}

View File

@@ -1,6 +1,6 @@
import {Post, ProviderContext} from '../types';
import { Post, ProviderContext } from "../types";
export const clGetPosts = async function ({
export const getPosts = async function ({
filter,
page,
signal,
@@ -11,12 +11,12 @@ export const clGetPosts = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const baseUrl = await providerContext.getBaseUrl('cinemaLuxe');
const baseUrl = await providerContext.getBaseUrl("cinemaLuxe");
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,
page,
signal,
@@ -28,9 +28,9 @@ export const clGetPostsSearch = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const baseUrl = await providerContext.getBaseUrl('cinemaLuxe');
const baseUrl = await providerContext.getBaseUrl("cinemaLuxe");
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
return posts({url, signal, providerContext});
return posts({ url, signal, providerContext });
};
async function posts({
@@ -50,10 +50,10 @@ async function posts({
const data = await res.text();
const $ = providerContext.cheerio.load(data);
const catalog: Post[] = [];
$('.item.tvshows,.item.movies').map((i, element) => {
const title = $(element).find('.poster').find('img').attr('alt');
const link = $(element).find('.poster').find('a').attr('href');
const image = $(element).find('.poster').find('img').attr('data-src');
$(".item.tvshows,.item.movies").map((i, element) => {
const title = $(element).find(".poster").find("img").attr("alt");
const link = $(element).find(".poster").find("a").attr("href");
const image = $(element).find(".poster").find("img").attr("data-src");
if (title && link && image) {
catalog.push({
title: title,
@@ -62,10 +62,10 @@ async function posts({
});
}
});
$('.result-item').map((i, element) => {
const title = $(element).find('.thumbnail').find('img').attr('alt');
const link = $(element).find('.thumbnail').find('a').attr('href');
const image = $(element).find('.thumbnail').find('img').attr('data-src');
$(".result-item").map((i, element) => {
const title = $(element).find(".thumbnail").find("img").attr("alt");
const link = $(element).find(".thumbnail").find("a").attr("href");
const image = $(element).find(".thumbnail").find("img").attr("data-src");
if (title && link && image) {
catalog.push({
title: title,
@@ -76,7 +76,7 @@ async function posts({
});
return catalog;
} catch (err) {
console.error('cinemaluxe error ', err);
console.error("cinemaluxe error ", err);
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,
signal,
providerContext,
@@ -12,32 +12,32 @@ export const clGetStream = async ({
}): Promise<Stream[]> => {
try {
let newLink = link;
if (link.includes('luxedrive')) {
if (link.includes("luxedrive")) {
const res = await providerContext.axios.get(link);
const $ = providerContext.cheerio.load(res.data);
const hubcloudLink = $('a.btn.hubcloud').attr('href');
const hubcloudLink = $("a.btn.hubcloud").attr("href");
if (hubcloudLink) {
newLink = hubcloudLink;
} else {
const gdFlixLink = $('a.btn.gdflix').attr('href');
const gdFlixLink = $("a.btn.gdflix").attr("href");
if (gdFlixLink) {
newLink = gdFlixLink;
}
}
}
if (newLink.includes('gdflix')) {
if (newLink.includes("gdflix")) {
const sreams = await providerContext.extractors.gdFlixExtracter(
newLink,
signal,
signal
);
return sreams;
}
const res2 = await providerContext.axios.get(newLink, {signal});
const res2 = await providerContext.axios.get(newLink, { signal });
const data2 = res2.data;
const hcLink = data2.match(/location\.replace\('([^']+)'/)?.[1] || newLink;
const hubCloudLinks = await providerContext.extractors.hubcloudExtracter(
hcLink.includes('https://hubcloud') ? hcLink : newLink,
signal,
hcLink.includes("https://hubcloud") ? hcLink : newLink,
signal
);
return hubCloudLinks;
} 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 = {
'Accept-Encoding': 'gzip',
'API-KEY': '2pm95lc6prpdbk0ppji9rsqo',
Connection: 'Keep-Alive',
'If-Modified-Since': 'Wed, 14 Aug 2024 13:00:04 GMT',
'User-Agent': 'okhttp/3.14.9',
"Accept-Encoding": "gzip",
"API-KEY": "2pm95lc6prpdbk0ppji9rsqo",
Connection: "Keep-Alive",
"If-Modified-Since": "Wed, 14 Aug 2024 13:00:04 GMT",
"User-Agent": "okhttp/3.14.9",
};
export const dooGetInfo = async function ({
export const getMeta = async function ({
link,
providerContext,
}: {
@@ -16,25 +16,25 @@ export const dooGetInfo = async function ({
providerContext: ProviderContext;
}): Promise<Info> {
try {
const {axios} = providerContext;
const res = await axios.get(link, {headers});
const { axios } = providerContext;
const res = await axios.get(link, { headers });
const resData = res.data;
const jsonStart = resData?.indexOf('{');
const jsonEnd = resData?.lastIndexOf('}') + 1;
const jsonStart = resData?.indexOf("{");
const jsonEnd = resData?.lastIndexOf("}") + 1;
const data = JSON?.parse(resData?.substring(jsonStart, jsonEnd))?.title
? JSON?.parse(resData?.substring(jsonStart, jsonEnd))
: resData;
const title = data?.title || '';
const synopsis = data?.description || '';
const image = data?.poster_url || '';
const title = data?.title || "";
const synopsis = data?.description || "";
const image = data?.poster_url || "";
const cast = data?.cast || [];
const rating = data?.imdb_rating || '';
const type = Number(data?.is_tvseries) ? 'series' : 'movie';
const rating = data?.imdb_rating || "";
const type = Number(data?.is_tvseries) ? "series" : "movie";
const tags = data?.genre?.map((genre: any) => genre?.name) || [];
const links: Link[] = [];
if (type === 'series') {
if (type === "series") {
data?.season?.map((season: any) => {
const title = season?.seasons_name || '';
const title = season?.seasons_name || "";
const directLinks: EpisodeLink[] =
season?.episodes?.map((episode: any) => ({
title: episode?.episodes_name,
@@ -48,10 +48,10 @@ export const dooGetInfo = async function ({
} else {
data?.videos?.map((video: any) => {
links.push({
title: title + ' ' + video?.label,
title: title + " " + video?.label,
directLinks: [
{
title: 'Play',
title: "Play",
link: video?.file_url,
},
],
@@ -59,11 +59,11 @@ export const dooGetInfo = async function ({
});
}
return {
image: image?.includes('https') ? image : image?.replace('http', 'https'),
image: image?.includes("https") ? image : image?.replace("http", "https"),
synopsis: synopsis,
title: title,
rating: rating,
imdbId: '',
imdbId: "",
cast: cast,
tags: tags,
type: type,
@@ -72,11 +72,11 @@ export const dooGetInfo = async function ({
} catch (err) {
console.error(err);
return {
title: '',
synopsis: '',
image: '',
imdbId: '',
type: 'movie',
title: "",
synopsis: "",
image: "",
imdbId: "",
type: "movie",
linkList: [],
};
}

View File

@@ -1,14 +1,14 @@
import {Post, ProviderContext} from '../types';
import { Post, ProviderContext } from "../types";
const headers = {
'Accept-Encoding': 'gzip',
'API-KEY': '2pm95lc6prpdbk0ppji9rsqo',
Connection: 'Keep-Alive',
'If-Modified-Since': 'Wed, 14 Aug 2024 13:00:04 GMT',
'User-Agent': 'okhttp/3.14.9',
"Accept-Encoding": "gzip",
"API-KEY": "2pm95lc6prpdbk0ppji9rsqo",
Connection: "Keep-Alive",
"If-Modified-Since": "Wed, 14 Aug 2024 13:00:04 GMT",
"User-Agent": "okhttp/3.14.9",
};
export const dooGetPost = async function ({
export const getPosts = async function ({
filter,
page,
signal,
@@ -21,23 +21,23 @@ export const dooGetPost = async function ({
signal: AbortSignal;
}): Promise<Post[]> {
try {
const {axios, getBaseUrl} = providerContext;
const baseUrl = await getBaseUrl('dooflix');
const { axios, getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl("dooflix");
const catalog: Post[] = [];
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;
if (!resData || typeof resData !== 'string') {
console.warn('Unexpected response format from dooflix API');
if (!resData || typeof resData !== "string") {
console.warn("Unexpected response format from dooflix API");
return [];
}
let data;
try {
const jsonStart = resData.indexOf('[');
const jsonEnd = resData.lastIndexOf(']') + 1;
const jsonStart = resData.indexOf("[");
const jsonEnd = resData.lastIndexOf("]") + 1;
if (jsonStart === -1 || jsonEnd <= jsonStart) {
// 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;
}
} catch (parseError) {
console.error('Error parsing dooflix response:', parseError);
console.error("Error parsing dooflix response:", parseError);
return [];
}
if (!Array.isArray(data)) {
console.warn('Unexpected data format from dooflix API');
console.warn("Unexpected data format from dooflix API");
return [];
}
@@ -61,16 +61,16 @@ export const dooGetPost = async function ({
const id = result?.videos_id;
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 thumbnailUrl = result?.thumbnail_url;
const image = thumbnailUrl?.includes('https')
const image = thumbnailUrl?.includes("https")
? thumbnailUrl
: thumbnailUrl?.replace('http', 'https');
: thumbnailUrl?.replace("http", "https");
catalog.push({
title: result?.title || '',
title: result?.title || "",
link,
image,
});
@@ -78,12 +78,12 @@ export const dooGetPost = async function ({
return catalog;
} catch (err) {
console.error('dooflix error:', err);
console.error("dooflix error:", err);
return [];
}
};
export const dooGetSearchPost = async function ({
export const getSearchPosts = async function ({
searchQuery,
page,
providerContext,
@@ -99,23 +99,23 @@ export const dooGetSearchPost = async function ({
if (page > 1) {
return [];
}
const {axios, getBaseUrl} = providerContext;
const { axios, getBaseUrl } = providerContext;
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 res = await axios.get(url, {headers, signal});
const res = await axios.get(url, { headers, signal });
const resData = res.data;
if (!resData || typeof resData !== 'string') {
console.warn('Unexpected search response format from dooflix API');
if (!resData || typeof resData !== "string") {
console.warn("Unexpected search response format from dooflix API");
return [];
}
let data;
try {
const jsonStart = resData.indexOf('{');
const jsonEnd = resData.lastIndexOf('}') + 1;
const jsonStart = resData.indexOf("{");
const jsonEnd = resData.lastIndexOf("}") + 1;
if (jsonStart === -1 || jsonEnd <= jsonStart) {
data = resData;
@@ -125,7 +125,7 @@ export const dooGetSearchPost = async function ({
data = parsedData?.movie ? parsedData : resData;
}
} catch (parseError) {
console.error('Error parsing dooflix search response:', parseError);
console.error("Error parsing dooflix search response:", parseError);
return [];
}
@@ -136,12 +136,12 @@ export const dooGetSearchPost = async function ({
const link = `${baseUrl}/rest-api//v130/single_details?type=movie&id=${id}`;
const thumbnailUrl = result?.thumbnail_url;
const image = thumbnailUrl?.includes('https')
const image = thumbnailUrl?.includes("https")
? thumbnailUrl
: thumbnailUrl?.replace('http', 'https');
: thumbnailUrl?.replace("http", "https");
catalog.push({
title: result?.title || '',
title: result?.title || "",
link,
image,
});
@@ -154,12 +154,12 @@ export const dooGetSearchPost = async function ({
const link = `${baseUrl}/rest-api//v130/single_details?type=tvseries&id=${id}`;
const thumbnailUrl = result?.thumbnail_url;
const image = thumbnailUrl?.includes('https')
const image = thumbnailUrl?.includes("https")
? thumbnailUrl
: thumbnailUrl?.replace('http', 'https');
: thumbnailUrl?.replace("http", "https");
catalog.push({
title: result?.title || '',
title: result?.title || "",
link,
image,
});
@@ -167,7 +167,7 @@ export const dooGetSearchPost = async function ({
return catalog;
} catch (error) {
console.error('dooflix search error:', error);
console.error("dooflix search error:", error);
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: string;
@@ -8,19 +8,19 @@ export const dooGetStream = async function ({
try {
const streams: Stream[] = [];
streams.push({
server: 'Dooflix',
server: "Dooflix",
link: link,
type: 'm3u8',
type: "m3u8",
headers: {
Connection: 'Keep-Alive',
'User-Agent':
'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/',
Connection: "Keep-Alive",
"User-Agent":
"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/",
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;
} catch (err) {
console.error(err);

View File

@@ -1,61 +1,61 @@
export const driveCatalog = [
export const catalog = [
{
title: 'Latest',
filter: '',
title: "Latest",
filter: "",
},
{
title: 'Anime',
filter: 'category/anime/',
title: "Anime",
filter: "category/anime/",
},
{
title: 'Netflix',
filter: 'category/netflix/',
title: "Netflix",
filter: "category/netflix/",
},
{
title: '4K',
filter: 'category/2160p-4k/',
title: "4K",
filter: "category/2160p-4k/",
},
];
export const driveGenresList = [
export const genres = [
{
title: 'Action',
filter: '/category/action',
title: "Action",
filter: "/category/action",
},
{
title: 'Crime',
filter: '/category/crime',
title: "Crime",
filter: "/category/crime",
},
{
title: 'Comedy',
filter: '/category/comedy',
title: "Comedy",
filter: "/category/comedy",
},
{
title: 'Drama',
filter: '/category/drama',
title: "Drama",
filter: "/category/drama",
},
{
title: 'Horror',
filter: '/category/horror',
title: "Horror",
filter: "/category/horror",
},
{
title: 'Family',
filter: '/category/family',
title: "Family",
filter: "/category/family",
},
{
title: 'Sci-Fi',
filter: '/category/sifi',
title: "Sci-Fi",
filter: "/category/sifi",
},
{
title: 'Thriller',
filter: '/category/triller',
title: "Thriller",
filter: "/category/triller",
},
{
title: 'Romance',
filter: '/category/romance',
title: "Romance",
filter: "/category/romance",
},
{
title: 'Fight',
filter: '/category/fight',
title: "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,
providerContext,
}: {
@@ -8,7 +8,7 @@ export const driveGetEpisodeLinks = async function ({
providerContext: ProviderContext;
}): Promise<EpisodeLink[]> {
try {
const {axios, cheerio} = providerContext;
const { axios, cheerio } = providerContext;
const res = await axios.get(url);
const html = res.data;
let $ = cheerio.load(html);
@@ -16,10 +16,10 @@ export const driveGetEpisodeLinks = async function ({
const episodeLinks: EpisodeLink[] = [];
$('a:contains("HubCloud")').map((i, element) => {
const title = $(element).parent().prev().text();
const link = $(element).attr('href');
if (link && (title.includes('Ep') || title.includes('Download'))) {
const link = $(element).attr("href");
if (link && (title.includes("Ep") || title.includes("Download"))) {
episodeLinks.push({
title: title.includes('Download') ? 'Play' : title,
title: title.includes("Download") ? "Play" : title,
link,
});
}
@@ -31,7 +31,7 @@ export const driveGetEpisodeLinks = async function ({
console.error(err);
return [
{
title: 'Server 1',
title: "Server 1",
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,
providerContext,
}: {
@@ -12,56 +12,56 @@ export const driveGetInfo = async function ({
};
}): Promise<Info> {
try {
const {axios, cheerio} = providerContext;
const { axios, cheerio } = providerContext;
const url = link;
const res = await axios.get(url);
const data = res.data;
const $ = cheerio.load(data);
const type = $('.left-wrapper')
const type = $(".left-wrapper")
.text()
.toLocaleLowerCase()
.includes('movie name')
? 'movie'
: 'series';
const imdbId = $('a:contains("IMDb")').attr('href')?.split('/')[4] || '';
.includes("movie name")
? "movie"
: "series";
const imdbId = $('a:contains("IMDb")').attr("href")?.split("/")[4] || "";
const title =
$('.left-wrapper').find('strong:contains("Name")').next().text() ||
$('.left-wrapper')
$(".left-wrapper").find('strong:contains("Name")').next().text() ||
$(".left-wrapper")
.find('strong:contains("Name"),h5:contains("Name")')
.find('span:first')
.find("span:first")
.text();
const synopsis =
$('.left-wrapper')
$(".left-wrapper")
.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()
.text() ||
$('.ipc-html-content-inner-div').text() ||
'';
$(".ipc-html-content-inner-div").text() ||
"";
const image =
$('img.entered.lazyloaded,img.entered,img.litespeed-loaded').attr(
'src',
$("img.entered.lazyloaded,img.entered,img.litespeed-loaded").attr(
"src"
) ||
$('img.aligncenter').attr('src') ||
'';
$("img.aligncenter").attr("src") ||
"";
// Links
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) => {
const title = $(element).parent('h5').prev().text();
const episodesLink = $(element).attr('href');
const quality = title.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || '';
const title = $(element).parent("h5").prev().text();
const episodesLink = $(element).attr("href");
const quality = title.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || "";
if (episodesLink && title) {
links.push({
title,
episodesLink: type === 'series' ? episodesLink : '',
episodesLink: type === "series" ? episodesLink : "",
directLinks:
type === 'movie'
? [{title: 'Movie', link: episodesLink, type: 'movie'}]
type === "movie"
? [{ title: "Movie", link: episodesLink, type: "movie" }]
: [],
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', links, type);
console.log("drive meta", links, type);
return {
title,
synopsis,
@@ -81,11 +81,11 @@ export const driveGetInfo = async function ({
} catch (err) {
console.error(err);
return {
title: '',
synopsis: '',
image: '',
imdbId: '',
type: 'movie',
title: "",
synopsis: "",
image: "",
imdbId: "",
type: "movie",
linkList: [],
};
}

View File

@@ -1,6 +1,6 @@
import {Post, ProviderContext} from '../types';
import { Post, ProviderContext } from "../types";
export const driveGetPosts = async function ({
export const getPosts = async function ({
filter,
page,
signal,
@@ -12,13 +12,13 @@ export const driveGetPosts = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const {getBaseUrl} = providerContext;
const baseUrl = await getBaseUrl('drive');
const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl("drive");
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,
page,
signal,
@@ -30,10 +30,10 @@ export const driveGetSearchPost = async function ({
providerContext: ProviderContext;
signal: AbortSignal;
}): Promise<Post[]> {
const {getBaseUrl} = providerContext;
const baseUrl = await getBaseUrl('drive');
const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl("drive");
const url = `${baseUrl}page/${page}/?s=${searchQuery}`;
return posts({url, signal, providerContext});
return posts({ url, signal, providerContext });
};
async function posts({
@@ -46,20 +46,20 @@ async function posts({
providerContext: ProviderContext;
}): Promise<Post[]> {
try {
const {cheerio} = providerContext;
const res = await fetch(url, {signal});
const { cheerio } = providerContext;
const res = await fetch(url, { signal });
const data = await res.text();
const $ = cheerio.load(data);
const catalog: Post[] = [];
$('.recent-movies')
$(".recent-movies")
.children()
.map((i, element) => {
const title = $(element).find('figure').find('img').attr('alt');
const link = $(element).find('a').attr('href');
const image = $(element).find('figure').find('img').attr('src');
const title = $(element).find("figure").find("img").attr("alt");
const link = $(element).find("a").attr("href");
const image = $(element).find("figure").find("img").attr("src");
if (title && link && image) {
catalog.push({
title: title.replace('Download', '').trim(),
title: title.replace("Download", "").trim(),
link: link,
image: image,
});
@@ -67,7 +67,7 @@ async function posts({
});
return catalog;
} catch (err) {
console.error('drive error ', err);
console.error("drive error ", err);
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,
type,
signal,
@@ -13,35 +13,35 @@ export const driveGetStream = async function ({
}): Promise<Stream[]> {
const headers = providerContext.commonHeaders;
try {
if (type === 'movie') {
const res = await providerContext.axios.get(url, {headers});
if (type === "movie") {
const res = await providerContext.axios.get(url, { headers });
const html = res.data;
const $ = providerContext.cheerio.load(html);
const link = $('a:contains("HubCloud")').attr('href');
const link = $('a:contains("HubCloud")').attr("href");
url = link || url;
}
const res = await providerContext.axios.get(url, {headers});
const res = await providerContext.axios.get(url, { headers });
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];
if (url.includes('/archives/')) {
if (url.includes("/archives/")) {
redirectUrl = res.data.match(
/<a\s+[^>]*href="(https:\/\/hubcloud\.[^\/]+\/[^"]+)"/i,
/<a\s+[^>]*href="(https:\/\/hubcloud\.[^\/]+\/[^"]+)"/i
)?.[1];
}
if (!redirectUrl) {
return await providerContext.extractors.hubcloudExtracter(url, signal);
}
const res2 = await providerContext.axios.get(redirectUrl, {headers});
const res2 = await providerContext.axios.get(redirectUrl, { headers });
const data = res2.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(
hubcloudLink?.includes('https://hubcloud') ? hubcloudLink : redirectUrl,
signal,
hubcloudLink?.includes("https://hubcloud") ? hubcloudLink : redirectUrl,
signal
);
} catch (err) {
console.error('Movies Drive err', err);
console.error("Movies Drive err", err);
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,
providerContext,
}: {
@@ -9,19 +9,19 @@ export const ffEpisodeLinks = async function ({
}): Promise<EpisodeLink[]> {
try {
const headers = providerContext.commonHeaders;
const {axios, cheerio} = providerContext;
const res = await axios.get(url, {headers});
const { axios, cheerio } = providerContext;
const res = await axios.get(url, { headers });
const data = res.data;
const $ = cheerio.load(data);
const episodeLinks: EpisodeLink[] = [];
$('.dlink.dl').map((i, element) => {
$(".dlink.dl").map((i, element) => {
const title = $(element)
.find('a')
.find("a")
.text()
?.replace('Download', '')
?.replace("Download", "")
?.trim();
const link = $(element).find('a').attr('href');
const link = $(element).find("a").attr("href");
if (title && link) {
episodeLinks.push({
@@ -32,7 +32,7 @@ export const ffEpisodeLinks = async function ({
});
return episodeLinks;
} catch (err) {
console.error('cl episode links', err);
console.error("cl episode links", err);
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,
page,
signal,
@@ -12,13 +12,13 @@ export const ffGetPosts = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const {getBaseUrl} = providerContext;
const baseUrl = await getBaseUrl('filmyfly');
const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl("filmyfly");
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,
page,
signal,
@@ -30,13 +30,13 @@ export const ffGetPostsSearch = async function ({
providerContext: ProviderContext;
signal: AbortSignal;
}): Promise<Post[]> {
const {getBaseUrl} = providerContext;
const baseUrl = await getBaseUrl('filmyfly');
const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl("filmyfly");
const url = `${baseUrl}/site-1.html?to-search=${searchQuery}`;
if (page > 1) {
return [];
}
return posts({url, signal, baseUrl, providerContext});
return posts({ url, signal, baseUrl, providerContext });
};
async function posts({
@@ -51,16 +51,16 @@ async function posts({
providerContext: ProviderContext;
}): Promise<Post[]> {
try {
const {cheerio, commonHeaders: headers} = providerContext;
const res = await fetch(url, {headers, signal});
const { cheerio, commonHeaders: headers } = providerContext;
const res = await fetch(url, { headers, signal });
const data = await res.text();
const $ = cheerio.load(data);
const catalog: Post[] = [];
$('.A2,.A10,.fl').map((i, element) => {
$(".A2,.A10,.fl").map((i, element) => {
const title =
$(element).find('a').eq(1).text() || $(element).find('b').text();
const link = $(element).find('a').attr('href');
const image = $(element).find('img').attr('src');
$(element).find("a").eq(1).text() || $(element).find("b").text();
const link = $(element).find("a").attr("href");
const image = $(element).find("img").attr("src");
if (title && link && image) {
catalog.push({
title: title,
@@ -71,7 +71,7 @@ async function posts({
});
return catalog;
} catch (err) {
console.error('ff error ', err);
console.error("ff error ", err);
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,
signal,
providerContext,
@@ -11,34 +11,34 @@ export const ffGetStream = async function ({
providerContext: ProviderContext;
}): Promise<Stream[]> {
try {
const res = await providerContext.axios.get(link, {signal});
const res = await providerContext.axios.get(link, { signal });
const data = res.data;
const $ = providerContext.cheerio.load(data);
const streams: Stream[] = [];
const elements = $('.button2,.button1,.button3,.button4,.button').toArray();
const promises = elements.map(async element => {
const elements = $(".button2,.button1,.button3,.button4,.button").toArray();
const promises = elements.map(async (element) => {
const title = $(element).text();
let link = $(element).attr('href');
if (title.includes('GDFLIX') && link) {
let link = $(element).attr("href");
if (title.includes("GDFLIX") && link) {
const gdLinks = await providerContext.extractors.gdFlixExtracter(
link,
signal,
signal
);
streams.push(...gdLinks);
}
const alreadyAdded = streams.find(s => s.link === link);
const alreadyAdded = streams.find((s) => s.link === link);
if (
title &&
link &&
!title.includes('Watch') &&
!title.includes('Login') &&
!title.includes('GoFile') &&
!title.includes("Watch") &&
!title.includes("Login") &&
!title.includes("GoFile") &&
!alreadyAdded
) {
streams.push({
server: title,
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,
providerContext,
}: {
@@ -8,28 +8,28 @@ export const flixhqGetInfo = async function ({
providerContext: ProviderContext;
}): Promise<Info> {
try {
const {axios, getBaseUrl} = providerContext;
const baseUrl = await getBaseUrl('consumet');
const { axios, getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl("consumet");
const url = `${baseUrl}/movies/flixhq/info?id=` + id;
const res = await axios.get(url);
const data = res.data;
const meta = {
title: data.title,
synopsis: data.description.replace(/<[^>]*>?/gm, '').trim(),
synopsis: data.description.replace(/<[^>]*>?/gm, "").trim(),
image: data.cover,
cast: data.casts,
rating: data.rating,
tags: [data?.type, data?.duration, data.releaseDate.split('-')[0]],
imdbId: '',
type: data.episodes.length > 1 ? 'series' : 'movie',
tags: [data?.type, data?.duration, data.releaseDate.split("-")[0]],
imdbId: "",
type: data.episodes.length > 1 ? "series" : "movie",
};
const links: Link['directLinks'] = [];
const links: Link["directLinks"] = [];
data.episodes.forEach((episode: any) => {
const title = episode?.number
? 'Season-' + episode?.season + ' Ep-' + episode.number
? "Season-" + episode?.season + " Ep-" + episode.number
: episode.title;
const link = episode.id + '*' + data.id;
const link = episode.id + "*" + data.id;
if (link && title) {
links.push({
title,
@@ -50,11 +50,11 @@ export const flixhqGetInfo = async function ({
} catch (err) {
console.error(err);
return {
title: '',
synopsis: '',
image: '',
imdbId: '',
type: 'movie',
title: "",
synopsis: "",
image: "",
imdbId: "",
type: "movie",
linkList: [],
};
}

View File

@@ -1,6 +1,6 @@
import {Post, ProviderContext} from '../types';
import { Post, ProviderContext } from "../types";
export const flixhqGetPosts = async function ({
export const getPosts = async function ({
filter,
signal,
providerContext,
@@ -11,14 +11,14 @@ export const flixhqGetPosts = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const {getBaseUrl} = providerContext;
const urlRes = await getBaseUrl('consumet');
const baseUrl = urlRes + '/movies/flixhq';
const { getBaseUrl } = providerContext;
const urlRes = await getBaseUrl("consumet");
const baseUrl = urlRes + "/movies/flixhq";
const url = `${baseUrl + filter}`;
return posts({url, signal, providerContext});
return posts({ url, signal, providerContext });
};
export const flixhqGetSearchPost = async function ({
export const getSearchPosts = async function ({
searchQuery,
page,
signal,
@@ -30,11 +30,11 @@ export const flixhqGetSearchPost = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const {getBaseUrl} = providerContext;
const urlRes = await getBaseUrl('consumet');
const baseUrl = urlRes + '/movies/flixhq';
const { getBaseUrl } = providerContext;
const urlRes = await getBaseUrl("consumet");
const baseUrl = urlRes + "/movies/flixhq";
const url = `${baseUrl}/${searchQuery}?page=${page}`;
return posts({url, signal, providerContext});
return posts({ url, signal, providerContext });
};
async function posts({
@@ -47,8 +47,8 @@ async function posts({
providerContext: ProviderContext;
}): Promise<Post[]> {
try {
const {axios} = providerContext;
const res = await axios.get(url, {signal});
const { axios } = providerContext;
const res = await axios.get(url, { signal });
const data = res.data?.results || res.data;
const catalog: Post[] = [];
data?.map((element: any) => {
@@ -65,7 +65,7 @@ async function posts({
});
return catalog;
} catch (err) {
console.error('flixhq error ', err);
console.error("flixhq error ", err);
return [];
}
}

View File

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

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,
type,
providerContext,
@@ -10,29 +10,28 @@ export const GuardahdGetStream = async function ({
providerContext: ProviderContext;
}): Promise<Stream[]> {
try {
const {axios, cheerio, extractors} = providerContext;
const {superVideoExtractor} = extractors;
const { axios, cheerio, extractors } = providerContext;
const { superVideoExtractor } = extractors;
async function ExtractGuardahd({
imdb, // type,
// episode,
} // season,
: {
imdb, // type, // season,
}: // episode,
{
imdb: string;
type: string;
season: string;
episode: string;
}) {
try {
const baseUrl = 'https://guardahd.stream';
const path = '/set-movie-a/' + imdb;
const baseUrl = "https://guardahd.stream";
const path = "/set-movie-a/" + imdb;
const url = baseUrl + path;
console.log('url:', url);
const res = await axios.get(url, {timeout: 4000});
console.log("url:", url);
const res = await axios.get(url, { timeout: 4000 });
const html = res.data;
const $ = cheerio.load(html);
const superVideoUrl = $('li:contains("supervideo")').attr('data-link');
console.log('superVideoUrl:', superVideoUrl);
const superVideoUrl = $('li:contains("supervideo")').attr("data-link");
console.log("superVideoUrl:", superVideoUrl);
if (!superVideoUrl) {
return null;
@@ -40,13 +39,13 @@ export const GuardahdGetStream = async function ({
const controller2 = new AbortController();
const signal2 = controller2.signal;
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();
// console.log('mostraguarda data:', data);
const streamUrl = await superVideoExtractor(data);
return streamUrl;
} catch (err) {
console.error('Error in GetMostraguardaStram:', err);
console.error("Error in GetMostraguardaStram:", err);
}
}
async function GetMostraguardaStream({
@@ -61,20 +60,20 @@ export const GuardahdGetStream = async function ({
episode: string;
}) {
try {
const baseUrl = 'https://mostraguarda.stream';
const baseUrl = "https://mostraguarda.stream";
const path =
type === 'tv'
type === "tv"
? `/serie/${imdb}/${season}/${episode}`
: `/movie/${imdb}`;
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 $ = cheerio.load(html);
const superVideoUrl = $('li:contains("supervideo")').attr('data-link');
console.log('superVideoUrl:', superVideoUrl);
const superVideoUrl = $('li:contains("supervideo")').attr("data-link");
console.log("superVideoUrl:", superVideoUrl);
if (!superVideoUrl) {
return null;
@@ -82,18 +81,18 @@ export const GuardahdGetStream = async function ({
const controller2 = new AbortController();
const signal2 = controller2.signal;
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();
// console.log('mostraguarda data:', data);
const streamUrl = await superVideoExtractor(data);
return streamUrl;
} catch (err) {
console.error('Error in GetMostraguardaStram:', err);
console.error("Error in GetMostraguardaStram:", err);
}
}
console.log(id);
const streams: Stream[] = [];
const {imdbId, season, episode} = JSON.parse(id);
const { imdbId, season, episode } = JSON.parse(id);
///// mostraguarda
const mostraguardaStream = await GetMostraguardaStream({
@@ -104,9 +103,9 @@ export const GuardahdGetStream = async function ({
});
if (mostraguardaStream) {
streams.push({
server: 'Supervideo 1',
server: "Supervideo 1",
link: mostraguardaStream,
type: 'm3u8',
type: "m3u8",
});
}
@@ -119,9 +118,9 @@ export const GuardahdGetStream = async function ({
if (guardahdStream) {
streams.push({
server: 'Supervideo 2',
server: "Supervideo 2",
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 = {
Cookie: 'xla=s4t',
Referer: 'https://google.com',
'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',
Cookie: "xla=s4t",
Referer: "https://google.com",
"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",
};
export const hdhub4uGetInfo = async function ({
export const getMeta = async function ({
link,
providerContext,
}: {
@@ -14,35 +14,35 @@ export const hdhub4uGetInfo = async function ({
providerContext: ProviderContext;
}): Promise<Info> {
try {
const {axios, cheerio} = providerContext;
const { axios, cheerio } = providerContext;
const url = link;
const res = await axios.get(url, {headers: hdbHeaders});
const res = await axios.get(url, { headers: hdbHeaders });
const data = res.data;
const $ = cheerio.load(data);
const container = $('.page-body');
const container = $(".page-body");
const imdbId =
container
.find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])')
.attr('href')
?.split('/')[4] || '';
.attr("href")
?.split("/")[4] || "";
const title = container
.find(
'h2[data-ved="2ahUKEwjL0NrBk4vnAhWlH7cAHRCeAlwQ3B0oATAfegQIFBAM"],h2[data-ved="2ahUKEwiP0pGdlermAhUFYVAKHV8tAmgQ3B0oATAZegQIDhAM"]',
'h2[data-ved="2ahUKEwjL0NrBk4vnAhWlH7cAHRCeAlwQ3B0oATAfegQIFBAM"],h2[data-ved="2ahUKEwiP0pGdlermAhUFYVAKHV8tAmgQ3B0oATAZegQIDhAM"]'
)
.text();
const type = title.toLocaleLowerCase().includes('season')
? 'series'
: 'movie';
const type = title.toLocaleLowerCase().includes("season")
? "series"
: "movie";
const synopsis = container
.find('strong:contains("DESCRIPTION")')
.parent()
.text()
.replace('DESCRIPTION:', '');
const image = container.find('img[decoding="async"]').attr('src') || '';
.replace("DESCRIPTION:", "");
const image = container.find('img[decoding="async"]').attr("src") || "";
// Links
const links: Link[] = [];
const directLink: Link['directLinks'] = [];
const directLink: Link["directLinks"] = [];
// direct link type
$('strong:contains("EPiSODE")').map((i, element) => {
@@ -54,9 +54,9 @@ export const hdhub4uGetInfo = async function ({
.parent()
.next()
.next()
.find('a')
.attr('href') ||
$(element).parent().parent().parent().next().find('a').attr('href');
.find("a")
.attr("href") ||
$(element).parent().parent().parent().next().find("a").attr("href");
if (episodesLink && episodesLink) {
directLink.push({
@@ -69,7 +69,7 @@ export const hdhub4uGetInfo = async function ({
if (directLink.length === 0) {
container.find('a:contains("EPiSODE")').map((i, element) => {
const epTitle = $(element).text();
const episodesLink = $(element).attr('href');
const episodesLink = $(element).attr("href");
if (episodesLink) {
directLink.push({
title: epTitle.toLocaleUpperCase(),
@@ -87,18 +87,20 @@ export const hdhub4uGetInfo = async function ({
if (directLink.length === 0) {
container
.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) => {
const quality =
$(element)
.text()
.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || '';
const movieLinks = $(element).attr('href');
.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || "";
const movieLinks = $(element).attr("href");
const title = $(element).text();
if (movieLinks) {
links.push({
directLinks: [{link: movieLinks, title: 'Movie', type: 'movie'}],
directLinks: [
{ link: movieLinks, title: "Movie", type: "movie" },
],
quality: quality,
title: title,
});
@@ -118,11 +120,11 @@ export const hdhub4uGetInfo = async function ({
} catch (err) {
console.error(err);
return {
title: '',
synopsis: '',
image: '',
imdbId: '',
type: 'movie',
title: "",
synopsis: "",
image: "",
imdbId: "",
type: "movie",
linkList: [],
};
}

View File

@@ -1,13 +1,13 @@
import {Post, ProviderContext} from '../types';
import { Post, ProviderContext } from "../types";
const hdbHeaders = {
Cookie: 'xla=s4t',
Referer: 'https://google.com',
'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',
Cookie: "xla=s4t",
Referer: "https://google.com",
"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",
};
export const hdhubGetPosts = async function ({
export const getPosts = async function ({
filter,
page,
signal,
@@ -19,13 +19,13 @@ export const hdhubGetPosts = async function ({
providerContext: ProviderContext;
signal: AbortSignal;
}): Promise<Post[]> {
const {getBaseUrl} = providerContext;
const baseUrl = await getBaseUrl('hdhub');
const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl("hdhub");
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,
page,
signal,
@@ -37,10 +37,10 @@ export const hdhubGetPostsSearch = async function ({
providerContext: ProviderContext;
signal: AbortSignal;
}): Promise<Post[]> {
const {getBaseUrl} = providerContext;
const baseUrl = await getBaseUrl('hdhub');
const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl("hdhub");
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
return posts({url, signal, providerContext});
return posts({ url, signal, providerContext });
};
async function posts({
@@ -52,7 +52,7 @@ async function posts({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const {cheerio} = providerContext;
const { cheerio } = providerContext;
try {
const res = await fetch(url, {
headers: hdbHeaders,
@@ -61,16 +61,16 @@ async function posts({
const data = await res.text();
const $ = cheerio.load(data);
const catalog: Post[] = [];
$('.recent-movies')
$(".recent-movies")
.children()
.map((i, element) => {
const title = $(element).find('figure').find('img').attr('alt');
const link = $(element).find('a').attr('href');
const image = $(element).find('figure').find('img').attr('src');
const title = $(element).find("figure").find("img").attr("alt");
const link = $(element).find("a").attr("href");
const image = $(element).find("figure").find("img").attr("src");
if (title && link && image) {
catalog.push({
title: title.replace('Download', '').trim(),
title: title.replace("Download", "").trim(),
link: link,
image: image,
});
@@ -78,7 +78,7 @@ async function posts({
});
return catalog;
} catch (err) {
console.error('hdhubGetPosts error ', err);
console.error("hdhubGetPosts error ", err);
return [];
}
}

View File

@@ -1,6 +1,6 @@
import {ProviderContext} from '../types';
import { ProviderContext } from "../types";
export async function hdhub4uGetStream({
export async function getStream({
link,
signal,
providerContext,
@@ -10,49 +10,54 @@ export async function hdhub4uGetStream({
signal: AbortSignal;
providerContext: ProviderContext;
}) {
const {axios, cheerio, extractors, commonHeaders: headers} = providerContext;
const {hubcloudExtracter} = extractors;
let hubdriveLink = '';
if (link.includes('hubdrive')) {
const hubdriveRes = await axios.get(link, {headers, signal});
const {
axios,
cheerio,
extractors,
commonHeaders: headers,
} = providerContext;
const { hubcloudExtracter } = extractors;
let hubdriveLink = "";
if (link.includes("hubdrive")) {
const hubdriveRes = await axios.get(link, { headers, signal });
const hubdriveText = hubdriveRes.data;
const $ = cheerio.load(hubdriveText);
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 {
const res = await axios.get(link, {headers, signal});
const res = await axios.get(link, { headers, signal });
const text = res.data;
const encryptedString = text.split("s('o','")?.[1]?.split("',180")?.[0];
const decodedString: any = decodeString(encryptedString);
link = atob(decodedString?.o);
const redirectLink = await getRedirectLinks(link, signal, headers);
const redirectLinkRes = await axios.get(redirectLink, {headers, signal});
const redirectLinkRes = await axios.get(redirectLink, { headers, signal });
const redirectLinkText = redirectLinkRes.data;
const $ = cheerio.load(redirectLinkText);
hubdriveLink =
$('h3:contains("1080p")').find('a').attr('href') ||
$('h3:contains("1080p")').find("a").attr("href") ||
redirectLinkText.match(
/href="(https:\/\/hubcloud\.[^\/]+\/drive\/[^"]+)"/,
/href="(https:\/\/hubcloud\.[^\/]+\/drive\/[^"]+)"/
)[1];
if (hubdriveLink.includes('hubdrive')) {
const hubdriveRes = await axios.get(hubdriveLink, {headers, signal});
if (hubdriveLink.includes("hubdrive")) {
const hubdriveRes = await axios.get(hubdriveLink, { headers, signal });
const hubdriveText = hubdriveRes.data;
const $$ = cheerio.load(hubdriveText);
hubdriveLink =
$$('.btn.btn-primary.btn-user.btn-success1.m-1').attr('href') ||
$$(".btn.btn-primary.btn-user.btn-success1.m-1").attr("href") ||
hubdriveLink;
}
}
const hubdriveLinkRes = await axios.get(hubdriveLink, {headers, signal});
const hubdriveLinkRes = await axios.get(hubdriveLink, { headers, signal });
const hubcloudText = hubdriveLinkRes.data;
const hubcloudLink =
hubcloudText.match(
/<META HTTP-EQUIV="refresh" content="0; url=([^"]+)">/i,
/<META HTTP-EQUIV="refresh" content="0; url=([^"]+)">/i
)?.[1] || hubdriveLink;
try {
return await hubcloudExtracter(hubcloudLink, signal);
} catch (error: any) {
console.log('hd hub 4 getStream error: ', error);
console.log("hd hub 4 getStream error: ", error);
return [];
}
}
@@ -62,36 +67,36 @@ const encode = function (value: string) {
};
const decode = function (value: string) {
if (value === undefined) {
return '';
return "";
}
return atob(value.toString());
};
const pen = function (value: string) {
return value.replace(/[a-zA-Z]/g, function (_0x1a470e: any) {
return String.fromCharCode(
(_0x1a470e <= 'Z' ? 90 : 122) >=
(_0x1a470e <= "Z" ? 90 : 122) >=
(_0x1a470e = _0x1a470e.charCodeAt(0) + 13)
? _0x1a470e
: _0x1a470e - 26,
: _0x1a470e - 26
);
});
};
const abortableTimeout = (
ms: number,
{signal}: {signal?: AbortSignal} = {},
{ signal }: { signal?: AbortSignal } = {}
) => {
return new Promise((resolve, reject) => {
if (signal && signal.aborted) {
return reject(new Error('Aborted'));
return reject(new Error("Aborted"));
}
const timer = setTimeout(resolve, ms);
if (signal) {
signal.addEventListener('abort', () => {
signal.addEventListener("abort", () => {
clearTimeout(timer);
reject(new Error('Aborted'));
reject(new Error("Aborted"));
});
}
});
@@ -100,14 +105,14 @@ const abortableTimeout = (
export async function getRedirectLinks(
link: string,
signal: AbortSignal,
headers: any,
headers: any
) {
try {
const res = await fetch(link, {headers, signal});
const res = await fetch(link, { headers, signal });
const resText = await res.text();
var regex = /ck\('_wp_http_\d+','([^']+)'/g;
var combinedString = '';
var combinedString = "";
var match;
while ((match = regex.exec(resText)) !== null) {
@@ -120,23 +125,23 @@ export async function getRedirectLinks(
const data = JSON.parse(decodedString);
console.log(data);
const token = encode(data?.data);
const blogLink = data?.wp_http1 + '?re=' + token;
const blogLink = data?.wp_http1 + "?re=" + token;
// abort timeout on signal
let wait = abortableTimeout((Number(data?.total_time) + 3) * 1000, {
signal,
});
await wait;
console.log('blogLink', blogLink);
console.log("blogLink", blogLink);
let vcloudLink = 'Invalid Request';
while (vcloudLink.includes('Invalid Request')) {
const blogRes = await fetch(blogLink, {headers, signal});
let vcloudLink = "Invalid Request";
while (vcloudLink.includes("Invalid Request")) {
const blogRes = await fetch(blogLink, { headers, signal });
const blogResText = (await blogRes.text()) as any;
if (blogResText.includes('Invalid Request')) {
if (blogResText.includes("Invalid Request")) {
console.log(blogResText);
} else {
vcloudLink = blogResText.match(/var reurl = "([^"]+)"/) || '';
vcloudLink = blogResText.match(/var reurl = "([^"]+)"/) || "";
break;
}
}
@@ -144,7 +149,7 @@ export async function getRedirectLinks(
// console.log('vcloudLink', vcloudLink?.[1]);
return blogLink || link;
} catch (err) {
console.log('Error in getRedirectLinks', err);
console.log("Error in getRedirectLinks", err);
return link;
}
}
@@ -152,10 +157,10 @@ export async function getRedirectLinks(
function rot13(str: string) {
return str.replace(/[a-zA-Z]/g, function (char) {
const charCode = char.charCodeAt(0);
const isUpperCase = char <= 'Z';
const isUpperCase = char <= "Z";
const baseCharCode = isUpperCase ? 65 : 97;
return String.fromCharCode(
((charCode - baseCharCode + 13) % 26) + baseCharCode,
((charCode - baseCharCode + 13) % 26) + baseCharCode
);
});
}
@@ -177,7 +182,7 @@ export function decodeString(encryptedString: string) {
// Parse JSON
return JSON.parse(decoded);
} catch (error) {
console.error('Error decoding string:', error);
console.error("Error decoding string:", error);
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,
providerContext,
}: {
@@ -8,8 +8,8 @@ export const hiGetInfo = async function ({
providerContext: ProviderContext;
}): Promise<Info> {
try {
const {getBaseUrl, axios} = providerContext;
const baseUrl = await getBaseUrl('consumet');
const { getBaseUrl, axios } = providerContext;
const baseUrl = await getBaseUrl("consumet");
const url = `${baseUrl}/anime/zoro/info?id=` + link;
const res = await axios.get(url);
const data = res.data;
@@ -19,20 +19,20 @@ export const hiGetInfo = async function ({
image: data.image,
tags: [
data?.type,
data?.subOrDub === 'both' ? 'Sub And Dub' : data?.subOrDub,
data?.subOrDub === "both" ? "Sub And Dub" : data?.subOrDub,
],
imdbId: '',
type: data.episodes.length > 0 ? 'series' : 'movie',
imdbId: "",
type: data.episodes.length > 0 ? "series" : "movie",
};
const linkList: Link[] = [];
const subLinks: Link['directLinks'] = [];
const subLinks: Link["directLinks"] = [];
data.episodes.forEach((episode: any) => {
if (!episode?.isSubbed) {
return;
}
const title =
'Episode ' + episode.number + (episode?.isFiller ? ' (Filler)' : '');
const link = episode.id + '$sub';
"Episode " + episode.number + (episode?.isFiller ? " (Filler)" : "");
const link = episode.id + "$sub";
if (link && title) {
subLinks.push({
title,
@@ -41,18 +41,18 @@ export const hiGetInfo = async function ({
}
});
linkList.push({
title: meta.title + ' (Sub)',
title: meta.title + " (Sub)",
directLinks: subLinks,
});
if (data?.subOrDub === 'both') {
const dubLinks: Link['directLinks'] = [];
if (data?.subOrDub === "both") {
const dubLinks: Link["directLinks"] = [];
data.episodes.forEach((episode: any) => {
if (!episode?.isDubbed) {
return;
}
const title =
'Episode ' + episode.number + (episode?.isFiller ? ' (Filler)' : '');
const link = episode.id + '$dub';
"Episode " + episode.number + (episode?.isFiller ? " (Filler)" : "");
const link = episode.id + "$dub";
if (link && title) {
dubLinks.push({
title,
@@ -61,7 +61,7 @@ export const hiGetInfo = async function ({
}
});
linkList.push({
title: meta.title + ' (Dub)',
title: meta.title + " (Dub)",
directLinks: dubLinks,
});
}
@@ -72,11 +72,11 @@ export const hiGetInfo = async function ({
} catch (err) {
console.error(err);
return {
title: '',
synopsis: '',
image: '',
imdbId: '',
type: 'movie',
title: "",
synopsis: "",
image: "",
imdbId: "",
type: "movie",
linkList: [],
};
}

View File

@@ -1,6 +1,6 @@
import {Post, ProviderContext} from '../types';
import { Post, ProviderContext } from "../types";
export const hiGetPosts = async function ({
export const getPosts = async function ({
filter,
page,
signal,
@@ -12,13 +12,13 @@ export const hiGetPosts = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const {getBaseUrl, axios} = providerContext;
const baseUrl = await getBaseUrl('consumet');
const { getBaseUrl, axios } = providerContext;
const baseUrl = await getBaseUrl("consumet");
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,
page,
signal,
@@ -30,10 +30,10 @@ export const hiGetPostsSearch = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const {getBaseUrl, axios} = providerContext;
const baseUrl = await getBaseUrl('consumet');
const { getBaseUrl, axios } = providerContext;
const baseUrl = await getBaseUrl("consumet");
const url = `${baseUrl}/anime/zoro/${searchQuery}?page=${page}`;
return posts({url, signal, axios});
return posts({ url, signal, axios });
};
async function posts({
@@ -43,10 +43,10 @@ async function posts({
}: {
url: string;
signal: AbortSignal;
axios: ProviderContext['axios'];
axios: ProviderContext["axios"];
}): Promise<Post[]> {
try {
const res = await axios.get(url, {signal});
const res = await axios.get(url, { signal });
const data = res.data?.results;
const catalog: Post[] = [];
data?.map((element: any) => {
@@ -63,7 +63,7 @@ async function posts({
});
return catalog;
} catch (err) {
console.error('zoro error ', err);
console.error("zoro error ", err);
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,
providerContext,
}: {
@@ -8,24 +8,24 @@ export const hiGetStream = async function ({
providerContext: ProviderContext;
}): Promise<Stream[]> {
try {
const {getBaseUrl, axios} = providerContext;
const baseUrl = await getBaseUrl('consumet');
const servers = ['vidcloud', 'vidstreaming'];
const { getBaseUrl, axios } = providerContext;
const baseUrl = await getBaseUrl("consumet");
const servers = ["vidcloud", "vidstreaming"];
const url = `${baseUrl}/anime/zoro/watch?episodeId=${id}&server=`;
const streamLinks: Stream[] = [];
await Promise.all(
servers.map(async server => {
servers.map(async (server) => {
try {
const res = await axios.get(url + server);
if (res.data) {
const subtitles: TextTracks = [];
res.data?.subtitles.forEach((sub: any) => {
if (sub?.lang === 'Thumbnails') return;
if (sub?.lang === "Thumbnails") return;
subtitles.push({
language: sub?.lang?.slice(0, 2) || 'Und',
language: sub?.lang?.slice(0, 2) || "Und",
uri: sub?.url,
title: sub?.lang || 'Undefined',
type: sub?.url?.endsWith('.vtt')
title: sub?.lang || "Undefined",
type: sub?.url?.endsWith(".vtt")
? TextTrackType.VTT
: TextTrackType.SUBRIP,
});
@@ -34,10 +34,10 @@ export const hiGetStream = async function ({
streamLinks.push({
server: server,
link: source?.url,
type: source?.isM3U8 ? 'm3u8' : 'mp4',
type: source?.isM3U8 ? "m3u8" : "mp4",
headers: {
Referer: 'https://megacloud.club/',
Origin: 'https://megacloud.club',
Referer: "https://megacloud.club/",
Origin: "https://megacloud.club",
},
subtitles: subtitles,
});
@@ -46,7 +46,7 @@ export const hiGetStream = async function ({
} catch (e) {
console.log(e);
}
}),
})
);
return streamLinks;
} catch (err) {

View File

@@ -1,53 +1,53 @@
import {EpisodeLink, ProviderContext} from '../types';
import { EpisodeLink, ProviderContext } from "../types";
export const katEpisodeLinks = async function ({
export const getEpisodes = async function ({
url,
providerContext,
}: {
url: string;
providerContext: ProviderContext;
}): Promise<EpisodeLink[]> {
const {axios, cheerio} = providerContext;
const { axios, cheerio } = providerContext;
const episodesLink: EpisodeLink[] = [];
try {
if (url.includes('gdflix')) {
const baseUrl = url.split('/pack')?.[0];
if (url.includes("gdflix")) {
const baseUrl = url.split("/pack")?.[0];
const res = await axios.get(url);
const data = res.data;
const $ = cheerio.load(data);
const links = $('.list-group-item');
const links = $(".list-group-item");
links?.map((i, link) => {
episodesLink.push({
title: $(link).text() || '',
link: baseUrl + $(link).find('a').attr('href') || '',
title: $(link).text() || "",
link: baseUrl + $(link).find("a").attr("href") || "",
});
});
if (episodesLink.length > 0) {
return episodesLink;
}
}
if (url.includes('/pack')) {
if (url.includes("/pack")) {
const epIds = await extractKmhdEpisodes(url, providerContext);
epIds?.forEach((id: string, index: number) => {
episodesLink.push({
title: `Episode ${index + 1}`,
link: url.split('/pack')[0] + '/file/' + id,
link: url.split("/pack")[0] + "/file/" + id,
});
});
}
const res = await axios.get(url, {
headers: {
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 $ = cheerio.load(episodeData);
const links = $('.autohyperlink');
const links = $(".autohyperlink");
links?.map((i, link) => {
episodesLink.push({
title: $(link).parent().children().remove().end().text() || '',
link: $(link).attr('href') || '',
title: $(link).parent().children().remove().end().text() || "",
link: $(link).attr("href") || "",
});
});
@@ -60,23 +60,23 @@ export const katEpisodeLinks = async function ({
export async function extractKmhdLink(
katlink: string,
providerContext: ProviderContext,
providerContext: ProviderContext
) {
const {axios} = providerContext;
const { axios } = providerContext;
const res = await axios.get(katlink);
const data = res.data;
const hubDriveRes = data.match(/hubdrive_res:\s*"([^"]+)"/)[1];
const hubDriveLink = data.match(
/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/,
/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/
)[1];
return hubDriveLink + hubDriveRes;
}
async function extractKmhdEpisodes(
katlink: string,
providerContext: ProviderContext,
providerContext: ProviderContext
) {
const {axios} = providerContext;
const { axios } = providerContext;
const res = await axios.get(katlink);
const data = res.data;
const ids = data.match(/[\w]+_[a-f0-9]{8}/g);

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

View File

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

View File

@@ -1,19 +1,19 @@
import {Stream, ProviderContext} from '../types';
import { Stream, ProviderContext } from "../types";
async function extractKmhdLink(
katlink: string,
providerContext: ProviderContext,
providerContext: ProviderContext
) {
const {axios} = providerContext;
const { axios } = providerContext;
const res = await axios.get(katlink);
const data = res.data;
const hubDriveRes = data.match(/hubdrive_res:\s*"([^"]+)"/)[1];
const hubDriveLink = data.match(
/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/,
/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/
)[1];
return hubDriveLink + hubDriveRes;
}
export async function katGetStream({
export const getStream = async function ({
link,
signal,
providerContext,
@@ -23,77 +23,77 @@ export async function katGetStream({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Stream[]> {
const {axios, cheerio, extractors} = providerContext;
const {hubcloudExtracter, gdFlixExtracter} = extractors;
const { axios, cheerio, extractors } = providerContext;
const { hubcloudExtracter, gdFlixExtracter } = extractors;
const streamLinks: Stream[] = [];
console.log('katGetStream', link);
console.log("katGetStream", link);
try {
if (link.includes('gdflix')) {
if (link.includes("gdflix")) {
return await gdFlixExtracter(link, signal);
}
if (link.includes('kmhd')) {
if (link.includes("kmhd")) {
const hubcloudLink = await extractKmhdLink(link, providerContext);
return await hubcloudExtracter(hubcloudLink, signal);
}
if (link.includes('gdflix')) {
if (link.includes("gdflix")) {
// resume link
try {
const resumeDrive = link.replace('/file', '/zfile');
const resumeDrive = link.replace("/file", "/zfile");
// console.log('resumeDrive', resumeDrive);
const resumeDriveRes = await axios.get(resumeDrive);
const resumeDriveHtml = resumeDriveRes.data;
const $resumeDrive = cheerio.load(resumeDriveHtml);
const resumeLink = $resumeDrive('.btn-success').attr('href');
console.log('resumeLink', resumeLink);
const resumeLink = $resumeDrive(".btn-success").attr("href");
console.log("resumeLink", resumeLink);
if (resumeLink) {
streamLinks.push({
server: 'ResumeCloud',
server: "ResumeCloud",
link: resumeLink,
type: 'mkv',
type: "mkv",
});
}
} catch (err) {
console.log('Resume link not found');
console.log("Resume link not found");
}
//instant link
try {
const driveres = await axios.get(link, {timeout: 10000});
const driveres = await axios.get(link, { timeout: 10000 });
const $drive = cheerio.load(driveres.data);
const seed = $drive('.btn-danger').attr('href') || '';
const instantToken = seed.split('=')[1];
const seed = $drive(".btn-danger").attr("href") || "";
const instantToken = seed.split("=")[1];
// console.log('InstantToken', instantToken);
const InstantFromData = new FormData();
InstantFromData.append('keys', instantToken);
const videoSeedUrl = seed.split('/').slice(0, 3).join('/') + '/api';
InstantFromData.append("keys", instantToken);
const videoSeedUrl = seed.split("/").slice(0, 3).join("/") + "/api";
// console.log('videoSeedUrl', videoSeedUrl);
const instantLinkRes = await fetch(videoSeedUrl, {
method: 'POST',
method: "POST",
body: InstantFromData,
headers: {
'x-token': videoSeedUrl,
"x-token": videoSeedUrl,
},
});
const instantLinkData = await instantLinkRes.json();
console.log('instantLinkData', instantLinkData);
console.log("instantLinkData", instantLinkData);
if (instantLinkData.error === false) {
const instantLink = instantLinkData.url;
streamLinks.push({
server: 'Gdrive-Instant',
server: "Gdrive-Instant",
link: instantLink,
type: 'mkv',
type: "mkv",
});
} else {
console.log('Instant link not found', instantLinkData);
console.log("Instant link not found", instantLinkData);
}
} catch (err) {
console.log('Instant link not found', err);
console.log("Instant link not found", err);
}
return streamLinks;
}
const stereams = await hubcloudExtracter(link, signal);
return stereams;
} catch (error: any) {
console.log('katgetStream error: ', error);
console.log("katgetStream error: ", error);
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,
providerContext,
}: {
@@ -8,23 +8,23 @@ export const kissKhGetInfo = async function ({
providerContext: ProviderContext;
}): Promise<Info> {
try {
const {axios} = providerContext;
const { axios } = providerContext;
const res = await axios.get(link);
const data = res.data;
const meta = {
title: data.title,
synopsis: data.description,
image: data.thumbnail,
tags: [data?.releaseDate?.split('-')[0], data?.status, data?.type],
imdbId: '',
type: data.episodesCount > 1 ? 'series' : 'movie',
tags: [data?.releaseDate?.split("-")[0], data?.status, data?.type],
imdbId: "",
type: data.episodesCount > 1 ? "series" : "movie",
};
const linkList: Link[] = [];
const subLinks: Link['directLinks'] = [];
const subLinks: Link["directLinks"] = [];
data?.episodes?.reverse().map((episode: any) => {
const title = 'Episode ' + episode?.number;
const title = "Episode " + episode?.number;
const link = episode?.id?.toString();
if (link && title) {
subLinks.push({
@@ -46,11 +46,11 @@ export const kissKhGetInfo = async function ({
} catch (err) {
console.error(err);
return {
title: '',
synopsis: '',
image: '',
imdbId: '',
type: 'movie',
title: "",
synopsis: "",
image: "",
imdbId: "",
type: "movie",
linkList: [],
};
}

View File

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

View File

@@ -1,6 +1,6 @@
import {Stream, ProviderContext, TextTrackType, TextTracks} from '../types';
import { Stream, ProviderContext, TextTrackType, TextTracks } from "../types";
export const kissKhGetStream = async function ({
export const getStream = async function ({
link: id,
providerContext,
}: {
@@ -8,12 +8,12 @@ export const kissKhGetStream = async function ({
providerContext: ProviderContext;
}): Promise<Stream[]> {
try {
const {axios, getBaseUrl} = providerContext;
const { axios, getBaseUrl } = providerContext;
const streamLinks: Stream[] = [];
const subtitles: TextTracks = [];
const baseUrl = await getBaseUrl('kissKh');
const baseUrl = await getBaseUrl("kissKh");
const streamUrl =
'https://adorable-salamander-ecbb21.netlify.app/api/kisskh/video?id=' +
"https://adorable-salamander-ecbb21.netlify.app/api/kisskh/video?id=" +
id;
const res = await axios.get(streamUrl);
const stream = res.data?.source?.Video;
@@ -22,16 +22,16 @@ export const kissKhGetStream = async function ({
subtitles.push({
title: sub?.label,
language: sub?.land,
type: sub?.src?.includes('.vtt')
type: sub?.src?.includes(".vtt")
? TextTrackType.VTT
: TextTrackType.SUBRIP,
uri: sub?.src,
});
});
streamLinks.push({
server: 'kissKh',
server: "kissKh",
link: stream,
type: 'm3u8',
type: "m3u8",
subtitles,
headers: {
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 = {
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',
'Cache-Control': 'no-store',
'Accept-Language': 'en-US,en;q=0.9',
DNT: '1',
'sec-ch-ua':
"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",
"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',
"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:
'_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',
'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',
"_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",
"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",
};
export const vegaGetInfo = async ({
export const getMeta = async ({
link,
providerContext,
}: {
@@ -29,10 +29,10 @@ export const vegaGetInfo = async ({
providerContext: ProviderContext;
}): Promise<Info> => {
try {
const {axios, cheerio} = providerContext;
const { axios, cheerio } = providerContext;
const url = link;
console.log('url', url);
const baseUrl = url.split('/').slice(0, 3).join('/');
console.log("url", url);
const baseUrl = url.split("/").slice(0, 3).join("/");
const response = await axios.get(url, {
headers: {
...headers,
@@ -40,92 +40,93 @@ export const vegaGetInfo = async ({
},
});
const $ = cheerio.load(response.data);
const infoContainer = $('.entry-content,.post-inner');
const heading = infoContainer?.find('h3');
const infoContainer = $(".entry-content,.post-inner");
const heading = infoContainer?.find("h3");
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] ||
'';
"";
// console.log(imdbId)
const type = heading?.next('p')?.text()?.includes('Series Name')
? 'series'
: 'movie';
const type = heading?.next("p")?.text()?.includes("Series Name")
? "series"
: "movie";
// console.log(type);
// title
const titleRegex = /Name: (.+)/;
const title = heading?.next('p')?.text()?.match(titleRegex)?.[1] || '';
const title = heading?.next("p")?.text()?.match(titleRegex)?.[1] || "";
// console.log(title);
// synopsis
const synopsisNode = infoContainer?.find('p')?.next('h3,h4')?.next('p')?.[0]
?.children?.[0];
const synopsisNode = //@ts-ignore
infoContainer?.find("p")?.next("h3,h4")?.next("p")?.[0]?.children?.[0];
const synopsis =
synopsisNode && 'data' in synopsisNode ? synopsisNode.data : '';
synopsisNode && "data" in synopsisNode ? synopsisNode.data : "";
// console.log(synopsis);
// image
let image =
infoContainer?.find('img[data-lazy-src]')?.attr('data-lazy-src') || '';
if (image.startsWith('//')) {
image = 'https:' + image;
infoContainer?.find("img[data-lazy-src]")?.attr("data-lazy-src") || "";
if (image.startsWith("//")) {
image = "https:" + image;
}
// console.log(image);
// console.log({title, synopsis, image, imdbId, type});
/// Links
const hr = infoContainer?.first()?.find('hr');
const list = hr?.nextUntil('hr');
const hr = infoContainer?.first()?.find("hr");
const list = hr?.nextUntil("hr");
const links: Link[] = [];
list.each((index, element: any) => {
element = $(element);
// 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);
// movieLinks
const movieLinks = element
?.next()
.find('.dwd-button')
.find(".dwd-button")
.text()
.toLowerCase()
.includes('download')
? element?.next().find('.dwd-button')?.parent()?.attr('href')
: '';
.includes("download")
? element?.next().find(".dwd-button")?.parent()?.attr("href")
: "";
// episode links
const vcloudLinks = element
?.next()
.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()
?.attr('href');
?.attr("href");
console.log(title);
const episodesLink =
(vcloudLinks
? vcloudLinks
: element
?.next()
.find('.dwd-button')
.find(".dwd-button")
.text()
.toLowerCase()
.includes('episode')
? element?.next().find('.dwd-button')?.parent()?.attr('href')
: '') ||
.includes("episode")
? element?.next().find(".dwd-button")?.parent()?.attr("href")
: "") ||
element
?.next()
.find(
".btn-outline[style='background:linear-gradient(135deg,#0ebac3,#09d261); color: white;']",
".btn-outline[style='background:linear-gradient(135deg,#0ebac3,#09d261); color: white;']"
)
?.parent()
?.attr('href');
?.attr("href");
if (movieLinks || episodesLink) {
links.push({
title,
directLinks: movieLinks
? [{title: 'Movie', link: movieLinks, type: 'movie'}]
? [{ title: "Movie", link: movieLinks, type: "movie" }]
: [],
episodesLink,
quality,
@@ -142,15 +143,15 @@ export const vegaGetInfo = async ({
linkList: links,
};
} catch (error) {
console.log('getInfo error');
console.log("getInfo error");
console.error(error);
// ToastAndroid.show('No response', ToastAndroid.SHORT);
return {
title: '',
synopsis: '',
image: '',
imdbId: '',
type: '',
title: "",
synopsis: "",
image: "",
imdbId: "",
type: "",
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 = {
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',
'Cache-Control': 'no-store',
'Accept-Language': 'en-US,en;q=0.9',
DNT: '1',
'sec-ch-ua':
"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",
"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',
"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:
'_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',
'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',
"_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",
"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",
};
export async function vegaGetStream({
export async function getStream({
link,
type,
signal,
@@ -32,14 +32,14 @@ export async function vegaGetStream({
signal: AbortSignal;
providerContext: ProviderContext;
}) {
const {axios, cheerio, extractors} = providerContext;
const {hubcloudExtracter} = extractors;
const { axios, cheerio, extractors } = providerContext;
const { hubcloudExtracter } = extractors;
try {
const streamLinks: Stream[] = [];
console.log('dotlink', link);
if (type === 'movie') {
console.log("dotlink", link);
if (type === "movie") {
// vlink
const dotlinkRes = await axios(`${link}`, {headers});
const dotlinkRes = await axios(`${link}`, { headers });
const dotlinkText = dotlinkRes.data;
// console.log('dotlinkText', dotlinkText);
const vlink = dotlinkText.match(/<a\s+href="([^"]*cloud\.[^"]*)"/i) || [];
@@ -50,66 +50,66 @@ export async function vegaGetStream({
try {
const $ = cheerio.load(dotlinkText);
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()
.attr('href');
.attr("href");
// console.log('filepressLink', filepressLink);
const filepressID = filepressLink?.split('/').pop();
const filepressID = filepressLink?.split("/").pop();
const filepressBaseUrl = filepressLink
?.split('/')
?.split("/")
.slice(0, -2)
.join('/');
.join("/");
// console.log('filepressID', filepressID);
// console.log('filepressBaseUrl', filepressBaseUrl);
const filepressTokenRes = await axios.post(
filepressBaseUrl + '/api/file/downlaod/',
filepressBaseUrl + "/api/file/downlaod/",
{
id: filepressID,
method: 'indexDownlaod',
method: "indexDownlaod",
captchaValue: null,
},
{
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Referer: filepressBaseUrl,
},
},
}
);
// console.log('filepressTokenRes', filepressTokenRes.data);
if (filepressTokenRes.data?.status) {
const filepressToken = filepressTokenRes.data?.data;
const filepressStreamLink = await axios.post(
filepressBaseUrl + '/api/file/downlaod2/',
filepressBaseUrl + "/api/file/downlaod2/",
{
id: filepressToken,
method: 'indexDownlaod',
method: "indexDownlaod",
captchaValue: null,
},
{
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Referer: filepressBaseUrl,
},
},
}
);
// console.log('filepressStreamLink', filepressStreamLink.data);
streamLinks.push({
server: 'filepress',
server: "filepress",
link: filepressStreamLink.data?.data?.[0],
type: 'mkv',
type: "mkv",
});
}
} catch (error) {
console.log('filepress error: ');
console.log("filepress error: ");
// console.error(error);
}
}
return await hubcloudExtracter(link, signal);
} catch (error: any) {
console.log('getStream error: ', error);
if (error.message.includes('Aborted')) {
console.log("getStream error: ", error);
if (error.message.includes("Aborted")) {
} else {
}
return [];

View File

@@ -1,85 +1,85 @@
export const catalogList = [
export const catalog = [
{
title: 'Latest',
filter: '',
title: "Latest",
filter: "",
},
{
title: 'Netflix',
filter: '/ott/netflix',
title: "Netflix",
filter: "/ott/netflix",
},
{
title: 'HBO Max',
filter: '/ott/hbo-max',
title: "HBO Max",
filter: "/ott/hbo-max",
},
{
title: 'Amazon Prime',
filter: '/ott/amazon-prime-video',
title: "Amazon Prime",
filter: "/ott/amazon-prime-video",
},
];
export const modGenresList = [
export const genres = [
{
title: 'Apple TV+',
filter: '/ott/apple-tv',
title: "Apple TV+",
filter: "/ott/apple-tv",
},
{
title: 'Disney+',
filter: '/ott/disney-plus',
title: "Disney+",
filter: "/ott/disney-plus",
},
{
title: 'Hulu',
filter: '/ott/hulu',
title: "Hulu",
filter: "/ott/hulu",
},
{
title: 'Crunchyroll',
filter: '/ott/crunchyroll',
title: "Crunchyroll",
filter: "/ott/crunchyroll",
},
{
title: 'Action',
filter: '/movies-by-genre/action/',
title: "Action",
filter: "/movies-by-genre/action/",
},
{
title: 'Adventure',
filter: '/movies-by-genre/adventure/',
title: "Adventure",
filter: "/movies-by-genre/adventure/",
},
{
title: 'Animation',
filter: '/movies-by-genre/animated/',
title: "Animation",
filter: "/movies-by-genre/animated/",
},
{
title: 'Comedy',
filter: '/movies-by-genre/comedy/',
title: "Comedy",
filter: "/movies-by-genre/comedy/",
},
{
title: 'Crime',
filter: '/movies-by-genre/crime/',
title: "Crime",
filter: "/movies-by-genre/crime/",
},
{
title: 'Documentary',
filter: '/movies-by-genre/documentary/',
title: "Documentary",
filter: "/movies-by-genre/documentary/",
},
{
title: 'Fantasy',
filter: '/movies-by-genre/fantasy/',
title: "Fantasy",
filter: "/movies-by-genre/fantasy/",
},
{
title: 'Horror',
filter: '/movies-by-genre/horror/',
title: "Horror",
filter: "/movies-by-genre/horror/",
},
{
title: 'Mystery',
filter: '/movies-by-genre/mystery/',
title: "Mystery",
filter: "/movies-by-genre/mystery/",
},
{
title: 'Romance',
filter: '/movies-by-genre/romance/',
title: "Romance",
filter: "/movies-by-genre/romance/",
},
{
title: 'Thriller',
filter: '/movies-by-genre/thriller/',
title: "Thriller",
filter: "/movies-by-genre/thriller/",
},
{
title: 'Sci-Fi',
filter: '/movies-by-genre/sci-fi/',
title: "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,
page,
signal,
@@ -12,13 +12,13 @@ export const modGetPosts = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const {getBaseUrl, axios, cheerio} = providerContext;
const baseUrl = await getBaseUrl('Moviesmod');
const { getBaseUrl, axios, cheerio } = providerContext;
const baseUrl = await getBaseUrl("Moviesmod");
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,
page,
signal,
@@ -30,10 +30,10 @@ export const modGetPostsSearch = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const {getBaseUrl, axios, cheerio} = providerContext;
const baseUrl = await getBaseUrl('Moviesmod');
const { getBaseUrl, axios, cheerio } = providerContext;
const baseUrl = await getBaseUrl("Moviesmod");
const url = `${baseUrl}/search/${searchQuery}/page/${page}/`;
return posts({url, signal, axios, cheerio});
return posts({ url, signal, axios, cheerio });
};
async function posts({
@@ -44,20 +44,20 @@ async function posts({
}: {
url: string;
signal: AbortSignal;
axios: ProviderContext['axios'];
cheerio: ProviderContext['cheerio'];
axios: ProviderContext["axios"];
cheerio: ProviderContext["cheerio"];
}): Promise<Post[]> {
try {
const res = await axios.get(url, {signal});
const res = await axios.get(url, { signal });
const data = res.data;
const $ = cheerio.load(data);
const catalog: Post[] = [];
$('.post-cards')
.find('article')
$(".post-cards")
.find("article")
.map((i, element) => {
const title = $(element).find('a').attr('title');
const link = $(element).find('a').attr('href');
const image = $(element).find('img').attr('src');
const title = $(element).find("a").attr("title");
const link = $(element).find("a").attr("href");
const image = $(element).find("img").attr("src");
if (title && link && image) {
catalog.push({
title: title,
@@ -68,7 +68,7 @@ async function posts({
});
return catalog;
} catch (err) {
console.error('modGetPosts error ', err);
console.error("modGetPosts error ", err);
return [];
}
}

View File

@@ -1,26 +1,26 @@
import {Stream, ProviderContext, EpisodeLink} from '../types';
import { Stream, ProviderContext, EpisodeLink } 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':
"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',
Cookie: 'popads_user_id=6ba8fe60a481387a3249f05aa058822d',
'Sec-Fetch-Site': 'none',
'Sec-Fetch-User': '?1',
'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',
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": '"Windows"',
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
Cookie: "popads_user_id=6ba8fe60a481387a3249f05aa058822d",
"Sec-Fetch-Site": "none",
"Sec-Fetch-User": "?1",
"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 modGetStream = async function ({
export const getStream = async function ({
link: url,
type,
providerContext,
@@ -29,7 +29,7 @@ export const modGetStream = async function ({
type: string;
providerContext: ProviderContext;
}): Promise<Stream[]> {
const {axios, cheerio} = providerContext;
const { axios, cheerio } = providerContext;
try {
const modGetEpisodeLinks = async function ({
url,
@@ -38,40 +38,40 @@ export const modGetStream = async function ({
url: string;
providerContext: ProviderContext;
}): Promise<EpisodeLink[]> {
const {axios, cheerio} = providerContext;
const { axios, cheerio } = providerContext;
try {
if (url.includes('url=')) {
url = atob(url.split('url=')[1]);
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=')) {
if (url.includes("url=")) {
const newUrl = $("meta[http-equiv='refresh']")
.attr('content')
?.split('url=')[1];
.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) => {
$("h3,h4").map((i, element) => {
const seriesTitle = $(element).text();
const episodesLink = $(element).find('a').attr('href');
if (episodesLink && episodesLink !== '#') {
const episodesLink = $(element).find("a").attr("href");
if (episodesLink && episodesLink !== "#") {
episodeLinks.push({
title: seriesTitle.trim() || 'No title found',
link: episodesLink || '',
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 !== '#') {
$("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 || '',
title: seriesTitle.trim() || "No title found",
link: episodesLink || "",
});
}
});
@@ -81,9 +81,9 @@ export const modGetStream = async function ({
return [];
}
};
console.log('modGetStream', type, url);
if (type === 'movie') {
const servers = await modGetEpisodeLinks({url, providerContext});
console.log("modGetStream", type, url);
if (type === "movie") {
const servers = await modGetEpisodeLinks({ url, providerContext });
url = servers[0].link || url;
}
@@ -98,22 +98,22 @@ export const modGetStream = async function ({
// console.log(ddl);
const servers: Stream[] = [];
const driveLink = await isDriveLink(ddl);
const driveRes = await axios.get(driveLink, {headers});
const driveRes = await axios.get(driveLink, { headers });
const driveHtml = driveRes.data;
const $drive = cheerio.load(driveHtml);
try {
const resumeBot = $drive('.btn.btn-light').attr('href') || '';
const resumeBotRes = await axios.get(resumeBot, {headers});
const resumeBot = $drive(".btn.btn-light").attr("href") || "";
const resumeBotRes = await axios.get(resumeBot, { headers });
const resumeBotToken = resumeBotRes.data.match(
/formData\.append\('token', '([a-f0-9]+)'\)/,
/formData\.append\('token', '([a-f0-9]+)'\)/
)[1];
const resumeBotBody = new FormData();
resumeBotBody.append('token', resumeBotToken);
resumeBotBody.append("token", resumeBotToken);
const resumeBotPath = resumeBotRes.data.match(
/fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/,
/fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/
)[1];
const resumeBotBaseUrl = resumeBot.split('/download')[0];
const resumeBotBaseUrl = resumeBot.split("/download")[0];
// console.log(
// 'resumeBotPath',
// resumeBotBaseUrl + '/download?id=' + resumeBotPath,
@@ -121,84 +121,84 @@ export const modGetStream = async function ({
// console.log('resumeBotBody', resumeBotToken);
const resumeBotDownload = await fetch(
resumeBotBaseUrl + '/download?id=' + resumeBotPath,
resumeBotBaseUrl + "/download?id=" + resumeBotPath,
{
method: 'POST',
method: "POST",
body: resumeBotBody,
headers: {
Referer: resumeBot,
Cookie: 'PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308',
Cookie: "PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308",
},
},
}
);
const resumeBotDownloadData = await resumeBotDownload.json();
console.log('resumeBotDownloadData', resumeBotDownloadData.url);
console.log("resumeBotDownloadData", resumeBotDownloadData.url);
servers.push({
server: 'ResumeBot',
server: "ResumeBot",
link: resumeBotDownloadData.url,
type: 'mkv',
type: "mkv",
});
} catch (err) {
console.log('ResumeBot link not found', err);
console.log("ResumeBot link not found", err);
}
// CF workers type 1
try {
const cfWorkersLink = driveLink.replace('/file', '/wfile') + '?type=1';
const cfWorkersRes = await axios.get(cfWorkersLink, {headers});
const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=1";
const cfWorkersRes = await axios.get(cfWorkersLink, { headers });
const cfWorkersHtml = cfWorkersRes.data;
const $cfWorkers = cheerio.load(cfWorkersHtml);
const cfWorkersStream = $cfWorkers('.btn-success');
const cfWorkersStream = $cfWorkers(".btn-success");
cfWorkersStream.each((i, el) => {
const link = el.attribs.href;
const link = (el as any).attribs?.href;
if (link) {
servers.push({
server: 'Cf Worker 1.' + i,
server: "Cf Worker 1." + i,
link: link,
type: 'mkv',
type: "mkv",
});
}
});
} catch (err) {
console.log('CF workers link not found', err);
console.log("CF workers link not found", err);
}
// CF workers type 2
try {
const cfWorkersLink = driveLink.replace('/file', '/wfile') + '?type=2';
const cfWorkersRes = await axios.get(cfWorkersLink, {headers});
const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=2";
const cfWorkersRes = await axios.get(cfWorkersLink, { headers });
const cfWorkersHtml = cfWorkersRes.data;
const $cfWorkers = cheerio.load(cfWorkersHtml);
const cfWorkersStream = $cfWorkers('.btn-success');
const cfWorkersStream = $cfWorkers(".btn-success");
cfWorkersStream.each((i, el) => {
const link = el.attribs.href;
const link = (el as any).attribs?.href;
if (link) {
servers.push({
server: 'Cf Worker 2.' + i,
server: "Cf Worker 2." + i,
link: link,
type: 'mkv',
type: "mkv",
});
}
});
} catch (err) {
console.log('CF workers link not found', err);
console.log("CF workers link not found", err);
}
// gdrive
//instant link
try {
const seed = $drive('.btn-danger').attr('href') || '';
const instantToken = seed.split('=')[1];
const seed = $drive(".btn-danger").attr("href") || "";
const instantToken = seed.split("=")[1];
// console.log('InstantToken', instantToken);
const InstantFromData = new FormData();
InstantFromData.append('keys', instantToken);
const videoSeedUrl = seed.split('/').slice(0, 3).join('/') + '/api';
InstantFromData.append("keys", instantToken);
const videoSeedUrl = seed.split("/").slice(0, 3).join("/") + "/api";
// console.log('videoSeedUrl', videoSeedUrl);
const instantLinkRes = await fetch(videoSeedUrl, {
method: 'POST',
method: "POST",
body: InstantFromData,
headers: {
'x-token': videoSeedUrl,
"x-token": videoSeedUrl,
},
});
const instantLinkData = await instantLinkRes.json();
@@ -206,32 +206,32 @@ export const modGetStream = async function ({
if (instantLinkData.error === false) {
const instantLink = instantLinkData.url;
servers.push({
server: 'Gdrive-Instant',
server: "Gdrive-Instant",
link: instantLink,
type: 'mkv',
type: "mkv",
});
} else {
console.log('Instant link not found', instantLinkData);
console.log("Instant link not found", instantLinkData);
}
} catch (err) {
console.log('Instant link not found', err);
console.log("Instant link not found", err);
}
return servers;
} catch (err) {
console.log('getStream error', err);
console.log("getStream error", err);
return [];
}
};
const isDriveLink = async (ddl: string) => {
if (ddl.includes('drive')) {
if (ddl.includes("drive")) {
const driveLeach = await fetch(ddl);
const driveLeachData = await driveLeach.text();
const pathMatch = driveLeachData.match(
/window\.location\.replace\("([^"]+)"\)/,
/window\.location\.replace\("([^"]+)"\)/
);
const path = pathMatch?.[1];
const mainUrl = ddl.split('/')[2];
const mainUrl = ddl.split("/")[2];
console.log(`driveUrl = https://${mainUrl}${path}`);
return `https://${mainUrl}${path}`;
} else {
@@ -240,13 +240,13 @@ const isDriveLink = async (ddl: string) => {
};
async function modExtractor(url: string, providerContext: ProviderContext) {
const {axios, cheerio} = providerContext;
const { axios, cheerio } = providerContext;
try {
const wpHttp = url.split('sid=')[1];
const wpHttp = url.split("sid=")[1];
var bodyFormData0 = new FormData();
bodyFormData0.append('_wp_http', wpHttp);
const res = await fetch(url.split('?')[0], {
method: 'POST',
bodyFormData0.append("_wp_http", wpHttp);
const res = await fetch(url.split("?")[0], {
method: "POST",
body: bodyFormData0,
});
const data = await res.text();
@@ -255,25 +255,25 @@ async function modExtractor(url: string, providerContext: ProviderContext) {
const $ = cheerio.load(html);
// 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);
// form data
var bodyFormData = new FormData();
bodyFormData.append('_wp_http2', wpHttp2);
const formUrl1 = $('form').attr('action');
const formUrl = formUrl1 || url.split('?')[0];
bodyFormData.append("_wp_http2", wpHttp2);
const formUrl1 = $("form").attr("action");
const formUrl = formUrl1 || url.split("?")[0];
const res2 = await fetch(formUrl, {
method: 'POST',
method: "POST",
body: bodyFormData,
});
const html2: any = await res2.text();
const link = html2.match(/setAttribute\("href",\s*"(.*?)"/)[1];
console.log(link);
const cookie = link.split('=')[1];
console.log('cookie', cookie);
const cookie = link.split("=")[1];
console.log("cookie", cookie);
const downloadLink = await axios.get(link, {
headers: {
@@ -283,6 +283,6 @@ async function modExtractor(url: string, providerContext: ProviderContext) {
});
return downloadLink;
} 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 {allGetInfo} from '../autoEmbed/allGetInfo';
import {allGetPost, allGetSearchPosts} from '../autoEmbed/allGetPost';
import {ProviderType} from '../types';
import {mpGetStream} from './mpGetStream';
import { allCatalog, allGenresList } from "../autoEmbed/catalog";
import { allGetInfo } from../autoEmbed/metafo";
import { allGetPost, allGetSearchPosts } from "../autoEmbed/posts";
import { ProviderType } from "../types";
import { mpGetStream } from "./stream";
export const moviesApi: ProviderType = {
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,
providerContext,
}: {
@@ -8,41 +8,41 @@ export const multiGetInfo = async function ({
providerContext: ProviderContext;
}): Promise<Info> {
try {
const {axios, cheerio} = providerContext;
const { axios, cheerio } = providerContext;
const url = link;
const res = await axios.get(url);
const data = res.data;
const $ = cheerio.load(data);
const type = url.includes('tvshows') ? 'series' : 'movie';
const imdbId = '';
const title = url.split('/')[4].replace(/-/g, ' ');
const image = $('.g-item').find('a').attr('href') || '';
const synopsis = $('.wp-content').find('p').text() || '';
const type = url.includes("tvshows") ? "series" : "movie";
const imdbId = "";
const title = url.split("/")[4].replace(/-/g, " ");
const image = $(".g-item").find("a").attr("href") || "";
const synopsis = $(".wp-content").find("p").text() || "";
// Links
const links: Link[] = [];
if (type === 'series') {
$('#seasons')
if (type === "series") {
$("#seasons")
.children()
.map((i, element) => {
const title = $(element)
.find('.title')
.find(".title")
.children()
.remove()
.end()
.text();
let episodesList: {title: string; link: string}[] = [];
let episodesList: { title: string; link: string }[] = [];
$(element)
.find('.episodios')
.find(".episodios")
.children()
.map((i, element) => {
const title =
'Episode' +
$(element).find('.numerando').text().trim().split('-')[1];
const link = $(element).find('a').attr('href');
"Episode" +
$(element).find(".numerando").text().trim().split("-")[1];
const link = $(element).find("a").attr("href");
if (title && link) {
episodesList.push({title, link});
episodesList.push({ title, link });
}
});
if (title && episodesList.length > 0) {
@@ -55,7 +55,7 @@ export const multiGetInfo = async function ({
} else {
links.push({
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);
@@ -71,11 +71,11 @@ export const multiGetInfo = async function ({
} catch (err) {
console.error(err);
return {
title: '',
synopsis: '',
image: '',
imdbId: '',
type: 'movie',
title: "",
synopsis: "",
image: "",
imdbId: "",
type: "movie",
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,
page,
signal,
@@ -12,13 +12,13 @@ export const multiGetPosts = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const {getBaseUrl, cheerio} = providerContext;
const baseUrl = await getBaseUrl('multi');
const { getBaseUrl, cheerio } = providerContext;
const baseUrl = await getBaseUrl("multi");
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,
signal,
@@ -30,10 +30,10 @@ export const multiGetPostsSearch = async function ({
signal: AbortSignal;
providerContext: ProviderContext;
}): Promise<Post[]> {
const {getBaseUrl, cheerio} = providerContext;
const baseUrl = await getBaseUrl('multi');
const { getBaseUrl, cheerio } = providerContext;
const baseUrl = await getBaseUrl("multi");
const url = `${baseUrl}/?s=${searchQuery}`;
return posts({url, signal, cheerio});
return posts({ url, signal, cheerio });
};
async function posts({
@@ -43,21 +43,21 @@ async function posts({
}: {
url: string;
signal: AbortSignal;
cheerio: ProviderContext['cheerio'];
cheerio: ProviderContext["cheerio"];
}): Promise<Post[]> {
try {
const res = await fetch(url, {signal});
const res = await fetch(url, { signal });
const data = await res.text();
const $ = cheerio.load(data);
const catalog: Post[] = [];
$('.items.full')
$(".items.full")
.children()
.map((i, element) => {
const title = $(element).find('.poster').find('img').attr('alt');
const link = $(element).find('.poster').find('a').attr('href');
const title = $(element).find(".poster").find("img").attr("alt");
const link = $(element).find(".poster").find("a").attr("href");
const image =
$(element).find('.poster').find('img').attr('data-src') ||
$(element).find('.poster').find('img').attr('src');
$(element).find(".poster").find("img").attr("data-src") ||
$(element).find(".poster").find("img").attr("src");
if (title && link && image) {
catalog.push({
title: title,
@@ -68,7 +68,7 @@ async function posts({
});
return catalog;
} catch (err) {
console.error('multiGetPosts error ', err);
console.error("multiGetPosts error ", err);
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,
providerContext,
}: {
@@ -8,70 +8,70 @@ export const multiGetStream = async function ({
type: string;
providerContext: ProviderContext;
}): Promise<Stream[]> {
const {axios, cheerio} = providerContext;
const { axios, cheerio } = providerContext;
const headers = {
'sec-ch-ua':
"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"',
Referer: 'https://multimovies.online/',
'Sec-Fetch-User': '?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',
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": '"Windows"',
Referer: "https://multimovies.online/",
"Sec-Fetch-User": "?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",
};
try {
const res = await axios.get(url, {headers});
const res = await axios.get(url, { headers });
const html = res.data;
const $ = cheerio.load(html);
const streamLinks: Stream[] = [];
const postId = $('#player-option-1').attr('data-post');
const nume = $('#player-option-1').attr('data-nume');
const typeValue = $('#player-option-1').attr('data-type');
const postId = $("#player-option-1").attr("data-post");
const nume = $("#player-option-1").attr("data-nume");
const typeValue = $("#player-option-1").attr("data-type");
const baseUrl = url.split('/').slice(0, 3).join('/');
console.log('baseUrl', baseUrl);
const baseUrl = url.split("/").slice(0, 3).join("/");
console.log("baseUrl", baseUrl);
const formData = new FormData();
formData.append('action', 'doo_player_ajax');
formData.append('post', postId);
formData.append('nume', nume);
formData.append('type', typeValue);
formData.append("action", "doo_player_ajax");
formData.append("post", postId || "");
formData.append("nume", nume || "");
formData.append("type", typeValue || "");
console.log('formData', formData);
console.log("formData", formData);
const playerRes = await fetch(`${baseUrl}/wp-admin/admin-ajax.php`, {
headers: headers,
body: formData,
method: 'POST',
method: "POST",
});
const playerData = await playerRes.json();
console.log('playerData', playerData);
console.log("playerData", playerData);
let ifameUrl =
playerData?.embed_url?.match(/<iframe[^>]+src="([^"]+)"[^>]*>/i)?.[1] ||
playerData?.embed_url;
console.log('ifameUrl', ifameUrl);
if (!ifameUrl.includes('multimovies')) {
let playerBaseUrl = ifameUrl.split('/').slice(0, 3).join('/');
const newPlayerBaseUrl = await axios.head(playerBaseUrl, {headers});
console.log("ifameUrl", ifameUrl);
if (!ifameUrl.includes("multimovies")) {
let playerBaseUrl = ifameUrl.split("/").slice(0, 3).join("/");
const newPlayerBaseUrl = await axios.head(playerBaseUrl, { headers });
if (newPlayerBaseUrl) {
playerBaseUrl = newPlayerBaseUrl.request?.responseURL
?.split('/')
?.split("/")
.slice(0, 3)
.join('/');
.join("/");
}
const playerId = ifameUrl.split('/').pop();
const playerId = ifameUrl.split("/").pop();
const NewformData = new FormData();
NewformData.append('sid', playerId);
NewformData.append("sid", playerId);
console.log(
'NewformData',
playerBaseUrl + '/embedhelper.php',
NewformData,
"NewformData",
playerBaseUrl + "/embedhelper.php",
NewformData
);
const playerRes = await fetch(`${playerBaseUrl}/embedhelper.php`, {
headers: headers,
body: NewformData,
method: 'POST',
method: "POST",
});
const playerData = await playerRes.json();
// console.log('playerData', playerData);
@@ -80,7 +80,7 @@ export const multiGetStream = async function ({
JSON.parse(atob(playerData?.mresult))?.smwh ||
playerData?.mresult?.smwh;
const newIframeUrl = siteUrl + siteId;
console.log('newIframeUrl', newIframeUrl);
console.log("newIframeUrl", newIframeUrl);
if (newIframeUrl) {
ifameUrl = newIframeUrl;
}
@@ -97,7 +97,7 @@ export const multiGetStream = async function ({
var functionRegex =
/eval\(function\((.*?)\)\{.*?return p\}.*?\('(.*?)'\.split/;
var match = functionRegex.exec(iframeData);
let p = '';
let p = "";
if (match) {
// var params = match[1].split(',').map(param => param.trim());
var encodedString = match[2];
@@ -107,19 +107,19 @@ export const multiGetStream = async function ({
p = encodedString.split("',36,")?.[0].trim();
let a = 36;
let c = encodedString.split("',36,")[1].slice(2).split('|').length;
let k = encodedString.split("',36,")[1].slice(2).split('|');
let c = encodedString.split("',36,")[1].slice(2).split("|").length;
let k = encodedString.split("',36,")[1].slice(2).split("|");
while (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]);
}
}
// console.log('Decoded String:', p);
} else {
console.log('No match found');
console.log("No match found");
}
const streamUrl = p?.match(/https?:\/\/[^"]+?\.m3u8[^"]*/)?.[0];
@@ -138,13 +138,13 @@ export const multiGetStream = async function ({
});
});
}
console.log('streamUrl', streamUrl);
console.log('newUrl', streamUrl?.replace(/&i=\d+,'\.4&/, '&i=0.4&'));
console.log("streamUrl", streamUrl);
console.log("newUrl", streamUrl?.replace(/&i=\d+,'\.4&/, "&i=0.4&"));
if (streamUrl) {
streamLinks.push({
server: 'Multi',
link: streamUrl.replace(/&i=\d+,'\.4&/, '&i=0.4&'),
type: 'm3u8',
server: "Multi",
link: streamUrl.replace(/&i=\d+,'\.4&/, "&i=0.4&"),
type: "m3u8",
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: string;
}): Promise<Info> {
let providerValue = 'netflixMirror';
let providerValue = "netflixMirror";
try {
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(
link,
link
)}`;
console.log('nfifo', url);
console.log("nfifo", url);
const res = await fetch(url, {
credentials: 'omit',
credentials: "omit",
});
const data = await res.json();
const id = link.split('id=')[1]?.split('&')[0];
const id = link.split("id=")[1]?.split("&")[0];
const meta = {
title: data.title,
synopsis: data.desc,
image: `https://img.nfmirrorcdn.top/poster/h/${id}.jpg`,
cast: data?.short_cast?.split(','),
tags: [data?.year, data?.hdsd, ...data?.thismovieis?.split(',')],
imdbId: '',
type: 'series',
cast: data?.short_cast?.split(","),
tags: [data?.year, data?.hdsd, ...data?.thismovieis?.split(",")],
imdbId: "",
type: "series",
};
console.log('nfinfo', meta);
console.log("nfinfo", meta);
const linkList: Link[] = [];
if (data?.season?.length > 0) {
data.season.map((season: any) => {
linkList.push({
title: 'Season ' + season?.s,
title: "Season " + season?.s,
episodesLink: season?.id,
});
});
} else {
linkList.push({
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) {
console.error(err);
return {
title: '',
synopsis: '',
image: '',
imdbId: '',
type: '',
title: "",
synopsis: "",
image: "",
imdbId: "",
type: "",
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