mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-18 08:01:43 +00:00
1 line
5.3 KiB
JavaScript
1 line
5.3 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 l in t)__defProp(e,l,{get:t[l],enumerable:!0})},__copyProps=(e,t,l,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of __getOwnPropNames(t))__hasOwnProp.call(e,n)||n===l||__defProp(e,n,{get:()=>t[n],enumerable:!(o=__getOwnPropDesc(t,n))||o.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__async=(e,t,l)=>new Promise((o,n)=>{var a=e=>{try{i(l.next(e))}catch(e){n(e)}},r=e=>{try{i(l.throw(e))}catch(e){n(e)}},i=e=>e.done?o(e.value):Promise.resolve(e.value).then(a,r);i((l=l.apply(e,t)).next())}),stream_exports={};__export(stream_exports,{getStream:()=>getStream});var hubcloudDecode=__name(function(e){return void 0===e?"":atob(e.toString())},"hubcloudDecode");function hubcloudExtractor(e,t,l,o,n){return __async(this,null,function*(){var a,r,i,s,c,d;try{n.Cookie="ext_name=ojplmecpdpgccookcobabopnaifgidhf; xla=s4t; cf_clearance=woQrFGXtLfmEMBEiGUsVHrUBMT8s3cmguIzmMjmvpkg-1770053679-1.2.1.1-xBrQdciOJsweUF6F2T_OtH6jmyanN_TduQ0yslc_XqjU6RcHSxI7.YOKv6ry7oYo64868HYoULnVyww536H2eVI3R2e4wKzsky6abjPdfQPxqpUaXjxfJ02o6jl3_Vkwr4uiaU7Wy596Vdst3y78HXvVmKdIohhtPvp.vZ9_L7wvWdce0GRixjh_6JiqWmWMws46hwEt3hboaS1e1e4EoWCvj5b0M_jVwvSxBOAW5emFzvT3QrnRh4nyYmKDERnY";const u=e.split("/").slice(0,3).join("/"),p=[],h=(yield l(`${e}`,{headers:n,signal:t})).data,v=o.load(h),m=h.match(/var\s+url\s*=\s*'([^']+)';/)||[];let f=hubcloudDecode(null==(r=null==(a=m[1])?void 0:a.split("r="))?void 0:r[1])||m[1]||v(".fa-file-download.fa-lg").parent().attr("href")||e;(null==f?void 0:f.startsWith("/"))&&(f=`${u}${f}`);const _=yield fetch(f,{headers:n,signal:t,redirect:"follow"}),g=o.load(yield _.text()),y=g(".btn-success.btn-lg.h6,.btn-danger,.btn-secondary");for(const e of y){let l=g(e).attr("href")||"";switch(!0){case null==l?void 0:l.includes("pixeld"):if(!(null==l?void 0:l.includes("api"))){const e=l.split("/").pop(),t=l.split("/").slice(0,-2).join("/");l=`${t}/api/file/${e}?download`}p.push({server:"Pixeldrain",link:l,type:"mkv"});break;case(null==l?void 0:l.includes(".dev"))&&!(null==l?void 0:l.includes("/?id=")):p.push({server:"Cf Worker",link:l,type:"mkv"});break;case(null==l?void 0:l.includes("hubcloud"))||(null==l?void 0:l.includes("/?id=")):try{const e=yield fetch(l,{method:"HEAD",headers:n,signal:t,redirect:"manual"});let o=l;if(o=e.status>=300&&e.status<400?e.headers.get("location")||l:e.url&&e.url!==l?e.url:e.headers.get("location")||l,o.includes("googleusercontent"))o=o.split("?link=")[1];else{const e=yield fetch(o,{method:"HEAD",headers:n,signal:t,redirect:"manual"});o=e.status>=300&&e.status<400?(null==(i=e.headers.get("location"))?void 0:i.split("?link=")[1])||o:e.url&&e.url!==o?e.url.split("?link=")[1]||e.url:(null==(s=e.headers.get("location"))?void 0:s.split("?link=")[1])||o}p.push({server:"hubcloud",link:o,type:"mkv"})}catch(e){}break;case null==l?void 0:l.includes("cloudflarestorage"):p.push({server:"CfStorage",link:l,type:"mkv"});break;case(null==l?void 0:l.includes("fastdl"))||(null==l?void 0:l.includes("fsl.")):p.push({server:"FastDl",link:l,type:"mkv"});break;case l.includes("hubcdn")&&!l.includes("/?id="):p.push({server:"HubCdn",link:l,type:"mkv"});break;default:if((null==l?void 0:l.includes(".mkv"))||(null==l?void 0:l.includes("?token="))){const e=(null==(d=null==(c=l.match(/^(?:https?:\/\/)?(?:www\.)?([^\/]+)/i))?void 0:c[1])?void 0:d.replace(/\./g," "))||"Unknown";p.push({server:e,link:l,type:"mkv"})}}}return p}catch(e){return[]}})}__name(hubcloudExtractor,"hubcloudExtractor");var headers={accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7","accept-language":"en-US,en;q=0.9,en-IN;q=0.8","cache-control":"no-cache",pragma:"no-cache",priority:"u=0, i","sec-ch-ua":'"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',"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"};function getStream(e){return __async(this,arguments,function*({link:e,type:t,signal:l,providerContext:o}){var n,a,r,i;const{axios:s,cheerio:c,commonHeaders:d}=o;try{const o=[];if("movie"===t){const t=yield fetch(`${e}`,{headers:headers}),l=yield t.text();e=(l.match(/<a\s+href="([^"]*cloud\.[^"]*)"/i)||[])[1];try{const e=c.load(l)('.btn.btn-sm.btn-outline[style="background:linear-gradient(135deg,rgb(252,185,0) 0%,rgb(0,0,0)); color: #fdf8f2;"]').parent().attr("href"),t=null==e?void 0:e.split("/").pop(),d=null==e?void 0:e.split("/").slice(0,-2).join("/"),u=yield s.post(d+"/api/file/downlaod/",{id:t,method:"indexDownlaod",captchaValue:null},{headers:{"Content-Type":"application/json",Referer:d}});if(null==(n=u.data)?void 0:n.status){const e=null==(a=u.data)?void 0:a.data,t=yield s.post(d+"/api/file/downlaod2/",{id:e,method:"indexDownlaod",captchaValue:null},{headers:{"Content-Type":"application/json",Referer:d}});o.push({server:"filepress",link:null==(i=null==(r=t.data)?void 0:r.data)?void 0:i[0],type:"mkv"})}}catch(e){}}return yield hubcloudExtractor(e,l,s,c,d)}catch(e){return e.message.includes("Aborted"),[]}})}__name(getStream,"getStream"),exports.getStream=getStream; |