Files
vega-providers/dist/drive/stream.js
himanshu8443 13f71510d5 minify
2025-07-11 19:17:23 +05:30

1 line
1.3 KiB
JavaScript

"use strict";var __awaiter=this&&this.__awaiter||function(t,e,r,a){return new(r||(r=Promise))(function(o,n){function i(t){try{s(a.next(t))}catch(t){n(t)}}function c(t){try{s(a.throw(t))}catch(t){n(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(i,c)}s((a=a.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStream=void 0;const getStream=function(t){return __awaiter(this,arguments,void 0,function*({link:t,type:e,signal:r,providerContext:a}){var o,n;const i=a.commonHeaders;try{if("movie"===e){const e=(yield a.axios.get(t,{headers:i})).data,r=a.cheerio.load(e);t=r('a:contains("HubCloud")').attr("href")||t}const c=yield a.axios.get(t,{headers:i});let s=null===(o=c.data.match(/<meta\s+http-equiv="refresh"\s+content="[^"]*?;\s*url=([^"]+)"\s*\/?>/i))||void 0===o?void 0:o[1];if(t.includes("/archives/")&&(s=null===(n=c.data.match(/<a\s+[^>]*href="(https:\/\/hubcloud\.[^\/]+\/[^"]+)"/i))||void 0===n?void 0:n[1]),!s)return yield a.extractors.hubcloudExtracter(t,r);const d=(yield a.axios.get(s,{headers:i})).data,u=a.cheerio.load(d)(".fa-file-download").parent().attr("href");return yield a.extractors.hubcloudExtracter((null==u?void 0:u.includes("https://hubcloud"))?u:s,r)}catch(t){return[]}})};exports.getStream=getStream;