mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
build
This commit is contained in:
2
dist/hiAnime/stream.js
vendored
2
dist/hiAnime/stream.js
vendored
@@ -1 +1 @@
|
||||
var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};exports.getStream=void 0;const getStream=function(_a){return __awaiter(this,arguments,void 0,function*({link:id,providerContext:providerContext}){try{const{getBaseUrl:getBaseUrl,axios:axios}=providerContext,baseUrl=yield getBaseUrl("consumet"),servers=["vidcloud","vidstreaming"],url=`${baseUrl}/anime/zoro/watch?episodeId=${id}&server=`,streamLinks=[];return yield Promise.all(servers.map(server=>__awaiter(this,void 0,void 0,function*(){var _a,_b;try{const res=yield axios.get(url+server);if(res.data){const subtitles=[];null===(_a=res.data)||void 0===_a||_a.subtitles.forEach(sub=>{var _a,_b;"Thumbnails"!==(null==sub?void 0:sub.lang)&&subtitles.push({language:(null===(_a=null==sub?void 0:sub.lang)||void 0===_a?void 0:_a.slice(0,2))||"Und",uri:null==sub?void 0:sub.url,title:(null==sub?void 0:sub.lang)||"Undefined",type:(null===(_b=null==sub?void 0:sub.url)||void 0===_b?void 0:_b.endsWith(".vtt"))?"text/vtt":"application/x-subrip"})}),null===(_b=res.data)||void 0===_b||_b.sources.forEach(source=>{streamLinks.push({server:server,link:null==source?void 0:source.url,type:(null==source?void 0:source.isM3U8)?"m3u8":"mp4",headers:{Referer:"https://megacloud.club/",Origin:"https://megacloud.club"},subtitles:subtitles})})}}catch(e){}}))),streamLinks}catch(err){return[]}})};exports.getStream=getStream;
|
||||
"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,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of __getOwnPropNames(t))__hasOwnProp.call(e,n)||n===r||__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,r)=>new Promise((o,n)=>{var a=e=>{try{s(r.next(e))}catch(e){n(e)}},l=e=>{try{s(r.throw(e))}catch(e){n(e)}},s=e=>e.done?o(e.value):Promise.resolve(e.value).then(a,l);s((r=r.apply(e,t)).next())}),stream_exports={};__export(stream_exports,{getStream:()=>getStream});var getStream=__name(function(e){return __async(this,arguments,function*({link:e,providerContext:t}){try{const{getBaseUrl:r,axios:o}=t,n=yield r("consumet"),a=["vidcloud","vidstreaming"],l=`${n}/anime/zoro/watch?episodeId=${e}&server=`,s=[];return yield Promise.all(a.map(e=>__async(null,null,function*(){var t,r;try{const n=yield o.get(l+e);if(n.data){const o=[];null==(t=n.data)||t.subtitles.forEach(e=>{var t,r;"Thumbnails"!==(null==e?void 0:e.lang)&&o.push({language:(null==(t=null==e?void 0:e.lang)?void 0:t.slice(0,2))||"Und",uri:null==e?void 0:e.url,title:(null==e?void 0:e.lang)||"Undefined",type:(null==(r=null==e?void 0:e.url)?void 0:r.endsWith(".vtt"))?"text/vtt":"application/x-subrip"})}),null==(r=n.data)||r.sources.forEach(t=>{s.push({server:e,link:null==t?void 0:t.url,type:(null==t?void 0:t.isM3U8)?"m3u8":"mp4",headers:{Referer:"https://megacloud.club/",Origin:"https://megacloud.club"},subtitles:o})})}}catch(e){}}))),s}catch(e){return[]}})},"getStream");exports.getStream=getStream;
|
||||
Reference in New Issue
Block a user