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:
78
dist/cinemaLuxe/episodes.js
vendored
78
dist/cinemaLuxe/episodes.js
vendored
@@ -1,77 +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.getEpisodes = void 0;
|
||||
const getEpisodes = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) {
|
||||
var _b;
|
||||
try {
|
||||
if (!url.includes("luxelinks") || url.includes("cinemalux")) {
|
||||
const res = yield providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
});
|
||||
const data = res.data;
|
||||
const encodedLink = (_b = data.match(/"link":"([^"]+)"/)) === null || _b === void 0 ? void 0 : _b[1];
|
||||
if (encodedLink) {
|
||||
url = encodedLink ? atob(encodedLink) : url;
|
||||
}
|
||||
else {
|
||||
const redirectUrlRes = yield fetch("https://ext.8man.me/api/cinemaluxe", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({ url }),
|
||||
});
|
||||
const redirectUrl = yield redirectUrlRes.json();
|
||||
url = (redirectUrl === null || redirectUrl === void 0 ? void 0 : redirectUrl.redirectUrl) || url;
|
||||
}
|
||||
}
|
||||
const episodeLinks = [];
|
||||
if (url.includes("luxedrive") || url.includes("drive.linkstore")) {
|
||||
episodeLinks.push({
|
||||
title: "Movie",
|
||||
link: url,
|
||||
});
|
||||
return episodeLinks;
|
||||
}
|
||||
const res = yield providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
});
|
||||
const html = res.data;
|
||||
let $ = providerContext.cheerio.load(html);
|
||||
$("a.maxbutton-4,a.maxbutton,.maxbutton-hubcloud,.ep-simple-button").map((i, element) => {
|
||||
var _a;
|
||||
const title = (_a = $(element).text()) === null || _a === void 0 ? void 0 : _a.trim();
|
||||
const link = $(element).attr("href");
|
||||
if (title &&
|
||||
link &&
|
||||
!title.includes("Batch") &&
|
||||
!title.toLowerCase().includes("zip")) {
|
||||
episodeLinks.push({
|
||||
title: title
|
||||
.replace(/\(\d{4}\)/, "")
|
||||
.replace("Download", "Movie")
|
||||
.replace("⚡", "")
|
||||
.trim(),
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
return episodeLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("cl episode links", err);
|
||||
return [];
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getEpisodes = getEpisodes;
|
||||
"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.getEpisodes=void 0;const getEpisodes=function(_a){return __awaiter(this,arguments,void 0,function*({url:url,providerContext:providerContext}){var _b;try{if(!url.includes("luxelinks")||url.includes("cinemalux")){const res=yield providerContext.axios.get(url,{headers:providerContext.commonHeaders}),encodedLink=null===(_b=res.data.match(/"link":"([^"]+)"/))||void 0===_b?void 0:_b[1];if(encodedLink)url=encodedLink?atob(encodedLink):url;else{const redirectUrlRes=yield fetch("https://ext.8man.me/api/cinemaluxe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:url})}),redirectUrl=yield redirectUrlRes.json();url=(null==redirectUrl?void 0:redirectUrl.redirectUrl)||url}}const episodeLinks=[];if(url.includes("luxedrive")||url.includes("drive.linkstore"))return episodeLinks.push({title:"Movie",link:url}),episodeLinks;const html=(yield providerContext.axios.get(url,{headers:providerContext.commonHeaders})).data;let $=providerContext.cheerio.load(html);return $("a.maxbutton-4,a.maxbutton,.maxbutton-hubcloud,.ep-simple-button").map((i,element)=>{var _a;const title=null===(_a=$(element).text())||void 0===_a?void 0:_a.trim(),link=$(element).attr("href");title&&link&&!title.includes("Batch")&&!title.toLowerCase().includes("zip")&&episodeLinks.push({title:title.replace(/\(\d{4}\)/,"").replace("Download","Movie").replace("⚡","").trim(),link:link})}),episodeLinks}catch(err){return[]}})};exports.getEpisodes=getEpisodes;
|
||||
Reference in New Issue
Block a user