"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 r in t)__defProp(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of __getOwnPropNames(t))__hasOwnProp.call(e,o)||o===r||__defProp(e,o,{get:()=>t[o],enumerable:!(a=__getOwnPropDesc(t,o))||a.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__async=(e,t,r)=>new Promise((a,o)=>{var n=e=>{try{c(r.next(e))}catch(e){o(e)}},s=e=>{try{c(r.throw(e))}catch(e){o(e)}},c=e=>e.done?a(e.value):Promise.resolve(e.value).then(n,s);c((r=r.apply(e,t)).next())}),stream_exports={};__export(stream_exports,{getStream:()=>getStream});var headers={Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7","Cache-Control":"no-store","Accept-Language":"en-US,en;q=0.9",DNT:"1","sec-ch-ua":'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Sec-Fetch-Site":"none","Sec-Fetch-User":"?1","Upgrade-Insecure-Requests":"1","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0"},getStream=__name(e=>__async(null,[e],function*({link:e,providerContext:t}){var r,a;try{const{axios:o,cheerio:n}=t;let s=yield modExtractor(e,t);const c=(null==(a=null==(r=null==s?void 0:s.data)?void 0:r.match(/content="0;url=(.*?)"/))?void 0:a[1])||e,i=yield isDriveLink(c),l=[],d=(yield o.get(i,{headers:headers})).data,p=n.load(d);try{const e=p(".btn-danger").attr("href")||"",t=e.split("=")[1],r=new FormData;r.append("keys",t);const a=e.split("/").slice(0,3).join("/")+"/api",o=yield fetch(a,{method:"POST",body:r,headers:{"x-token":a}}),n=yield o.json();if(!1===n.error){const e=n.url;l.push({server:"Gdrive-Instant",link:e,type:"mkv"})}}catch(e){}try{const e=p(".btn-danger").attr("href")||"",t=yield fetch(e,{method:"HEAD",headers:headers,redirect:"manual"});let r=e;r=t.status>=300&&t.status<400?t.headers.get("location")||e:t.url&&t.url!==e?t.url||t.url:t.headers.get("location")||e,l.push({server:"Gdrive-Instant-2",link:(null==r?void 0:r.split("?url=")[1])||r,type:"mkv"})}catch(e){}try{const e=i.replace("/file","/zfile"),t=(yield o.get(e,{headers:headers})).data,r=n.load(t)(".btn-success").attr("href");r&&l.push({server:"ResumeCloud",link:r,type:"mkv"})}catch(e){}try{p(".btn-success").each((e,t)=>{var r;const a=null==(r=t.attribs)?void 0:r.href;a&&l.push({server:"Resume Worker "+(e+1),link:a,type:"mkv"})})}catch(e){}try{const e=i.replace("/file","/wfile")+"?type=1",t=(yield o.get(e,{headers:headers})).data;n.load(t)(".btn-success").each((e,t)=>{var r;const a=null==(r=t.attribs)?void 0:r.href;a&&l.push({server:"Cf Worker 1."+e,link:a,type:"mkv"})})}catch(e){}try{const e=i.replace("/file","/wfile")+"?type=2",t=(yield o.get(e,{headers:headers})).data;n.load(t)(".btn-success").each((e,t)=>{var r;const a=null==(r=t.attribs)?void 0:r.href;a&&l.push({server:"Cf Worker 2."+e,link:a,type:"mkv"})})}catch(e){}return l}catch(e){return[]}}),"getStream"),isDriveLink=__name(e=>__async(null,null,function*(){if(e.includes("drive")){const t=yield fetch(e),r=(yield t.text()).match(/window\.location\.replace\("([^"]+)"\)/),a=null==r?void 0:r[1];return`https://${e.split("/")[2]}${a}`}return e}),"isDriveLink");function modExtractor(e,t){return __async(this,null,function*(){const{axios:r,cheerio:a}=t;try{const t=e.split("sid=")[1];var o=new FormData;o.append("_wp_http",t);const s=yield fetch(e.split("?")[0],{method:"POST",body:o}),c=yield s.text(),i=a.load(c),l=i("input").attr("name","_wp_http2").val();var n=new FormData;n.append("_wp_http2",l);const d=i("form").attr("action")||e.split("?")[0],p=yield fetch(d,{method:"POST",body:n}),h=(yield p.text()).match(/setAttribute\("href",\s*"(.*?)"/)[1],u=h.split("=")[1];return yield r.get(h,{headers:{Referer:d,Cookie:`${u}=${l}`}})}catch(e){}})}__name(modExtractor,"modExtractor"),exports.getStream=getStream;