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/ridoMovies/posts.js
vendored
2
dist/ridoMovies/posts.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.getSearchPosts=exports.getPosts=void 0;const getPosts=function(_a){return __awaiter(this,arguments,void 0,function*({filter:filter,signal:signal,providerContext:providerContext}){try{const catalog=[],url="https://cinemeta-catalogs.strem.io"+filter,data=(yield providerContext.axios.get(url,{headers:providerContext.commonHeaders,signal:signal})).data;return null==data||data.metas.map(result=>{const title=null==result?void 0:result.name,id=(null==result?void 0:result.imdb_id)||(null==result?void 0:result.id),type=null==result?void 0:result.type,image=null==result?void 0:result.poster;id&&catalog.push({title:title,link:`https://v3-cinemeta.strem.io/meta/${type}/${id}.json`,image:image})}),catalog}catch(err){return[]}})};exports.getPosts=getPosts;const getSearchPosts=function(_a){return __awaiter(this,arguments,void 0,function*({searchQuery:searchQuery,page:page,signal:signal,providerContext:providerContext}){try{const{axios:axios,commonHeaders:headers}=providerContext;if(page>1)return[];const catalog=[],url2=`https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(searchQuery)}.json`,data2=(yield axios.get(url2,{headers:headers,signal:signal})).data;return null==data2||data2.metas.map(result=>{const title=(null==result?void 0:result.name)||"",id=(null==result?void 0:result.imdb_id)||(null==result?void 0:result.id),image=null==result?void 0:result.poster,type=null==result?void 0:result.type;id&&catalog.push({title:title,link:`https://v3-cinemeta.strem.io/meta/${type}/${id}.json`,image:image})}),catalog}catch(err){return[]}})};exports.getSearchPosts=getSearchPosts;
|
||||
"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 o in t)__defProp(e,o,{get:t[o],enumerable:!0})},__copyProps=(e,t,o,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of __getOwnPropNames(t))__hasOwnProp.call(e,s)||s===o||__defProp(e,s,{get:()=>t[s],enumerable:!(r=__getOwnPropDesc(t,s))||r.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__async=(e,t,o)=>new Promise((r,s)=>{var n=e=>{try{i(o.next(e))}catch(e){s(e)}},a=e=>{try{i(o.throw(e))}catch(e){s(e)}},i=e=>e.done?r(e.value):Promise.resolve(e.value).then(n,a);i((o=o.apply(e,t)).next())}),posts_exports={};__export(posts_exports,{getPosts:()=>getPosts,getSearchPosts:()=>getSearchPosts});var getPosts=__name(function(e){return __async(this,arguments,function*({filter:e,signal:t,providerContext:o}){try{const r=[],s="https://cinemeta-catalogs.strem.io"+e,n=(yield o.axios.get(s,{headers:o.commonHeaders,signal:t})).data;return null==n||n.metas.map(e=>{const t=null==e?void 0:e.name,o=(null==e?void 0:e.imdb_id)||(null==e?void 0:e.id),s=null==e?void 0:e.type,n=null==e?void 0:e.poster;o&&r.push({title:t,link:`https://v3-cinemeta.strem.io/meta/${s}/${o}.json`,image:n})}),r}catch(e){return[]}})},"getPosts"),getSearchPosts=__name(function(e){return __async(this,arguments,function*({searchQuery:e,page:t,signal:o,providerContext:r}){try{const{axios:s,commonHeaders:n}=r;if(t>1)return[];const a=[],i=`https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(e)}.json`,c=(yield s.get(i,{headers:n,signal:o})).data;return null==c||c.metas.map(e=>{const t=(null==e?void 0:e.name)||"",o=(null==e?void 0:e.imdb_id)||(null==e?void 0:e.id),r=null==e?void 0:e.poster,s=null==e?void 0:e.type;o&&a.push({title:t,link:`https://v3-cinemeta.strem.io/meta/${s}/${o}.json`,image:r})}),a}catch(e){return[]}})},"getSearchPosts");exports.getPosts=getPosts,exports.getSearchPosts=getSearchPosts;
|
||||
Reference in New Issue
Block a user