Files
vega-providers/dist/autoEmbed/meta.js
Himanshu a179a130d6 build
2026-02-03 21:48:37 +05:30

1 line
3.4 KiB
JavaScript

"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,o,t)=>o in e?__defProp(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,__spreadValues=(e,o)=>{for(var t in o||(o={}))__hasOwnProp.call(o,t)&&__defNormalProp(e,t,o[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(o))__propIsEnum.call(o,t)&&__defNormalProp(e,t,o[t]);return e},__spreadProps=(e,o)=>__defProps(e,__getOwnPropDescs(o)),__name=(e,o)=>__defProp(e,"name",{value:o,configurable:!0}),__export=(e,o)=>{for(var t in o)__defProp(e,t,{get:o[t],enumerable:!0})},__copyProps=(e,o,t,l)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let n of __getOwnPropNames(o))__hasOwnProp.call(e,n)||n===t||__defProp(e,n,{get:()=>o[n],enumerable:!(l=__getOwnPropDesc(o,n))||l.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__async=(e,o,t)=>new Promise((l,n)=>{var i=e=>{try{a(t.next(e))}catch(e){n(e)}},r=e=>{try{a(t.throw(e))}catch(e){n(e)}},a=e=>e.done?l(e.value):Promise.resolve(e.value).then(i,r);a((t=t.apply(e,o)).next())}),meta_exports={};__export(meta_exports,{getMeta:()=>getMeta});var getMeta=__name(function(e){return __async(this,arguments,function*({link:e,providerContext:o}){var t,l,n,i,r,a,d,s,p,_,u,v,m,y;const c=o.axios;try{const o=(yield c.get(e)).data,P={title:(null==(t=null==o?void 0:o.meta)?void 0:t.name)||"",synopsis:(null==(l=null==o?void 0:o.meta)?void 0:l.description)||"",image:(null==(n=null==o?void 0:o.meta)?void 0:n.background)||"",imdbId:(null==(i=null==o?void 0:o.meta)?void 0:i.imdb_id)||"",type:(null==(r=null==o?void 0:o.meta)?void 0:r.type)||"movie"},b=[];let g=[],f=new Map;if("series"===P.type){null==(d=null==(a=null==o?void 0:o.meta)?void 0:a.videos)||d.map(e=>{var t,l,n,i,r,a,d,s;(null==e?void 0:e.season)<=0||(f.has(null==e?void 0:e.season)||f.set(null==e?void 0:e.season,[]),f.get(null==e?void 0:e.season).push({title:"Episode "+(null==e?void 0:e.episode),type:"series",link:JSON.stringify({title:null==(t=null==o?void 0:o.meta)?void 0:t.name,imdbId:null==(l=null==o?void 0:o.meta)?void 0:l.imdb_id,season:null==(n=null==e?void 0:e.id)?void 0:n.split(":")[1],episode:null==(i=null==e?void 0:e.id)?void 0:i.split(":")[2],type:null==(r=null==o?void 0:o.meta)?void 0:r.type,tmdbId:(null==(d=null==(a=null==o?void 0:o.meta)?void 0:a.moviedb_id)?void 0:d.toString())||"",year:null==(s=null==o?void 0:o.meta)?void 0:s.year})}))});const e=Array.from(f.keys());e.sort(),e.map(e=>{g=f.get(e),b.push({title:`Season ${e}`,directLinks:g})})}else b.push({title:null==(s=null==o?void 0:o.meta)?void 0:s.name,directLinks:[{title:"Movie",type:"movie",link:JSON.stringify({title:null==(p=null==o?void 0:o.meta)?void 0:p.name,imdbId:null==(_=null==o?void 0:o.meta)?void 0:_.imdb_id,season:"",episode:"",type:null==(u=null==o?void 0:o.meta)?void 0:u.type,tmdbId:(null==(m=null==(v=null==o?void 0:o.meta)?void 0:v.moviedb_id)?void 0:m.toString())||"",year:null==(y=null==o?void 0:o.meta)?void 0:y.year})}]});return __spreadProps(__spreadValues({},P),{linkList:b})}catch(e){return{title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]}}})},"getMeta");exports.getMeta=getMeta;