mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
unminify
This commit is contained in:
23
dist/protonMovies/catalog.js
vendored
23
dist/protonMovies/catalog.js
vendored
@@ -1 +1,22 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),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=[];
|
||||
"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 = [];
|
||||
|
||||
103
dist/protonMovies/meta.js
vendored
103
dist/protonMovies/meta.js
vendored
@@ -1 +1,102 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(o,l){function r(e){try{a(n.next(e))}catch(e){l(e)}}function s(e){try{a(n.throw(e))}catch(e){l(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,s)}a((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const getMeta=function(e){return __awaiter(this,arguments,void 0,function*({link:e,providerContext:t}){var i,n,o,l,r;try{const{axios:s,cheerio:a,getBaseUrl:c}=t,d=yield c("protonMovies"),p=(yield s.get(`${d}${e}`)).data;const u=null===(r=null===(l=null===(o=null===(n=null===(i=a.load(p)('script:contains("decodeURIComponent")').text().split(" = "))||void 0===i?void 0:i[1])||void 0===n?void 0:n.split("protomovies"))||void 0===o?void 0:o[0])||void 0===l?void 0:l.trim())||void 0===r?void 0:r.slice(0,-1),v=JSON.parse(u).join("").replace(/\\"/g,'"').replace(/\\'/g,"'").replace(/\\n/g,"\n").replace(/\\t/g,"\t").replace(/\\r/g,"\r").replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&"),f=a.load(v),m=f(".trending-text.fw-bold.texture-text.text-uppercase.my-0.fadeInLeft.animated.d-inline-block").text(),g=f("#thumbnail").attr("src"),x=e.includes("series")?"series":"movie",h=f(".col-12.iq-mb-30.animated.fadeIn").first().text()||f(".description-content").text(),y=f(".p-0.mt-2.list-inline.d-flex.flex-wrap.movie-tag").find("li").map((e,t)=>f(t).text()).slice(0,3).get(),b=[];if("movie"===x){const t=[];t.push({title:"Movie",link:d+e}),b.push({title:"Movie",directLinks:t})}else f("#episodes").children().map((e,t)=>{let i=[];f(t).find(".episode-block").map((e,t)=>{const n=d+f(t).find("a").attr("href")||"",o="Episode "+f(t).find(".episode-number").text().split("E")[1];i.push({title:o,link:n})}),b.push({title:"Season "+(e+1),directLinks:i})});return{image:g||"",imdbId:"",linkList:b,title:m||"",synopsis:h,tags:y,type:x}}catch(e){return{title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]}}})};exports.getMeta=getMeta;
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const getMeta = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) {
|
||||
var _b, _c, _d, _e, _f;
|
||||
try {
|
||||
const { axios, cheerio, getBaseUrl } = providerContext;
|
||||
const baseUrl = yield getBaseUrl("protonMovies");
|
||||
console.log("all", link);
|
||||
const res = yield axios.get(`${baseUrl}${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 = (_f = (_e = (_d = (_c = (_b = $$('script:contains("decodeURIComponent")')
|
||||
.text()
|
||||
.split(" = ")) === null || _b === void 0 ? void 0 : _b[1]) === null || _c === void 0 ? void 0 : _c.split("protomovies")) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.trim()) === null || _f === void 0 ? void 0 : _f.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 links = [];
|
||||
if (type === "movie") {
|
||||
const directLinks = [];
|
||||
directLinks.push({ title: "Movie", link: baseUrl + 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;
|
||||
|
||||
86
dist/protonMovies/posts.js
vendored
86
dist/protonMovies/posts.js
vendored
@@ -1 +1,85 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,r,a){return new(r||(r=Promise))(function(s,o){function n(e){try{c(a.next(e))}catch(e){o(e)}}function i(e){try{c(a.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(n,i)}c((a=a.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSearchPosts=exports.getPosts=void 0;const getPosts=function(e){return __awaiter(this,arguments,void 0,function*({filter:e,page:t,signal:r,providerContext:a}){const{getBaseUrl:s,axios:o,cheerio:n}=a,i=yield s("protonMovies");return posts({url:`${i+e}/page/${t}/`,baseUrl:i,signal:r,axios:o,cheerio:n})})};exports.getPosts=getPosts;const getSearchPosts=function(e){return __awaiter(this,arguments,void 0,function*({searchQuery:e,page:t,signal:r,providerContext:a}){const{getBaseUrl:s,axios:o,cheerio:n}=a,i=yield s("protonMovies");return posts({url:`${i}/search/${e}/page/${t}/`,baseUrl:i,signal:r,axios:o,cheerio:n})})};function posts(e){return __awaiter(this,arguments,void 0,function*({url:e,baseUrl:t,signal:r,axios:a,cheerio:s}){try{const o=(yield a.get(e,{headers:{referer:t},signal:r})).data,n=/\[(?=.*?"<div class")(.*?)\]/g,i=null==o?void 0:o.match(n),c=JSON.parse(i[i.length-1]).join("").replace(/\\"/g,'"').replace(/\\'/g,"'").replace(/\\n/g,"\n").replace(/\\t/g,"\t").replace(/\\r/g,"\r").replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&"),l=s.load(c),g=[];return l(".col.mb-4").map((e,t)=>{const r=l(t).find("h5").text(),a=l(t).find("h5").find("a").attr("href"),s=l(t).find("img").attr("data-src")||l(t).find("img").attr("src")||"";r&&a&&s&&g.push({title:r,link:a,image:s})}),g}catch(e){return[]}})}exports.getSearchPosts=getSearchPosts;
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ filter, page, signal, providerContext, }) {
|
||||
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||
const baseUrl = yield getBaseUrl("protonMovies");
|
||||
const url = `${baseUrl + filter}/page/${page}/`;
|
||||
return posts({ url, baseUrl, signal, axios, cheerio });
|
||||
});
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) {
|
||||
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||
const baseUrl = yield getBaseUrl("protonMovies");
|
||||
const url = `${baseUrl}/search/${searchQuery}/page/${page}/`;
|
||||
return posts({ url, baseUrl, signal, axios, cheerio });
|
||||
});
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
function posts(_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ url, baseUrl, signal, axios, cheerio, }) {
|
||||
try {
|
||||
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 res = yield axios.get(url, {
|
||||
headers: {
|
||||
referer: baseUrl,
|
||||
},
|
||||
signal,
|
||||
});
|
||||
const data = res.data;
|
||||
const regex = /\[(?=.*?"<div class")(.*?)\]/g;
|
||||
const htmlArray = data === null || data === void 0 ? void 0 : 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 [];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
172
dist/protonMovies/stream.js
vendored
172
dist/protonMovies/stream.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user