mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
minify again
This commit is contained in:
23
dist/protonMovies/catalog.js
vendored
23
dist/protonMovies/catalog.js
vendored
@@ -1,22 +1 @@
|
||||
"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 = [];
|
||||
"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=[];
|
||||
103
dist/protonMovies/meta.js
vendored
103
dist/protonMovies/meta.js
vendored
@@ -1,102 +1 @@
|
||||
"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;
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){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){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const getMeta=function(_a){return __awaiter(this,arguments,void 0,function*({link:link,providerContext:providerContext}){var _b,_c,_d,_e,_f;try{const{axios:axios,cheerio:cheerio,getBaseUrl:getBaseUrl}=providerContext,baseUrl=yield getBaseUrl("protonMovies"),data=(yield axios.get(`${baseUrl}${link}`)).data;const htmlArray=null===(_f=null===(_e=null===(_d=null===(_c=null===(_b=cheerio.load(data)('script:contains("decodeURIComponent")').text().split(" = "))||void 0===_b?void 0:_b[1])||void 0===_c?void 0:_c.split("protomovies"))||void 0===_d?void 0:_d[0])||void 0===_e?void 0:_e.trim())||void 0===_f?void 0:_f.slice(0,-1),html=JSON.parse(htmlArray).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,"&"),$=cheerio.load(html),title=$(".trending-text.fw-bold.texture-text.text-uppercase.my-0.fadeInLeft.animated.d-inline-block").text(),image=$("#thumbnail").attr("src"),type=link.includes("series")?"series":"movie",synopsis=$(".col-12.iq-mb-30.animated.fadeIn").first().text()||$(".description-content").text(),tags=$(".p-0.mt-2.list-inline.d-flex.flex-wrap.movie-tag").find("li").map((i,el)=>$(el).text()).slice(0,3).get(),links=[];if("movie"===type){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")||"",title="Episode "+$(ep).find(".episode-number").text().split("E")[1];directLinks.push({title:title,link: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){return{title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]}}})};exports.getMeta=getMeta;
|
||||
86
dist/protonMovies/posts.js
vendored
86
dist/protonMovies/posts.js
vendored
@@ -1,85 +1 @@
|
||||
"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 [];
|
||||
}
|
||||
});
|
||||
}
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){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){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSearchPosts=exports.getPosts=void 0;const getPosts=function(_a){return __awaiter(this,arguments,void 0,function*({filter:filter,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl,axios:axios,cheerio:cheerio}=providerContext,baseUrl=yield getBaseUrl("protonMovies");return posts({url:`${baseUrl+filter}/page/${page}/`,baseUrl:baseUrl,signal:signal,axios:axios,cheerio:cheerio})})};exports.getPosts=getPosts;const getSearchPosts=function(_a){return __awaiter(this,arguments,void 0,function*({searchQuery:searchQuery,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl,axios:axios,cheerio:cheerio}=providerContext,baseUrl=yield getBaseUrl("protonMovies");return posts({url:`${baseUrl}/search/${searchQuery}/page/${page}/`,baseUrl:baseUrl,signal:signal,axios:axios,cheerio:cheerio})})};function posts(_a){return __awaiter(this,arguments,void 0,function*({url:url,baseUrl:baseUrl,signal:signal,axios:axios,cheerio:cheerio}){try{const data=(yield axios.get(url,{headers:{referer:baseUrl},signal:signal})).data,regex=/\[(?=.*?"<div class")(.*?)\]/g,htmlArray=null==data?void 0:data.match(regex),html=JSON.parse(htmlArray[htmlArray.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,"&"),$=cheerio.load(html),catalog=[];return $(".col.mb-4").map((i,element)=>{const title=$(element).find("h5").text(),link=$(element).find("h5").find("a").attr("href"),image=$(element).find("img").attr("data-src")||$(element).find("img").attr("src")||"";title&&link&&image&&catalog.push({title:title,link:link,image:image})}),catalog}catch(err){return[]}})}exports.getSearchPosts=getSearchPosts;
|
||||
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