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:
22
dist/protonMovies/catalog.js
vendored
Normal file
22
dist/protonMovies/catalog.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalog = void 0;
|
||||
exports.catalog = [
|
||||
{
|
||||
title: "Latest",
|
||||
filter: "/movies",
|
||||
},
|
||||
{
|
||||
title: "Netflix",
|
||||
filter: "/platform/netflix",
|
||||
},
|
||||
{
|
||||
title: "Disney +",
|
||||
filter: "/platform/disney-hotstar",
|
||||
},
|
||||
{
|
||||
title: "Amazon Prime",
|
||||
filter: "/platform/amazon-prime-video",
|
||||
},
|
||||
];
|
||||
exports.genres = [];
|
||||
93
dist/protonMovies/meta.js
vendored
Normal file
93
dist/protonMovies/meta.js
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const getMeta = async function ({ link, providerContext, }) {
|
||||
try {
|
||||
const { axios, cheerio, getBaseUrl } = providerContext;
|
||||
console.log("all", link);
|
||||
const res = await axios.get(link);
|
||||
const data = res.data;
|
||||
function decodeHtml(encodedArray) {
|
||||
// Join array elements into a single string
|
||||
const joined = encodedArray.join("");
|
||||
// Replace escaped quotes
|
||||
const unescaped = joined.replace(/\\"/g, '"').replace(/\\'/g, "'");
|
||||
// Remove remaining escape characters
|
||||
const cleaned = unescaped
|
||||
.replace(/\\n/g, "\n")
|
||||
.replace(/\\t/g, "\t")
|
||||
.replace(/\\r/g, "\r");
|
||||
// Convert literal string representations back to characters
|
||||
const decoded = cleaned
|
||||
.replace(/"/g, '"')
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/&/g, "&");
|
||||
return decoded;
|
||||
}
|
||||
const $$ = cheerio.load(data);
|
||||
const htmlArray = $$('script:contains("decodeURIComponent")')
|
||||
.text()
|
||||
.split(" = ")?.[1]
|
||||
?.split("protomovies")?.[0]
|
||||
?.trim()
|
||||
?.slice(0, -1); // remove the last character
|
||||
// console.log('protonGetInfo', htmlArray);
|
||||
const html = decodeHtml(JSON.parse(htmlArray));
|
||||
// console.log('all', html);
|
||||
const $ = cheerio.load(html);
|
||||
const title = $(".trending-text.fw-bold.texture-text.text-uppercase.my-0.fadeInLeft.animated.d-inline-block").text();
|
||||
const image = $("#thumbnail").attr("src");
|
||||
const type = link.includes("series") ? "series" : "movie";
|
||||
const synopsis = $(".col-12.iq-mb-30.animated.fadeIn").first().text() ||
|
||||
$(".description-content").text();
|
||||
const tags = $(".p-0.mt-2.list-inline.d-flex.flex-wrap.movie-tag")
|
||||
.find("li")
|
||||
.map((i, el) => $(el).text())
|
||||
.slice(0, 3)
|
||||
.get();
|
||||
const baseUrl = await getBaseUrl("protonMovies");
|
||||
const links = [];
|
||||
if (type === "movie") {
|
||||
const directLinks = [];
|
||||
directLinks.push({ title: "Movie", link: link });
|
||||
links.push({ title: "Movie", directLinks: directLinks });
|
||||
}
|
||||
else {
|
||||
$("#episodes")
|
||||
.children()
|
||||
.map((i, element) => {
|
||||
let directLinks = [];
|
||||
$(element)
|
||||
.find(".episode-block")
|
||||
.map((j, ep) => {
|
||||
const link = baseUrl + $(ep).find("a").attr("href") || "";
|
||||
const title = "Episode " + $(ep).find(".episode-number").text().split("E")[1];
|
||||
directLinks.push({ title, link });
|
||||
});
|
||||
links.push({ title: "Season " + (i + 1), directLinks: directLinks });
|
||||
});
|
||||
}
|
||||
return {
|
||||
image: image || "",
|
||||
imdbId: "",
|
||||
linkList: links,
|
||||
title: title || "",
|
||||
synopsis: synopsis,
|
||||
tags: tags,
|
||||
type: type,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error("prton", err);
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
70
dist/protonMovies/posts.js
vendored
Normal file
70
dist/protonMovies/posts.js
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = async function ({ filter, page, signal, providerContext, }) {
|
||||
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||
const baseUrl = await getBaseUrl("protonMovies");
|
||||
const url = `${baseUrl + filter}/page/${page}/`;
|
||||
return posts({ url, baseUrl, signal, axios, cheerio });
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||
const baseUrl = await getBaseUrl("protonMovies");
|
||||
const url = `${baseUrl}/search/${searchQuery}/page/${page}/`;
|
||||
return posts({ url, baseUrl, signal, axios, cheerio });
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
async function posts({ url, baseUrl, signal, axios, cheerio, }) {
|
||||
function decodeHtml(encodedArray) {
|
||||
// Join array elements into a single string
|
||||
const joined = encodedArray.join("");
|
||||
// Replace escaped quotes
|
||||
const unescaped = joined.replace(/\\"/g, '"').replace(/\\'/g, "'");
|
||||
// Remove remaining escape characters
|
||||
const cleaned = unescaped
|
||||
.replace(/\\n/g, "\n")
|
||||
.replace(/\\t/g, "\t")
|
||||
.replace(/\\r/g, "\r");
|
||||
// Convert literal string representations back to characters
|
||||
const decoded = cleaned
|
||||
.replace(/"/g, '"')
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/&/g, "&");
|
||||
return decoded;
|
||||
}
|
||||
try {
|
||||
const res = await axios.get(url, {
|
||||
headers: {
|
||||
referer: baseUrl,
|
||||
},
|
||||
signal,
|
||||
});
|
||||
const data = res.data;
|
||||
const regex = /\[(?=.*?"<div class")(.*?)\]/g;
|
||||
const htmlArray = data?.match(regex);
|
||||
const html = decodeHtml(JSON.parse(htmlArray[htmlArray.length - 1]));
|
||||
const $ = cheerio.load(html);
|
||||
const catalog = [];
|
||||
$(".col.mb-4").map((i, element) => {
|
||||
const title = $(element).find("h5").text();
|
||||
const link = $(element).find("h5").find("a").attr("href");
|
||||
const image = $(element).find("img").attr("data-src") ||
|
||||
$(element).find("img").attr("src") ||
|
||||
"";
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("protonGetPosts error ", err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
165
dist/protonMovies/stream.js
vendored
Normal file
165
dist/protonMovies/stream.js
vendored
Normal file
@@ -0,0 +1,165 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
function LALLJLutmoZpvvbikjaWM(str) {
|
||||
var buf = new ArrayBuffer(str.length * 2);
|
||||
var bufView = new Uint8Array(buf);
|
||||
for (var i = 0, strLen = str.length; i < strLen; i++) {
|
||||
bufView[i] = str.charCodeAt(i);
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
function getOrCreateUID() {
|
||||
const uid = "uid_" + Date.now() + "_" + Math.random().toString(36).substr(2, 9);
|
||||
return uid;
|
||||
}
|
||||
const getStream = async function ({ link, providerContext, }) {
|
||||
const { axios, cheerio, commonHeaders: headers, extractors, } = providerContext;
|
||||
const { gofileExtracter } = extractors;
|
||||
function generateMessageToken(baseUrlL) {
|
||||
const hostname = baseUrlL?.replace(/https?:\/\//, "").split("/")[0];
|
||||
console.log("generateMessageToken hostname", hostname);
|
||||
const NsmxUftCNibQ = `[hostname=${hostname}][agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 Edg/137.0.0.0][tmz=India Standard Time][userTimezoneOffset=-330][{"url":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.4/jquery.min.js","type":"script","duration":253.30000000074506},{"url":"https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback","type":"script","duration":397.19999999925494},{"url":"https://adoto.net/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js","type":"img","duration":225.90000000223517},{"url":"https://code.jquery.com/jquery-3.3.1.slim.min.js","type":"script","duration":65.30000000074506},{"url":"https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015","type":"script","duration":225.89999999850988},{"url":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.4/jquery.min.js","type":"script","duration":253.30000000074506},{"url":"https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback","type":"script","duration":397.19999999925494},{"url":"https://adoto.net/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js","type":"img","duration":225.90000000223517},{"url":"https://code.jquery.com/jquery-3.3.1.slim.min.js","type":"script","duration":65.30000000074506},{"url":"https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015","type":"script","duration":225.89999999850988},{"url":"https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/turnstile/if/ov2/av0/rcv/b3dhg/0x4AAAAAAAQDru7r64xT2ifD/auto/fbE/new/normal/auto/","type":"iframe","duration":2050.300000000745},{"url":"https://new19.gdtot.dad/favicon.ico","type":"img","duration":1003.6999999992549},{"url":"https://vikingfile.com/assets/favicon-64375c377b5df8304acbdad4f4430694.ico","type":"img","duration":183.19999999925494},{"url":"https://gofile.io/dist/img/favicon32.png","type":"img","duration":19177.199999999255},{"url":"https://pub.clickadu.com/assets/scripts/supported-browsers.js","type":"fetch","duration":18.799999997019768},{"url":"https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/turnstile/if/ov2/av0/rcv/b3dhg/0x4AAAAAAAQDru7r64xT2ifD/auto/fbE/auto_expire/normal/auto/","type":"iframe","duration":1612.5999999977648},{"url":"https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/turnstile/if/ov2/av0/rcv/b3dhg/0x4AAAAAAAQDru7r64xT2ifD/auto/fbE/auto_expire/normal/auto/","type":"iframe","duration":1154.0999999977648},{"url":"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.4/jquery.min.js","type":"script","duration":253.30000000074506},{"url":"https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback","type":"script","duration":397.19999999925494},{"url":"https://adoto.net/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js","type":"img","duration":225.90000000223517},{"url":"https://code.jquery.com/jquery-3.3.1.slim.min.js","type":"script","duration":65.30000000074506},{"url":"https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015","type":"script","duration":225.89999999850988},{"url":"https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/turnstile/if/ov2/av0/rcv/b3dhg/0x4AAAAAAAQDru7r64xT2ifD/auto/fbE/new/normal/auto/","type":"iframe","duration":2050.300000000745},{"url":"https://new19.gdtot.dad/favicon.ico","type":"img","duration":1003.6999999992549},{"url":"https://vikingfile.com/assets/favicon-64375c377b5df8304acbdad4f4430694.ico","type":"img","duration":183.19999999925494},{"url":"https://gofile.io/dist/img/favicon32.png","type":"img","duration":19177.199999999255},{"url":"https://pub.clickadu.com/assets/scripts/supported-browsers.js","type":"fetch","duration":18.799999997019768},{"url":"https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/turnstile/if/ov2/av0/rcv/b3dhg/0x4AAAAAAAQDru7r64xT2ifD/auto/fbE/auto_expire/normal/auto/","type":"iframe","duration":1612.5999999977648},{"url":"https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/turnstile/if/ov2/av0/rcv/b3dhg/0x4AAAAAAAQDru7r64xT2ifD/auto/fbE/auto_expire/normal/auto/","type":"iframe","duration":1154.0999999977648},{"url":"https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/turnstile/if/ov2/av0/rcv/b3dhg/0x4AAAAAAAQDru7r64xT2ifD/auto/fbE/auto_expire/normal/auto/","type":"iframe","duration":986}][{"elements":{"div":70,"span":68,"img":4,"iframe":0,"script":28,"link":20,"p":5,"a":213,"ul":28,"li":208,"button":9,"input":5},"hidden":{"div":13,"span":60,"img":1,"iframe":0,"script":28,"link":20,"p":0,"a":186,"ul":22,"li":184,"button":6,"input":2},"errors":{"network":0,"js":0},"eventListeners":0}]`;
|
||||
var jRpeP = LALLJLutmoZpvvbikjaWM(NsmxUftCNibQ);
|
||||
var jzKEwqEAcWFMNwHZnCCqJQ = new Uint8Array(jRpeP);
|
||||
var kyMXQUxoFYuZIBlKvlHa = jzKEwqEAcWFMNwHZnCCqJQ.toString();
|
||||
var kyMXQUxoFYuZIBlKvlHa = kyMXQUxoFYuZIBlKvlHa.replace(/2/g, "004");
|
||||
var kyMXQUxoFYuZIBlKvlHa = kyMXQUxoFYuZIBlKvlHa.replace(/3/g, "005");
|
||||
var kyMXQUxoFYuZIBlKvlHa = kyMXQUxoFYuZIBlKvlHa.replace(/7/g, "007");
|
||||
var kyMXQUxoFYuZIBlKvlHa = kyMXQUxoFYuZIBlKvlHa.replace(/,0,0,0/g, "");
|
||||
return kyMXQUxoFYuZIBlKvlHa;
|
||||
}
|
||||
function decodeHtml(encodedArray) {
|
||||
// Join array elements into a single string
|
||||
const joined = encodedArray.join("");
|
||||
// Replace escaped quotes
|
||||
const unescaped = joined.replace(/\\"/g, '"').replace(/\\'/g, "'");
|
||||
// Remove remaining escape characters
|
||||
const cleaned = unescaped
|
||||
.replace(/\\n/g, "\n")
|
||||
.replace(/\\t/g, "\t")
|
||||
.replace(/\\r/g, "\r");
|
||||
// Convert literal string representations back to characters
|
||||
const decoded = cleaned
|
||||
.replace(/"/g, '"')
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/&/g, "&");
|
||||
return decoded;
|
||||
}
|
||||
try {
|
||||
const streamLinks = [];
|
||||
const res = await axios.get(link, { headers });
|
||||
const data = res.data;
|
||||
// const regex = /\[(?=.*?"<div class")(.*?)\]/g;
|
||||
// const htmlArray = data?.match(regex);
|
||||
// new code
|
||||
const $$ = cheerio.load(data);
|
||||
const htmlArray = $$('script:contains("decodeURIComponent")')
|
||||
.text()
|
||||
.split(" = ")?.[1]
|
||||
?.split("protomovies")?.[0]
|
||||
?.trim()
|
||||
?.slice(0, -1); // remove the last character
|
||||
// console.log('protonGetInfo', htmlArray);
|
||||
// const html = decodeHtml(JSON.parse(htmlArray[htmlArray.length - 1]));
|
||||
const html = decodeHtml(JSON.parse(htmlArray));
|
||||
// console.log('protonGetInfo', htmlArray[htmlArray.length - 1]);
|
||||
// console.log('all', html);
|
||||
const $ = cheerio.load(html);
|
||||
const idList = [];
|
||||
const id1080 = $('tr:contains("1080p")')
|
||||
.find('button:contains("Info")')
|
||||
.attr("id")
|
||||
?.split("-")[1];
|
||||
if (id1080) {
|
||||
idList.push({
|
||||
id: id1080,
|
||||
quality: "1080p",
|
||||
});
|
||||
}
|
||||
const id720 = $('tr:contains("720p")')
|
||||
.find('button:contains("Info")')
|
||||
.attr("id")
|
||||
?.split("-")[1];
|
||||
if (id720) {
|
||||
idList.push({
|
||||
id: id720,
|
||||
quality: "720p",
|
||||
});
|
||||
}
|
||||
const id480 = $('tr:contains("480p")')
|
||||
.find('button:contains("Info")')
|
||||
.attr("id")
|
||||
?.split("-")[1];
|
||||
if (id480) {
|
||||
idList.push({
|
||||
id: id480,
|
||||
quality: "480p",
|
||||
});
|
||||
}
|
||||
// console.log('idList', idList);
|
||||
const baseUrl = link.split("/").slice(0, 3).join("/");
|
||||
const secondIdList = [];
|
||||
await Promise.all(idList.slice(0, 2).map(async (id) => {
|
||||
const formData = new URLSearchParams();
|
||||
formData.append("downloadid", id.id);
|
||||
formData.append("token", "ok");
|
||||
const messageToken = generateMessageToken(baseUrl);
|
||||
const uid = getOrCreateUID();
|
||||
const idRes = await fetch(`${baseUrl}/ppd.php`, {
|
||||
headers: {
|
||||
accept: "*/*",
|
||||
"accept-language": "en-US,en;q=0.9,en-IN;q=0.8",
|
||||
"cache-control": "no-cache",
|
||||
"content-type": "application/x-www-form-urlencoded",
|
||||
pragma: "no-cache",
|
||||
priority: "u=1, i",
|
||||
"sec-ch-ua": '"Chromium";v="136", "Microsoft Edge";v="136", "Not.A/Brand";v="99"',
|
||||
"sec-ch-ua-mobile": "?0",
|
||||
"sec-ch-ua-platform": '"Windows"',
|
||||
"sec-fetch-dest": "empty",
|
||||
"sec-fetch-mode": "cors",
|
||||
"sec-fetch-site": "same-origin",
|
||||
cookie: "ext_name=ojplmecpdpgccookcobabopnaifgidhf; tgInvite222=true; cf_clearance=3ynJv2B6lHMj3FCOqtfQaL7lTN4KC3xmPRMgcNtddAc-1748787867-1.2.1.1-SEIhLbWR3ehfib5Y3P5pjzj1Qu9wipc52Icv4AmNkztXn2pTXhjKgxXnvTuA2bNscgHuc1juXujAHteqY_vaMmy2C3djMWnJGzjje_XvXZXKht8rwHZt6sviq7KAYvrYZPTrATqENuopzmqmK6dDFS.CAnWHt0VDn8q06iLm5rYj1AXUo3qkV5p1Idx_25elWHYGG8yengBrQV1MYVM9LMdQqv44PXu69FZvNkgv.d6blCKyneJnoLkw4LHAccu.QRPbFwWqqTDyO9YTLRQW9w29bKghD3_JVxkz.qxpg5FbocJ3i6tJJy74SvROpYdpVUOn0fW1YgQ7RxYwhNoHpdTKy8pvmQJGRuSVW1GjO_k",
|
||||
Referer: "https://m3.protonmovies.top/download/",
|
||||
"Referrer-Policy": "strict-origin-when-cross-origin",
|
||||
},
|
||||
body: `downloadid=${id.id}&msg=${messageToken}&uid=${uid}&token=ok`,
|
||||
method: "POST",
|
||||
});
|
||||
const idData = await idRes.text();
|
||||
secondIdList.push({
|
||||
quality: id.quality,
|
||||
id: idData,
|
||||
});
|
||||
console.log("idData", idData);
|
||||
}));
|
||||
await Promise.all(secondIdList.map(async (id) => {
|
||||
const idRes = await axios.post(`${baseUrl}/tmp/${id.id}`);
|
||||
if (idRes.data.ppd["gofile.io"]) {
|
||||
const goRes = await gofileExtracter(idRes.data.ppd["gofile.io"].link.split("/").pop());
|
||||
console.log("link", goRes.link);
|
||||
if (goRes.link) {
|
||||
streamLinks.push({
|
||||
link: goRes.link,
|
||||
server: "gofile " + id.quality,
|
||||
type: "mkv",
|
||||
headers: {
|
||||
referer: "https://gofile.io",
|
||||
connection: "keep-alive",
|
||||
contentType: "video/x-matroska",
|
||||
cookie: "accountToken=" + goRes.token,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}));
|
||||
return streamLinks;
|
||||
}
|
||||
catch (e) {
|
||||
console.log("proton get stream err", e);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
Reference in New Issue
Block a user