"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())}),stream_exports={};__export(stream_exports,{getStream:()=>getStream});var getStream=__name(function(_0){return __async(this,arguments,function*({link:url,type:type,providerContext:providerContext}){var _a,_b,_c,_d,_e,_f;const{axios:axios,cheerio:cheerio}=providerContext;try{console.log("pwGetStream",type,url);const baseUrl=url.split("/").slice(0,3).join("/"),streamLinks=[],urls=[],data=(yield axios.get(url)).data,$=cheerio.load(data);$('tr:contains("mixdrop")').map((i,element)=>{const id=$(element).find(".wp-menu-btn").attr("data-wp-menu"),size=$(element).find(".wp-menu-btn").next().text();id&&urls.push({id:baseUrl+"/links/go/"+id,size:size})}),console.log("urls",urls);for(const url2 of urls){const res2=yield axios.head(url2.id),location=null==(_a=res2.request)?void 0:_a.responseURL.replace("/f/","/e/"),res3=yield fetch(location,{credentials:"include",headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0",Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8","Accept-Language":"en-US,en;q=0.5","Upgrade-Insecure-Requests":"1","Sec-Fetch-Dest":"iframe","Sec-Fetch-Mode":"navigate","Sec-Fetch-Site":"same-origin",Pragma:"no-cache","Cache-Control":"no-cache",referer:null==(_b=res2.request)?void 0:_b.responseURL},referrer:null==(_c=res2.request)?void 0:_c.responseURL,method:"GET",mode:"cors"}),data3=yield res3.text();var match=/eval\(function\((.*?)\)\{.*?return p\}.*?\('(.*?)'\.split/.exec(data3);let p="";if(match){var encodedString=match[2];console.log("Encoded String:",encodedString);const base=Number(encodedString.split(",'|MDCore|")[0].split(",")[encodedString.split(",'|MDCore|")[0].split(",").length-1]);console.log("Base:",base),p=null==(_d=encodedString.split(`',${base},`))?void 0:_d[0].trim();let a=base,c=encodedString.split(`',${base},`)[1].slice(2).split("|").length,k=encodedString.split(`',${base},`)[1].slice(2).split("|");const wurl=null==(_e=__name(function(p2,a2,c2,k2,e,d){if(e=__name(function(c3){return c3.toString(36)},"e"),!"".replace(/^/,String)){for(;c2--;)d[c2.toString(a2)]=k2[c2]||c2.toString(a2);k2=[function(e2){return d[e2]}],e=__name(function(){return"\\w+"},"e"),c2=1}for(;c2--;)k2[c2]&&(p2=p2.replace(new RegExp("\\b"+e(c2)+"\\b","g"),k2[c2]));return p2},"decode")(p,a,c,k,0,{}).match(/MDCore\.wurl="([^"]+)"/))?void 0:_e[1];console.log("wurl:",wurl);const streamUrl="https:"+wurl;console.log("streamUrl:",streamUrl),streamLinks.push({server:"Mixdrop "+url2.size,link:streamUrl,type:"mp4",headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0",Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8","Accept-Language":"en-US,en;q=0.5","Upgrade-Insecure-Requests":"1","Sec-Fetch-Dest":"iframe","Sec-Fetch-Mode":"navigate","Sec-Fetch-Site":"same-origin",Pragma:"no-cache","Cache-Control":"no-cache",referer:null==(_f=res2.request)?void 0:_f.responseURL}})}else console.log("No match found")}return streamLinks}catch(err){return console.error(err),[]}})},"getStream");exports.getStream=getStream;