fix: correct conditional check for cinemalux in getEpisodes function

This commit is contained in:
himanshu8443
2025-07-09 23:21:03 +05:30
parent 1db1a239ec
commit 90fd314d82
2 changed files with 16 additions and 14 deletions

View File

@@ -14,7 +14,7 @@ const getEpisodes = function (_a) {
return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) { return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) {
var _b; var _b;
try { try {
if (!url.includes("luxelinks") || url.includes("luxecinema")) { if (!url.includes("luxelinks") || url.includes("cinemalux")) {
const res = yield providerContext.axios.get(url, { const res = yield providerContext.axios.get(url, {
headers: providerContext.commonHeaders, headers: providerContext.commonHeaders,
}); });
@@ -35,19 +35,19 @@ const getEpisodes = function (_a) {
url = (redirectUrl === null || redirectUrl === void 0 ? void 0 : redirectUrl.redirectUrl) || url; url = (redirectUrl === null || redirectUrl === void 0 ? void 0 : redirectUrl.redirectUrl) || url;
} }
} }
const res = yield providerContext.axios.get(url, {
headers: providerContext.commonHeaders,
});
const html = res.data;
let $ = providerContext.cheerio.load(html);
const episodeLinks = []; const episodeLinks = [];
if (url.includes("luxedrive")) { if (url.includes("luxedrive") || url.includes("drive.linkstore")) {
episodeLinks.push({ episodeLinks.push({
title: "Movie", title: "Movie",
link: url, link: url,
}); });
return episodeLinks; 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) => { $("a.maxbutton-4,a.maxbutton,.maxbutton-hubcloud,.ep-simple-button").map((i, element) => {
var _a; var _a;
const title = (_a = $(element).text()) === null || _a === void 0 ? void 0 : _a.trim(); const title = (_a = $(element).text()) === null || _a === void 0 ? void 0 : _a.trim();

View File

@@ -8,7 +8,7 @@ export const getEpisodes = async function ({
providerContext: ProviderContext; providerContext: ProviderContext;
}): Promise<EpisodeLink[]> { }): Promise<EpisodeLink[]> {
try { try {
if (!url.includes("luxelinks") || url.includes("luxecinema")) { if (!url.includes("luxelinks") || url.includes("cinemalux")) {
const res = await providerContext.axios.get(url, { const res = await providerContext.axios.get(url, {
headers: providerContext.commonHeaders, headers: providerContext.commonHeaders,
}); });
@@ -31,19 +31,21 @@ export const getEpisodes = async function ({
url = redirectUrl?.redirectUrl || url; 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: EpisodeLink[] = []; const episodeLinks: EpisodeLink[] = [];
if (url.includes("luxedrive")) {
if (url.includes("luxedrive") || url.includes("drive.linkstore")) {
episodeLinks.push({ episodeLinks.push({
title: "Movie", title: "Movie",
link: url, link: url,
}); });
return episodeLinks; return episodeLinks;
} }
const res = await 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( $("a.maxbutton-4,a.maxbutton,.maxbutton-hubcloud,.ep-simple-button").map(
(i, element) => { (i, element) => {
const title = $(element).text()?.trim(); const title = $(element).text()?.trim();