mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
1 line
5.0 KiB
JavaScript
1 line
5.0 KiB
JavaScript
"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{s(r.next(e))}catch(e){o(e)}},i=e=>{try{s(r.throw(e))}catch(e){o(e)}},s=e=>e.done?a(e.value):Promise.resolve(e.value).then(n,i);s((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",Cookie:"popads_user_id=6ba8fe60a481387a3249f05aa058822d","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(function(e){return __async(this,arguments,function*({link:e,type:t,providerContext:r}){var a,o;const{axios:n,cheerio:i}=r;try{const s=__name(function(e){return __async(this,arguments,function*({url:e,providerContext:t}){var r;const{axios:a,cheerio:o}=t;try{e.includes("url=")&&(e=atob(e.split("url=")[1]));const t=(yield a.get(e)).data;let n=o.load(t);if(e.includes("url=")){const t=null==(r=n("meta[http-equiv='refresh']").attr("content"))?void 0:r.split("url=")[1],i=(yield a.get(t||e)).data;n=o.load(i)}const i=[];return n("h3,h4").map((e,t)=>{const r=n(t).text(),a=n(t).find("a").attr("href");a&&"#"!==a&&i.push({title:r.trim()||"No title found",link:a||""})}),n("a.maxbutton").map((e,t)=>{const r=n(t).children("span").text(),a=n(t).attr("href");a&&"#"!==a&&i.push({title:r.trim()||"No title found",link:a||""})}),i}catch(e){return[]}})},"modGetEpisodeLinks");"movie"===t&&(e=(yield s({url:e,providerContext:r}))[0].link||e);let c=yield modExtractor(e,r);const l=(null==(o=null==(a=null==c?void 0:c.data)?void 0:a.match(/content="0;url=(.*?)"/))?void 0:o[1])||e,d=[],p=yield isDriveLink(l),h=(yield n.get(p,{headers:headers})).data,u=i.load(h);try{const e=u(".btn.btn-light").attr("href")||"",t=yield n.get(e,{headers:headers}),r=t.data.match(/formData\.append\('token', '([a-f0-9]+)'\)/)[1],a=new FormData;a.append("token",r);const o=t.data.match(/fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/)[1],i=e.split("/download")[0],s=yield fetch(i+"/download?id="+o,{method:"POST",body:a,headers:{Referer:e,Cookie:"PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308"}}),c=yield s.json();d.push({server:"ResumeBot",link:c.url,type:"mkv"})}catch(e){}try{u(".btn-success").each((e,t)=>{var r;const a=null==(r=t.attribs)?void 0:r.href;a&&d.push({server:"Resume Worker "+(e+1),link:a,type:"mkv"})})}catch(e){}try{const e=p.replace("/file","/wfile")+"?type=1",t=(yield n.get(e,{headers:headers})).data;i.load(t)(".btn-success").each((e,t)=>{var r;const a=null==(r=t.attribs)?void 0:r.href;a&&d.push({server:"Cf Worker 1."+e,link:a,type:"mkv"})})}catch(e){}try{const e=p.replace("/file","/wfile")+"?type=2",t=(yield n.get(e,{headers:headers})).data;i.load(t)(".btn-success").each((e,t)=>{var r;const a=null==(r=t.attribs)?void 0:r.href;a&&d.push({server:"Cf Worker 2."+e,link:a,type:"mkv"})})}catch(e){}try{const e=u(".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,d.push({server:"Gdrive-Instant-2",link:(null==r?void 0:r.split("?url=")[1])||r,type:"mkv"})}catch(e){}return d}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 i=yield fetch(e.split("?")[0],{method:"POST",body:o}),s=yield i.text(),c=a.load(s),l=c("input").attr("name","_wp_http2").val();var n=new FormData;n.append("_wp_http2",l);const d=c("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; |