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:
78
dist/primeMirror/episodes.js
vendored
78
dist/primeMirror/episodes.js
vendored
@@ -1,39 +1,51 @@
|
||||
"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.getEpisodes = void 0;
|
||||
const getEpisodes = async function ({ url: link, providerContext, }) {
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
let providerValue = "primeMirror";
|
||||
try {
|
||||
const baseUrl = await getBaseUrl("nfMirror");
|
||||
const url = `${baseUrl}${providerValue === "netflixMirror"
|
||||
? "/episodes.php?s="
|
||||
: "/pv/episodes.php?s="}` +
|
||||
link +
|
||||
"&t=" +
|
||||
Math.round(new Date().getTime() / 1000);
|
||||
console.log("nfEpisodesUrl", url);
|
||||
const res = await axios.get(url, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36",
|
||||
"Accept-Language": "en-US,en;q=0.9",
|
||||
},
|
||||
});
|
||||
const data = res.data;
|
||||
console.log("nfEpisodes", data);
|
||||
const episodeList = [];
|
||||
data?.episodes?.map((episode) => {
|
||||
episodeList.push({
|
||||
title: "Episode " + episode?.ep.replace("E", ""),
|
||||
link: episode?.id,
|
||||
const getEpisodes = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ url: link, providerContext, }) {
|
||||
var _b;
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
let providerValue = "primeMirror";
|
||||
try {
|
||||
const baseUrl = yield getBaseUrl("nfMirror");
|
||||
const url = `${baseUrl}${providerValue === "netflixMirror"
|
||||
? "/episodes.php?s="
|
||||
: "/pv/episodes.php?s="}` +
|
||||
link +
|
||||
"&t=" +
|
||||
Math.round(new Date().getTime() / 1000);
|
||||
console.log("nfEpisodesUrl", url);
|
||||
const res = yield axios.get(url, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36",
|
||||
"Accept-Language": "en-US,en;q=0.9",
|
||||
},
|
||||
});
|
||||
});
|
||||
return episodeList;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("nfGetEpisodes error", err);
|
||||
return [];
|
||||
}
|
||||
const data = res.data;
|
||||
console.log("nfEpisodes", data);
|
||||
const episodeList = [];
|
||||
(_b = data === null || data === void 0 ? void 0 : data.episodes) === null || _b === void 0 ? void 0 : _b.map((episode) => {
|
||||
episodeList.push({
|
||||
title: "Episode " + (episode === null || episode === void 0 ? void 0 : episode.ep.replace("E", "")),
|
||||
link: episode === null || episode === void 0 ? void 0 : episode.id,
|
||||
});
|
||||
});
|
||||
return episodeList;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("nfGetEpisodes error", err);
|
||||
return [];
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getEpisodes = getEpisodes;
|
||||
|
||||
Reference in New Issue
Block a user