"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),episodes_exports={};__export(episodes_exports,{getEpisodes:()=>getEpisodes});var getEpisodes=__name(function(_0){return __async(this,arguments,function*({url:url,providerContext:providerContext}){var _a;try{const{axios:axios,cheerio:cheerio}=providerContext,html=(yield axios.get(url)).data;let $=cheerio.load(html);const episodeLinks=[];if($('a:contains("HubCloud")').map((i,element)=>{const title=$(element).parent().prev().text(),link=$(element).attr("href");link&&(title.includes("Ep")||title.includes("Download"))&&episodeLinks.push({title:title.includes("Download")?"Play":title,link:link})}),0===episodeLinks.length){const streamingServices=["hubcloud","gdflix"];let currentTitle="";$('h5 span[style*="color"], h5').each((i,element)=>{const text=$(element).text().trim();if(text&&(text.match(/\d{3,4}p/)||text.includes("Ep")||text.includes("Episode"))){currentTitle=text;let nextElement=$(element).parent();for(let j=0;j<10&&(nextElement=nextElement.next(),nextElement.length);j++)nextElement.find("a[href]").each((k,linkEl)=>{const href=$(linkEl).attr("href");if(href&&streamingServices.some(service=>href.includes(service))){let serverName="Play";href.includes("hubcloud")?serverName="HubCloud":href.includes("gdflix")?serverName="GDFlix":href.includes("pixeldrain")?serverName="Pixeldrain":href.includes("fastdl")&&(serverName="FastDL");const title=currentTitle?`${currentTitle} - ${serverName}`:serverName;episodeLinks.push({title:title,link:href})}})}})}if(0===episodeLinks.length){const hubcloudLink=null==(_a=html.match(/https:\/\/hubcloud\.[^\/]+\/drive\/[^"'\s]+/i))?void 0:_a[0];hubcloudLink&&episodeLinks.push({title:"Play",link:hubcloudLink})}return console.log("episodeLinks:",episodeLinks),episodeLinks.length>0?episodeLinks:[{title:"Play",link:url}]}catch(err){return console.error(err),[{title:"Server 1",link:url}]}})},"getEpisodes");exports.getEpisodes=getEpisodes;