mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
minify
This commit is contained in:
109
dist/netflixMirror/posts.js
vendored
109
dist/netflixMirror/posts.js
vendored
@@ -1,108 +1 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
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) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ filter, page, providerValue, signal, providerContext, }) {
|
||||
try {
|
||||
const { getBaseUrl, cheerio } = providerContext;
|
||||
const baseUrl = yield getBaseUrl("nfMirror");
|
||||
const catalog = [];
|
||||
if (page > 1) {
|
||||
return [];
|
||||
}
|
||||
// console.log(filter);
|
||||
const isPrime = providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false";
|
||||
const url = `https://netmirror.zendax.tech/api/net-proxy?${isPrime}&url=${baseUrl + filter}`;
|
||||
const res = yield fetch(url, {
|
||||
signal: signal,
|
||||
method: "GET",
|
||||
credentials: "omit",
|
||||
});
|
||||
const data = yield res.text();
|
||||
// console.log('nfPost', data);
|
||||
const $ = cheerio.load(data);
|
||||
$("a.post-data").map((i, element) => {
|
||||
const title = "";
|
||||
const id = $(element).attr("data-post");
|
||||
// console.log('id', id);
|
||||
const image = $(element).find("img").attr("data-src") || "";
|
||||
if (id) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: baseUrl +
|
||||
`${providerValue === "netflixMirror"
|
||||
? "/post.php?id="
|
||||
: "/pv/post.php?id="}` +
|
||||
id +
|
||||
"&t=" +
|
||||
Math.round(new Date().getTime() / 1000),
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
// console.log(catalog);
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("nf error ", err);
|
||||
return [];
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, providerValue, signal, providerContext, }) {
|
||||
var _b;
|
||||
const { getBaseUrl } = providerContext;
|
||||
try {
|
||||
if (page > 1) {
|
||||
return [];
|
||||
}
|
||||
const catalog = [];
|
||||
const baseUrl = yield getBaseUrl("nfMirror");
|
||||
const isPrime = providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false";
|
||||
const url = `https://netmirror.zendax.tech/api/net-proxy?${isPrime}&url=${baseUrl}${providerValue === "netflixMirror" ? "" : "/pv"}/search.php?s=${encodeURI(searchQuery)}`;
|
||||
const res = yield fetch(url, {
|
||||
signal: signal,
|
||||
method: "GET",
|
||||
credentials: "omit",
|
||||
});
|
||||
const data = yield res.json();
|
||||
(_b = data === null || data === void 0 ? void 0 : data.searchResult) === null || _b === void 0 ? void 0 : _b.forEach((result) => {
|
||||
const title = (result === null || result === void 0 ? void 0 : result.t) || "";
|
||||
const id = result === null || result === void 0 ? void 0 : result.id;
|
||||
const image = providerValue === "netflixMirror"
|
||||
? `https://imgcdn.media/poster/v/${id}.jpg`
|
||||
: "";
|
||||
if (id) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: baseUrl +
|
||||
`${providerValue === "netflixMirror"
|
||||
? "/mobile/post.php?id="
|
||||
: "/mobile/pv/post.php?id="}` +
|
||||
id +
|
||||
"&t=" +
|
||||
Math.round(new Date().getTime() / 1000),
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("Search error:", err);
|
||||
return [];
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))(function(o,n){function s(t){try{c(i.next(t))}catch(t){n(t)}}function a(t){try{c(i.throw(t))}catch(t){n(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(s,a)}c((i=i.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSearchPosts=exports.getPosts=void 0;const getPosts=function(t){return __awaiter(this,arguments,void 0,function*({filter:t,page:e,providerValue:r,signal:i,providerContext:o}){try{const{getBaseUrl:n,cheerio:s}=o,a=yield n("nfMirror"),c=[];if(e>1)return[];const p=`https://netmirror.zendax.tech/api/net-proxy?${"primeMirror"===r?"isPrime=true":"isPrime=false"}&url=${a+t}`,l=yield fetch(p,{signal:i,method:"GET",credentials:"omit"}),d=yield l.text(),u=s.load(d);return u("a.post-data").map((t,e)=>{const i=u(e).attr("data-post"),o=u(e).find("img").attr("data-src")||"";i&&c.push({title:"",link:a+""+("netflixMirror"===r?"/post.php?id=":"/pv/post.php?id=")+i+"&t="+Math.round((new Date).getTime()/1e3),image:o})}),c}catch(t){return[]}})};exports.getPosts=getPosts;const getSearchPosts=function(t){return __awaiter(this,arguments,void 0,function*({searchQuery:t,page:e,providerValue:r,signal:i,providerContext:o}){var n;const{getBaseUrl:s}=o;try{if(e>1)return[];const o=[],a=yield s("nfMirror"),c=`https://netmirror.zendax.tech/api/net-proxy?${"primeMirror"===r?"isPrime=true":"isPrime=false"}&url=${a}${"netflixMirror"===r?"":"/pv"}/search.php?s=${encodeURI(t)}`,p=yield fetch(c,{signal:i,method:"GET",credentials:"omit"}),l=yield p.json();return null===(n=null==l?void 0:l.searchResult)||void 0===n||n.forEach(t=>{const e=(null==t?void 0:t.t)||"",i=null==t?void 0:t.id,n="netflixMirror"===r?`https://imgcdn.media/poster/v/${i}.jpg`:"";i&&o.push({title:e,link:a+""+("netflixMirror"===r?"/mobile/post.php?id=":"/mobile/pv/post.php?id=")+i+"&t="+Math.round((new Date).getTime()/1e3),image:n})}),o}catch(t){return[]}})};exports.getSearchPosts=getSearchPosts;
|
||||
Reference in New Issue
Block a user