"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value:value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__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}){const{axios:axios,cheerio:cheerio,commonHeaders:headers}=providerContext;console.log("getEpisodeLinks",url);try{let res=yield axios.get(url,{headers:__spreadProps(__spreadValues({},headers),{cookie:"ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=Zl2yiOCN3pzGUd0Bgs.VyBXniJooDbG2Tk1g7DEoRnw-1756381111-1.2.1.1-RVPZoWGCAygGNAHavrVR0YaqASWZlJyYff8A.oQfPB5qbcPrAVud42BzsSwcDgiKAP0gw5D92V3o8XWwLwDRNhyg3DuL1P8wh2K4BCVKxWvcy.iCCxczKtJ8QSUAsAQqsIzRWXk29N6X.kjxuOTYlfB2jrlq12TRDld_zTbsskNcTxaA.XQekUcpGLseYqELuvlNOQU568NZD6LiLn3ICyFThMFAx6mIcgXkxVAvnxU; xla=s4t"})});if(res.data&&res.data.includes("Please turn JavaScript on and reload the page.")){const b1Match=res.data.match(/var b1=atob\(['"]([^'"]+)['"]\)/),a2Match=res.data.match(/_0x2aa8=\[['"]([^'"]+)['"]\]/),c3Match=res.data.match(/c3=toNumbers\(['"]([^'"]+)['"]\)/);if(b1Match&&a2Match&&c3Match){const unescapeHexStr=__name(str=>str.replace(/\\x([0-9A-Fa-f]{2})/g,(_,hex)=>String.fromCharCode(parseInt(hex,16))),"unescapeHexStr"),baseUrl=url.split("/").slice(0,3).join("/"),minJsRes=yield axios.get(`${baseUrl}/min.js`,{headers:headers}),b1Hex=atob(unescapeHexStr(b1Match[1])),a2Hex=atob(unescapeHexStr(a2Match[1])),c3Hex=unescapeHexStr(c3Match[1]),newCookie=`Antiddos-systems-DH=${new Function("c3Hex","a1Hex","b2Hex",`\n          ${minJsRes.data}\n          function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}\n          function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e='',f=0;f<d.length;f++)e+=(16>d[f]?'0':'')+d[f].toString(16);return e.toLowerCase()}\n          return toHex(slowAES.decrypt(toNumbers(c3Hex), 2, toNumbers(a1Hex), toNumbers(b2Hex)));\n        `)(c3Hex,a2Hex,b1Hex)}`;res=yield axios.get(url,{headers:__spreadProps(__spreadValues({},headers),{Cookie:newCookie})})}}const $=cheerio.load(res.data),container=$(".entry-content,.entry-inner, .download-links-div");$(".unili-content,.code-block-1").remove();const episodes=[];return container.find("h3, h4, h5, p").each((index,element)=>{const el=$(element),title=el.text().trim(),link=el.nextAll().find("a").first().attr("href");if(title&&link&&title.match(/Episode|Ep|E\d+/i)&&title.length<150){const cleanedTitle=title.replace(/[-:]/g,"").trim();episodes.some(e=>e.link===link)||episodes.push({title:cleanedTitle,link:link})}}),0===episodes.length&&$("a").each((i,el)=>{const href=$(el).attr("href");if(href&&(href.includes("mdrive")||href.includes("fastdl")||href.includes("filebee")||href.includes("gdflix"))){const title=$(el).parent().prev().text().trim()||$(el).text().trim()||`Episode ${i+1}`;episodes.some(e=>e.link===href)||episodes.push({title:title.replace(/[-:]/g,"").trim(),link:href})}}),episodes}catch(err){return console.log("getEpisodeLinks error: "),[]}})},"getEpisodes");exports.getEpisodes=getEpisodes;