This commit is contained in:
Himanshu
2026-02-03 22:16:44 +05:30
parent c19b918513
commit 1e80bf18d4
184 changed files with 184 additions and 184 deletions

View File

@@ -1 +1 @@
"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 s of __getOwnPropNames(t))__hasOwnProp.call(e,s)||s===r||__defProp(e,s,{get:()=>t[s],enumerable:!(o=__getOwnPropDesc(t,s))||o.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__async=(e,t,r)=>new Promise((o,s)=>{var a=e=>{try{c(r.next(e))}catch(e){s(e)}},n=e=>{try{c(r.throw(e))}catch(e){s(e)}},c=e=>e.done?o(e.value):Promise.resolve(e.value).then(a,n);c((r=r.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,page:t,signal:r,providerContext:o}){const{getBaseUrl:s,axios:a,cheerio:n}=o,c=yield s("protonMovies");return posts({url:`${c+e}/page/${t}/`,baseUrl:c,signal:r,axios:a,cheerio:n})})},"getPosts"),getSearchPosts=__name(function(e){return __async(this,arguments,function*({searchQuery:e,page:t,signal:r,providerContext:o}){const{getBaseUrl:s,axios:a,cheerio:n}=o,c=yield s("protonMovies");return posts({url:`${c}/search/${e}/page/${t}/`,baseUrl:c,signal:r,axios:a,cheerio:n})})},"getSearchPosts");function posts(e){return __async(this,arguments,function*({url:e,baseUrl:t,signal:r,axios:o,cheerio:s}){try{let a=function(e){return e.join("").replace(/\\"/g,'"').replace(/\\'/g,"'").replace(/\\n/g,"\n").replace(/\\t/g,"\t").replace(/\\r/g,"\r").replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")};__name(a,"decodeHtml");const n=(yield o.get(e,{headers:{referer:t},signal:r})).data,c=/\[(?=.*?"<div class")(.*?)\]/g,p=null==n?void 0:n.match(c),i=a(JSON.parse(p[p.length-1])),_=s.load(i),l=[];return _(".col.mb-4").map((e,t)=>{const r=_(t).find("h5").text(),o=_(t).find("h5").find("a").attr("href"),s=_(t).find("img").attr("data-src")||_(t).find("img").attr("src")||"";r&&o&&s&&l.push({title:r,link:o,image:s})}),l}catch(e){return[]}})}__name(posts,"posts"),exports.getPosts=getPosts,exports.getSearchPosts=getSearchPosts;
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),posts_exports={};__export(posts_exports,{getPosts:()=>getPosts,getSearchPosts:()=>getSearchPosts});var getPosts=__name(function(_0){return __async(this,arguments,function*({filter:filter,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl,axios:axios,cheerio:cheerio}=providerContext,baseUrl=yield getBaseUrl("protonMovies");return posts({url:`${baseUrl+filter}/page/${page}/`,baseUrl:baseUrl,signal:signal,axios:axios,cheerio:cheerio})})},"getPosts"),getSearchPosts=__name(function(_0){return __async(this,arguments,function*({searchQuery:searchQuery,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl,axios:axios,cheerio:cheerio}=providerContext,baseUrl=yield getBaseUrl("protonMovies");return posts({url:`${baseUrl}/search/${searchQuery}/page/${page}/`,baseUrl:baseUrl,signal:signal,axios:axios,cheerio:cheerio})})},"getSearchPosts");function posts(_0){return __async(this,arguments,function*({url:url,baseUrl:baseUrl,signal:signal,axios:axios,cheerio:cheerio}){try{let decodeHtml2=function(encodedArray){return encodedArray.join("").replace(/\\"/g,'"').replace(/\\'/g,"'").replace(/\\n/g,"\n").replace(/\\t/g,"\t").replace(/\\r/g,"\r").replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")};__name(decodeHtml2,"decodeHtml");const data=(yield axios.get(url,{headers:{referer:baseUrl},signal:signal})).data,regex=/\[(?=.*?"<div class")(.*?)\]/g,htmlArray=null==data?void 0:data.match(regex),html=decodeHtml2(JSON.parse(htmlArray[htmlArray.length-1])),$=cheerio.load(html),catalog=[];return $(".col.mb-4").map((i,element)=>{const title=$(element).find("h5").text(),link=$(element).find("h5").find("a").attr("href"),image=$(element).find("img").attr("data-src")||$(element).find("img").attr("src")||"";title&&link&&image&&catalog.push({title:title,link:link,image:image})}),catalog}catch(err){return console.error("protonGetPosts error ",err),[]}})}__name(posts,"posts"),exports.getPosts=getPosts,exports.getSearchPosts=getSearchPosts;