mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
build
This commit is contained in:
64
dist/cinemaLuxe/episodes.js
vendored
64
dist/cinemaLuxe/episodes.js
vendored
@@ -1,64 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getEpisodes = void 0;
|
||||
const getEpisodes = async function ({ url, providerContext, }) {
|
||||
try {
|
||||
if (!url.includes("luxelinks") || url.includes("luxecinema")) {
|
||||
const res = await providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
});
|
||||
const data = res.data;
|
||||
const encodedLink = data.match(/"link":"([^"]+)"/)?.[1];
|
||||
if (encodedLink) {
|
||||
url = encodedLink ? atob(encodedLink) : url;
|
||||
}
|
||||
else {
|
||||
const redirectUrlRes = await fetch("https://ext.8man.me/api/cinemaluxe", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({ url }),
|
||||
});
|
||||
const redirectUrl = await redirectUrlRes.json();
|
||||
url = redirectUrl?.redirectUrl || url;
|
||||
}
|
||||
}
|
||||
const res = await providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
});
|
||||
const html = res.data;
|
||||
let $ = providerContext.cheerio.load(html);
|
||||
const episodeLinks = [];
|
||||
if (url.includes("luxedrive")) {
|
||||
episodeLinks.push({
|
||||
title: "Movie",
|
||||
link: url,
|
||||
});
|
||||
return episodeLinks;
|
||||
}
|
||||
$("a.maxbutton-4,a.maxbutton,.maxbutton-hubcloud,.ep-simple-button").map((i, element) => {
|
||||
const title = $(element).text()?.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;
|
||||
Reference in New Issue
Block a user