mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
1 line
1.8 KiB
JavaScript
1 line
1.8 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 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 i=e=>{try{a(r.next(e))}catch(e){n(e)}},s=e=>{try{a(r.throw(e))}catch(e){n(e)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,s);a((r=r.apply(e,t)).next())}),meta_exports={};__export(meta_exports,{getMeta:()=>getMeta});var getMeta=__name(function(e){return __async(this,arguments,function*({link:e,providerContext:t}){try{const{axios:r,cheerio:o}=t,n=e,i=(yield r.get(n)).data,s=o.load(i),a=n.includes("tvshows")?"series":"movie",p="",_=n.split("/")[4].replace(/-/g," "),l=s(".g-item").find("a").attr("href")||"",c=s(".wp-content").find("p").text()||"",d=[];return"series"===a?s("#seasons").children().map((e,t)=>{const r=s(t).find(".title").children().remove().end().text();let o=[];s(t).find(".episodios").children().map((e,t)=>{const r="Episode"+s(t).find(".numerando").text().trim().split("-")[1],n=s(t).find("a").attr("href");r&&n&&o.push({title:r,link:n})}),r&&o.length>0&&d.push({title:r,directLinks:o})}):d.push({title:_,directLinks:[{title:_,link:n.slice(0,-1),type:"movie"}]}),{title:_,synopsis:c,image:l,imdbId:p,type:a,linkList:d}}catch(e){return{title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]}}})},"getMeta");exports.getMeta=getMeta; |