mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
build
This commit is contained in:
79
dist/multi/catalog.js
vendored
Normal file
79
dist/multi/catalog.js
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalog = void 0;
|
||||
exports.catalog = [
|
||||
{
|
||||
title: "Trending",
|
||||
filter: "/trending/",
|
||||
},
|
||||
{
|
||||
title: "Netflix",
|
||||
filter: "/genre/netflix/",
|
||||
},
|
||||
{
|
||||
title: "Amazon Prime",
|
||||
filter: "/genre/amazon-prime/",
|
||||
},
|
||||
{
|
||||
title: "Disney Hotstar",
|
||||
filter: "/genre/disney-hotstar/",
|
||||
},
|
||||
];
|
||||
exports.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/",
|
||||
},
|
||||
];
|
||||
76
dist/multi/meta.js
vendored
Normal file
76
dist/multi/meta.js
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const getMeta = async function ({ link, providerContext, }) {
|
||||
try {
|
||||
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() || "";
|
||||
// Links
|
||||
const links = [];
|
||||
if (type === "series") {
|
||||
$("#seasons")
|
||||
.children()
|
||||
.map((i, element) => {
|
||||
const title = $(element)
|
||||
.find(".title")
|
||||
.children()
|
||||
.remove()
|
||||
.end()
|
||||
.text();
|
||||
let episodesList = [];
|
||||
$(element)
|
||||
.find(".episodios")
|
||||
.children()
|
||||
.map((i, element) => {
|
||||
const title = "Episode" +
|
||||
$(element).find(".numerando").text().trim().split("-")[1];
|
||||
const link = $(element).find("a").attr("href");
|
||||
if (title && link) {
|
||||
episodesList.push({ title, link });
|
||||
}
|
||||
});
|
||||
if (title && episodesList.length > 0) {
|
||||
links.push({
|
||||
title,
|
||||
directLinks: episodesList,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
links.push({
|
||||
title: title,
|
||||
directLinks: [{ title: title, link: url.slice(0, -1), type: "movie" }],
|
||||
});
|
||||
}
|
||||
// console.log('multi meta', links);
|
||||
return {
|
||||
title,
|
||||
synopsis,
|
||||
image,
|
||||
imdbId,
|
||||
type,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
45
dist/multi/posts.js
vendored
Normal file
45
dist/multi/posts.js
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = async function ({ filter, page, signal, providerContext, }) {
|
||||
const { getBaseUrl, cheerio } = providerContext;
|
||||
const baseUrl = await getBaseUrl("multi");
|
||||
const url = `${baseUrl + filter}page/${page}/`;
|
||||
return posts({ url, signal, cheerio });
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = async function ({ searchQuery, signal, providerContext, }) {
|
||||
const { getBaseUrl, cheerio } = providerContext;
|
||||
const baseUrl = await getBaseUrl("multi");
|
||||
const url = `${baseUrl}/?s=${searchQuery}`;
|
||||
return posts({ url, signal, cheerio });
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
async function posts({ url, signal, cheerio, }) {
|
||||
try {
|
||||
const res = await fetch(url, { signal });
|
||||
const data = await res.text();
|
||||
const $ = cheerio.load(data);
|
||||
const catalog = [];
|
||||
$(".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 image = $(element).find(".poster").find("img").attr("data-src") ||
|
||||
$(element).find(".poster").find("img").attr("src");
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("multiGetPosts error ", err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
134
dist/multi/stream.js
vendored
Normal file
134
dist/multi/stream.js
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
const types_1 = require("../types");
|
||||
const getStream = async function ({ link: url, providerContext, }) {
|
||||
const { axios, cheerio } = providerContext;
|
||||
const headers = {
|
||||
"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",
|
||||
};
|
||||
try {
|
||||
const res = await axios.get(url, { headers });
|
||||
const html = res.data;
|
||||
const $ = cheerio.load(html);
|
||||
const streamLinks = [];
|
||||
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 formData = new FormData();
|
||||
formData.append("action", "doo_player_ajax");
|
||||
formData.append("post", postId || "");
|
||||
formData.append("nume", nume || "");
|
||||
formData.append("type", typeValue || "");
|
||||
console.log("formData", formData);
|
||||
const playerRes = await fetch(`${baseUrl}/wp-admin/admin-ajax.php`, {
|
||||
headers: headers,
|
||||
body: formData,
|
||||
method: "POST",
|
||||
});
|
||||
const playerData = await playerRes.json();
|
||||
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 });
|
||||
if (newPlayerBaseUrl) {
|
||||
playerBaseUrl = newPlayerBaseUrl.request?.responseURL
|
||||
?.split("/")
|
||||
.slice(0, 3)
|
||||
.join("/");
|
||||
}
|
||||
const playerId = ifameUrl.split("/").pop();
|
||||
const NewformData = new FormData();
|
||||
NewformData.append("sid", playerId);
|
||||
console.log("NewformData", playerBaseUrl + "/embedhelper.php", NewformData);
|
||||
const playerRes = await fetch(`${playerBaseUrl}/embedhelper.php`, {
|
||||
headers: headers,
|
||||
body: NewformData,
|
||||
method: "POST",
|
||||
});
|
||||
const playerData = await playerRes.json();
|
||||
// console.log('playerData', playerData);
|
||||
const siteUrl = playerData?.siteUrls?.smwh;
|
||||
const siteId = JSON.parse(atob(playerData?.mresult))?.smwh ||
|
||||
playerData?.mresult?.smwh;
|
||||
const newIframeUrl = siteUrl + siteId;
|
||||
console.log("newIframeUrl", newIframeUrl);
|
||||
if (newIframeUrl) {
|
||||
ifameUrl = newIframeUrl;
|
||||
}
|
||||
}
|
||||
const iframeRes = await axios.get(ifameUrl, {
|
||||
headers: {
|
||||
...headers,
|
||||
Referer: url,
|
||||
},
|
||||
});
|
||||
const iframeData = iframeRes.data;
|
||||
// Step 1: Extract the function parameters and the encoded string
|
||||
var functionRegex = /eval\(function\((.*?)\)\{.*?return p\}.*?\('(.*?)'\.split/;
|
||||
var match = functionRegex.exec(iframeData);
|
||||
let p = "";
|
||||
if (match) {
|
||||
// var params = match[1].split(',').map(param => param.trim());
|
||||
var encodedString = match[2];
|
||||
// console.log('Parameters:', params);
|
||||
// console.log('Encoded String:', encodedString.split("',36,")[0], '🔥🔥');
|
||||
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("|");
|
||||
while (c--) {
|
||||
if (k[c]) {
|
||||
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");
|
||||
}
|
||||
const streamUrl = p?.match(/https?:\/\/[^"]+?\.m3u8[^"]*/)?.[0];
|
||||
const subtitles = [];
|
||||
const subtitleMatch = p?.match(/https:\/\/[^\s"]+\.vtt/g);
|
||||
// console.log('subtitleMatch', subtitleMatch);
|
||||
// console.log('streamUrl', streamUrl);
|
||||
if (subtitleMatch?.length) {
|
||||
subtitleMatch.forEach((sub) => {
|
||||
const lang = sub.match(/_([a-zA-Z]{3})\.vtt$/)[1];
|
||||
subtitles.push({
|
||||
language: lang,
|
||||
uri: sub,
|
||||
type: types_1.TextTrackType.VTT,
|
||||
title: lang,
|
||||
});
|
||||
});
|
||||
}
|
||||
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",
|
||||
subtitles: subtitles,
|
||||
});
|
||||
}
|
||||
return streamLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
Reference in New Issue
Block a user