Files
vega-providers/dist/cinemaLuxe/episodes.js
himanshu8443 13f71510d5 minify
2025-07-11 19:17:23 +05:30

1 line
1.5 KiB
JavaScript

"use strict";var __awaiter=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(a,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getEpisodes=void 0;const getEpisodes=function(e){return __awaiter(this,arguments,void 0,function*({url:e,providerContext:t}){var i;try{if(!e.includes("luxelinks")||e.includes("cinemalux")){const n=yield t.axios.get(e,{headers:t.commonHeaders}),o=null===(i=n.data.match(/"link":"([^"]+)"/))||void 0===i?void 0:i[1];if(o)e=o?atob(o):e;else{const t=yield fetch("https://ext.8man.me/api/cinemaluxe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})}),i=yield t.json();e=(null==i?void 0:i.redirectUrl)||e}}const n=[];if(e.includes("luxedrive")||e.includes("drive.linkstore"))return n.push({title:"Movie",link:e}),n;const o=(yield t.axios.get(e,{headers:t.commonHeaders})).data;let r=t.cheerio.load(o);return r("a.maxbutton-4,a.maxbutton,.maxbutton-hubcloud,.ep-simple-button").map((e,t)=>{var i;const o=null===(i=r(t).text())||void 0===i?void 0:i.trim(),a=r(t).attr("href");o&&a&&!o.includes("Batch")&&!o.toLowerCase().includes("zip")&&n.push({title:o.replace(/\(\d{4}\)/,"").replace("Download","Movie").replace("⚡","").trim(),link:a})}),n}catch(e){return[]}})};exports.getEpisodes=getEpisodes;