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

View File

@@ -0,0 +1,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,
});
}