mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
1 line
1.6 KiB
JavaScript
1 line
1.6 KiB
JavaScript
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(e,t)=>__defProp(e,"name",{value:t,configurable:!0}),__export=(e,t)=>{for(var o in t)__defProp(e,o,{get:t[o],enumerable:!0})},__copyProps=(e,t,o,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of __getOwnPropNames(t))__hasOwnProp.call(e,s)||s===o||__defProp(e,s,{get:()=>t[s],enumerable:!(r=__getOwnPropDesc(t,s))||r.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__async=(e,t,o)=>new Promise((r,s)=>{var _=e=>{try{p(o.next(e))}catch(e){s(e)}},a=e=>{try{p(o.throw(e))}catch(e){s(e)}},p=e=>e.done?r(e.value):Promise.resolve(e.value).then(_,a);p((o=o.apply(e,t)).next())}),episodes_exports={};__export(episodes_exports,{getEpisodes:()=>getEpisodes});var getEpisodes=__name(function(e){return __async(this,arguments,function*({url:e,providerContext:t}){const{axios:o}=t;try{const[t,r]=e.split("&"),s=r?`https://www.febbox.com/file/file_share_list?share_key=${t}&pwd=&parent_id=${r}&is_html=0`:`https://www.febbox.com/file/file_share_list?share_key=${t}&pwd=&is_html=0`,_=(yield o.get(s)).data.data.file_list,a=[];return null==_||_.map(e=>{const o=formatEpisodeName(e.file_name),r=null==e?void 0:e.fid;!e.is_dir&&o&&r&&a.push({title:o,link:`${t}&${r}`})}),a}catch(e){return[]}})},"getEpisodes");function formatEpisodeName(e){const t=e.match(/[sS](\d+)\s*[eE](\d+)/);return t?`Season${t[1].padStart(2,"0")} Episode${t[2].padStart(2,"0")}`:e}__name(formatEpisodeName,"formatEpisodeName"),exports.getEpisodes=getEpisodes; |