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/dooflix/posts.js
vendored
2
dist/dooflix/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 headers={"Accept-Encoding":"gzip","API-KEY":"2pm95lc6prpdbk0ppji9rsqo",Connection:"Keep-Alive","If-Modified-Since":"Wed, 14 Aug 2024 13:00:04 GMT","User-Agent":"okhttp/3.14.9"},getPosts=function(_a){return __awaiter(this,arguments,void 0,function*({filter:filter,page:page,signal:signal,providerContext:providerContext}){try{const{axios:axios,getBaseUrl:getBaseUrl}=providerContext,baseUrl=yield getBaseUrl("dooflix"),catalog=[],url=""+(baseUrl+filter+`?page=${page}`),resData=(yield axios.get(url,{headers:headers,signal:signal})).data;if(!resData||"string"!=typeof resData)return[];let data;try{const jsonStart=resData.indexOf("["),jsonEnd=resData.lastIndexOf("]")+1;if(-1===jsonStart||jsonEnd<=jsonStart)data=JSON.parse(resData);else{const jsonSubstring=resData.substring(jsonStart,jsonEnd),parsedArray=JSON.parse(jsonSubstring);data=parsedArray.length>0?parsedArray:resData}}catch(parseError){return[]}return Array.isArray(data)?(data.forEach(result=>{const id=null==result?void 0:result.videos_id;if(!id)return;const type=(null==result?void 0:result.is_tvseries)?"movie":"tvseries",link=`${baseUrl}/rest-api//v130/single_details?type=${type}&id=${id}`,thumbnailUrl=null==result?void 0:result.thumbnail_url,image=(null==thumbnailUrl?void 0:thumbnailUrl.includes("https"))?thumbnailUrl:null==thumbnailUrl?void 0:thumbnailUrl.replace("http","https");catalog.push({title:(null==result?void 0:result.title)||"",link:link,image:image})}),catalog):[]}catch(err){return[]}})};exports.getPosts=getPosts;const getSearchPosts=function(_a){return __awaiter(this,arguments,void 0,function*({searchQuery:searchQuery,page:page,providerContext:providerContext,signal:signal}){var _b,_c;try{if(page>1)return[];const{axios:axios,getBaseUrl:getBaseUrl}=providerContext,catalog=[],baseUrl=yield getBaseUrl("dooflix"),url=`${baseUrl}/rest-api//v130/search?q=${searchQuery}&type=movietvserieslive&range_to=0&range_from=0&tv_category_id=0&genre_id=0&country_id=0`,resData=(yield axios.get(url,{headers:headers,signal:signal})).data;if(!resData||"string"!=typeof resData)return[];let data;try{const jsonStart=resData.indexOf("{"),jsonEnd=resData.lastIndexOf("}")+1;if(-1===jsonStart||jsonEnd<=jsonStart)data=resData;else{const jsonSubstring=resData.substring(jsonStart,jsonEnd),parsedData=JSON.parse(jsonSubstring);data=(null==parsedData?void 0:parsedData.movie)?parsedData:resData}}catch(parseError){return[]}return null===(_b=null==data?void 0:data.movie)||void 0===_b||_b.forEach(result=>{const id=null==result?void 0:result.videos_id;if(!id)return;const link=`${baseUrl}/rest-api//v130/single_details?type=movie&id=${id}`,thumbnailUrl=null==result?void 0:result.thumbnail_url,image=(null==thumbnailUrl?void 0:thumbnailUrl.includes("https"))?thumbnailUrl:null==thumbnailUrl?void 0:thumbnailUrl.replace("http","https");catalog.push({title:(null==result?void 0:result.title)||"",link:link,image:image})}),null===(_c=null==data?void 0:data.tvseries)||void 0===_c||_c.forEach(result=>{const id=null==result?void 0:result.videos_id;if(!id)return;const link=`${baseUrl}/rest-api//v130/single_details?type=tvseries&id=${id}`,thumbnailUrl=null==result?void 0:result.thumbnail_url,image=(null==thumbnailUrl?void 0:thumbnailUrl.includes("https"))?thumbnailUrl:null==thumbnailUrl?void 0:thumbnailUrl.replace("http","https");catalog.push({title:(null==result?void 0:result.title)||"",link:link,image:image})}),catalog}catch(error){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 r in t)__defProp(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of __getOwnPropNames(t))__hasOwnProp.call(e,o)||o===r||__defProp(e,o,{get:()=>t[o],enumerable:!(s=__getOwnPropDesc(t,o))||s.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__async=(e,t,r)=>new Promise((s,o)=>{var i=e=>{try{l(r.next(e))}catch(e){o(e)}},n=e=>{try{l(r.throw(e))}catch(e){o(e)}},l=e=>e.done?s(e.value):Promise.resolve(e.value).then(i,n);l((r=r.apply(e,t)).next())}),posts_exports={};__export(posts_exports,{getPosts:()=>getPosts,getSearchPosts:()=>getSearchPosts});var headers={"Accept-Encoding":"gzip","API-KEY":"2pm95lc6prpdbk0ppji9rsqo",Connection:"Keep-Alive","If-Modified-Since":"Wed, 14 Aug 2024 13:00:04 GMT","User-Agent":"okhttp/3.14.9"},getPosts=__name(function(e){return __async(this,arguments,function*({filter:e,page:t,signal:r,providerContext:s}){try{const{axios:o,getBaseUrl:i}=s,n=yield i("dooflix"),l=[],a=n+e+`?page=${t}`,p=(yield o.get(a,{headers:headers,signal:r})).data;if(!p||"string"!=typeof p)return[];let c;try{const e=p.indexOf("["),t=p.lastIndexOf("]")+1;if(-1===e||t<=e)c=JSON.parse(p);else{const r=p.substring(e,t),s=JSON.parse(r);c=s.length>0?s:p}}catch(e){return[]}return Array.isArray(c)?(c.forEach(e=>{const t=null==e?void 0:e.videos_id;if(!t)return;const r=(null==e?void 0:e.is_tvseries)?"movie":"tvseries",s=`${n}/rest-api//v130/single_details?type=${r}&id=${t}`,o=null==e?void 0:e.thumbnail_url,i=(null==o?void 0:o.includes("https"))?o:null==o?void 0:o.replace("http","https");l.push({title:(null==e?void 0:e.title)||"",link:s,image:i})}),l):[]}catch(e){return[]}})},"getPosts"),getSearchPosts=__name(function(e){return __async(this,arguments,function*({searchQuery:e,page:t,providerContext:r,signal:s}){var o,i;try{if(t>1)return[];const{axios:n,getBaseUrl:l}=r,a=[],p=yield l("dooflix"),c=`${p}/rest-api//v130/search?q=${e}&type=movietvserieslive&range_to=0&range_from=0&tv_category_id=0&genre_id=0&country_id=0`,d=(yield n.get(c,{headers:headers,signal:s})).data;if(!d||"string"!=typeof d)return[];let u;try{const e=d.indexOf("{"),t=d.lastIndexOf("}")+1;if(-1===e||t<=e)u=d;else{const r=d.substring(e,t),s=JSON.parse(r);u=(null==s?void 0:s.movie)?s:d}}catch(e){return[]}return null==(o=null==u?void 0:u.movie)||o.forEach(e=>{const t=null==e?void 0:e.videos_id;if(!t)return;const r=`${p}/rest-api//v130/single_details?type=movie&id=${t}`,s=null==e?void 0:e.thumbnail_url,o=(null==s?void 0:s.includes("https"))?s:null==s?void 0:s.replace("http","https");a.push({title:(null==e?void 0:e.title)||"",link:r,image:o})}),null==(i=null==u?void 0:u.tvseries)||i.forEach(e=>{const t=null==e?void 0:e.videos_id;if(!t)return;const r=`${p}/rest-api//v130/single_details?type=tvseries&id=${t}`,s=null==e?void 0:e.thumbnail_url,o=(null==s?void 0:s.includes("https"))?s:null==s?void 0:s.replace("http","https");a.push({title:(null==e?void 0:e.title)||"",link:r,image:o})}),a}catch(e){return[]}})},"getSearchPosts");exports.getPosts=getPosts,exports.getSearchPosts=getSearchPosts;
|
||||
Reference in New Issue
Block a user