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

1 line
1.1 KiB
JavaScript

"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(s,o){function r(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(r,a)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getEpisodes=void 0;const getEpisodes=function(t){return __awaiter(this,arguments,void 0,function*({url:t,providerContext:e}){const{axios:i}=e;try{const[e,n]=t.split("&"),s=n?`https://www.febbox.com/file/file_share_list?share_key=${e}&pwd=&parent_id=${n}&is_html=0`:`https://www.febbox.com/file/file_share_list?share_key=${e}&pwd=&is_html=0`,o=yield i.get(s),r=o.data.data.file_list,a=[];return null==r||r.map(t=>{const i=formatEpisodeName(t.file_name),n=null==t?void 0:t.fid;!t.is_dir&&i&&n&&a.push({title:i,link:`${e}&${n}`})}),a}catch(t){return[]}})};function formatEpisodeName(t){const e=t.match(/[sS](\d+)\s*[eE](\d+)/);if(e){return`Season${e[1].padStart(2,"0")} Episode${e[2].padStart(2,"0")}`}return t}exports.getEpisodes=getEpisodes;