This commit is contained in:
Himanshu
2026-02-03 21:48:37 +05:30
parent c4d3340b16
commit a179a130d6
192 changed files with 184 additions and 192 deletions

View File

@@ -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,page:page,providerValue:providerValue,signal:signal,providerContext:providerContext}){try{const{getBaseUrl:getBaseUrl,cheerio:cheerio}=providerContext,baseUrl=yield getBaseUrl("nfMirror"),catalog=[];if(page>1)return[];const url=`https://netmirror.8man.dev/api/net-proxy?${"primeMirror"===providerValue?"isPrime=true":"isPrime=false"}&url=${baseUrl+filter}`,res=yield fetch(url,{signal:signal,method:"GET",credentials:"omit"}),data=yield res.text(),$=cheerio.load(data);return $("a.post-data").map((i,element)=>{const id=$(element).attr("data-post"),image=$(element).find("img").attr("data-src")||"";id&&catalog.push({title:"",link:baseUrl+""+("netflixMirror"===providerValue?"/post.php?id=":"/pv/post.php?id=")+id+"&t="+Math.round((new Date).getTime()/1e3),image:image})}),catalog}catch(err){return[]}})};exports.getPosts=getPosts;const getSearchPosts=function(_a){return __awaiter(this,arguments,void 0,function*({searchQuery:searchQuery,page:page,providerValue:providerValue,signal:signal,providerContext:providerContext}){var _b;const{getBaseUrl:getBaseUrl}=providerContext;try{if(page>1)return[];const catalog=[],baseUrl=yield getBaseUrl("nfMirror"),url=`https://netmirror.8man.dev/api/net-proxy?${"primeMirror"===providerValue?"isPrime=true":"isPrime=false"}&url=${baseUrl}${"netflixMirror"===providerValue?"":"/pv"}/search.php?s=${encodeURI(searchQuery)}`,res=yield fetch(url,{signal:signal,method:"GET",credentials:"omit"}),data=yield res.json();return null===(_b=null==data?void 0:data.searchResult)||void 0===_b||_b.forEach(result=>{const title=(null==result?void 0:result.t)||"",id=null==result?void 0:result.id,image="netflixMirror"===providerValue?`https://imgcdn.media/poster/v/${id}.jpg`:`https://imgcdn.media/pv/341/${id}.jpg`;id&&catalog.push({title:title,link:baseUrl+""+("netflixMirror"===providerValue?"/mobile/post.php?id=":"/mobile/pv/post.php?id=")+id+"&t="+Math.round((new Date).getTime()/1e3),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 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 n=e=>{try{a(r.next(e))}catch(e){s(e)}},i=e=>{try{a(r.throw(e))}catch(e){s(e)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(n,i);a((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,providerValue:r,signal:o,providerContext:s}){try{const{getBaseUrl:n,cheerio:i}=s,a=yield n("nfMirror"),p=[];if(t>1)return[];const l=`https://netmirror.8man.dev/api/net-proxy?${"primeMirror"===r?"isPrime=true":"isPrime=false"}&url=${a+e}`,c=yield fetch(l,{signal:o,method:"GET",credentials:"omit"}),_=yield c.text(),d=i.load(_);return d("a.post-data").map((e,t)=>{const o=d(t).attr("data-post"),s=d(t).find("img").attr("data-src")||"";o&&p.push({title:"",link:a+""+("netflixMirror"===r?"/post.php?id=":"/pv/post.php?id=")+o+"&t="+Math.round((new Date).getTime()/1e3),image:s})}),p}catch(e){return[]}})},"getPosts"),getSearchPosts=__name(function(e){return __async(this,arguments,function*({searchQuery:e,page:t,providerValue:r,signal:o,providerContext:s}){var n;const{getBaseUrl:i}=s;try{if(t>1)return[];const s=[],a=yield i("nfMirror"),p=`https://netmirror.8man.dev/api/net-proxy?${"primeMirror"===r?"isPrime=true":"isPrime=false"}&url=${a}${"netflixMirror"===r?"":"/pv"}/search.php?s=${encodeURI(e)}`,l=yield fetch(p,{signal:o,method:"GET",credentials:"omit"}),c=yield l.json();return null==(n=null==c?void 0:c.searchResult)||n.forEach(e=>{const t=(null==e?void 0:e.t)||"",o=null==e?void 0:e.id,n="netflixMirror"===r?`https://imgcdn.media/poster/v/${o}.jpg`:`https://imgcdn.media/pv/341/${o}.jpg`;o&&s.push({title:t,link:a+""+("netflixMirror"===r?"/mobile/post.php?id=":"/mobile/pv/post.php?id=")+o+"&t="+Math.round((new Date).getTime()/1e3),image:n})}),s}catch(e){return[]}})},"getSearchPosts");exports.getPosts=getPosts,exports.getSearchPosts=getSearchPosts;