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,o)=>__defProp(e,"name",{value:o,configurable:!0}),__export=(e,o)=>{for(var t in o)__defProp(e,t,{get:o[t],enumerable:!0})},__copyProps=(e,o,t,r)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let n of __getOwnPropNames(o))__hasOwnProp.call(e,n)||n===t||__defProp(e,n,{get:()=>o[n],enumerable:!(r=__getOwnPropDesc(o,n))||r.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__async=(e,o,t)=>new Promise((r,n)=>{var s=e=>{try{i(t.next(e))}catch(e){n(e)}},p=e=>{try{i(t.throw(e))}catch(e){n(e)}},i=e=>e.done?r(e.value):Promise.resolve(e.value).then(s,p);i((t=t.apply(e,o)).next())}),episodes_exports={};__export(episodes_exports,{getEpisodes:()=>getEpisodes});var getEpisodes=__name(function(e){return __async(this,arguments,function*({url:e,providerContext:o}){var t;const{axios:r,cheerio:n}=o;try{const o=[],r=yield fetch("https://dob-worker.8man.workers.dev",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e,method:"GET"})}),n=yield r.json();return((null==(t=null==n?void 0:n.data)?void 0:t.list)||[]).forEach(e=>{const t=(null==e?void 0:e.ep)?`S-${null==e?void 0:e.se} E-${null==e?void 0:e.ep}`:(null==e?void 0:e.title)||"",r=(null==e?void 0:e.resourceLink)||"";r&&o.push({title:t.trim(),link:JSON.stringify({url:r,title:t.trim()})})}),o}catch(e){return[]}})},"getEpisodes");exports.getEpisodes=getEpisodes; |