mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
feat: add moviebox
This commit is contained in:
1
dist/movieBox/meta.js
vendored
Normal file
1
dist/movieBox/meta.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";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())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const getMeta=function(_a){return __awaiter(this,arguments,void 0,function*({link:link,providerContext:providerContext}){var _b,_c,_d;try{const{axios:axios,cheerio:cheerio,getBaseUrl:getBaseUrl}=providerContext,baseUrl=getBaseUrl("movieBox"),links=[],response=yield fetch("https://dob-worker.8man.workers.dev",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:link,method:"GET"})}),data=(yield response.json()).data,title=((null==data?void 0:data.title)||"").replace(/\s*\[.*?\]\s*$/,""),synopsis=(null==data?void 0:data.description)||"",image=(null===(_b=null==data?void 0:data.cover)||void 0===_b?void 0:_b.url)||"",rating=(null==data?void 0:data.imdbRatingValue)||"",tags=(null===(_d=null===(_c=null==data?void 0:data.genre)||void 0===_c?void 0:_c.split(","))||void 0===_d?void 0:_d.map(tag=>tag.trim()))||[],dubs=(null==data?void 0:data.dubs)||[];return null==dubs||dubs.forEach(dub=>{const link={title:null==dub?void 0:dub.lanName,episodesLink:`${baseUrl}/wefeed-mobile-bff/subject-api/resource?subjectId=${null==dub?void 0:dub.subjectId}&page=1&perPage=20&all=0&startPosition=1&endPosition=1&pagerMode=0&resolution=1080&se=1&epFrom=1&epTo=1`};links.push(link)}),{title:title,synopsis:synopsis,image:image,rating:rating,tags:tags,imdbId:"",type:"movie",linkList:links}}catch(err){return{title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]}}})};exports.getMeta=getMeta;
|
||||
Reference in New Issue
Block a user