mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
1 line
1.5 KiB
JavaScript
1 line
1.5 KiB
JavaScript
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(s,o){function u(t){try{r(n.next(t))}catch(t){o(t)}}function l(t){try{r(n.throw(t))}catch(t){o(t)}}function r(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(u,l)}r((n=n.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const getMeta=function(t){return __awaiter(this,arguments,void 0,function*({link:t,providerContext:e}){try{const{getBaseUrl:i,axios:n}=e,s=`${yield i("consumet")}/anime/zoro/info?id=`+t,o=(yield n.get(s)).data,u={title:o.title,synopsis:o.description,image:o.image,tags:[null==o?void 0:o.type,"both"===(null==o?void 0:o.subOrDub)?"Sub And Dub":null==o?void 0:o.subOrDub],imdbId:"",type:o.episodes.length>0?"series":"movie"},l=[],r=[];if(o.episodes.forEach(t=>{if(!(null==t?void 0:t.isSubbed))return;const e="Episode "+t.number+((null==t?void 0:t.isFiller)?" (Filler)":""),i=t.id+"$sub";i&&e&&r.push({title:e,link:i})}),l.push({title:u.title+" (Sub)",directLinks:r}),"both"===(null==o?void 0:o.subOrDub)){const t=[];o.episodes.forEach(e=>{if(!(null==e?void 0:e.isDubbed))return;const i="Episode "+e.number+((null==e?void 0:e.isFiller)?" (Filler)":""),n=e.id+"$dub";n&&i&&t.push({title:i,link:n})}),l.push({title:u.title+" (Dub)",directLinks:t})}return Object.assign(Object.assign({},u),{linkList:l})}catch(t){return{title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]}}})};exports.getMeta=getMeta; |