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:
26
dist/netflixMirror/stream.js
vendored
26
dist/netflixMirror/stream.js
vendored
@@ -1,25 +1,35 @@
|
||||
"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.getStream = void 0;
|
||||
const getStream = async ({ link: id, providerContext, }) => {
|
||||
const getStream = (_a) => __awaiter(void 0, [_a], void 0, function* ({ link: id, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
try {
|
||||
let providerValue = "netflixMirror";
|
||||
const baseUrl = await getBaseUrl("nfMirror");
|
||||
const baseUrl = yield getBaseUrl("nfMirror");
|
||||
const url = `https://netmirror.8man.me/api/net-proxy?url=${baseUrl}${providerValue === "netflixMirror"
|
||||
? "/mobile/playlist.php?id="
|
||||
: "/pv/playlist.php?id="}${id}&t=${Math.round(new Date().getTime() / 1000)}`;
|
||||
console.log("nfGetStream, url:", url);
|
||||
const res = await fetch(url, {
|
||||
const res = yield fetch(url, {
|
||||
credentials: "omit",
|
||||
});
|
||||
const resJson = await res.json();
|
||||
const data = resJson?.[0];
|
||||
const resJson = yield res.json();
|
||||
const data = resJson === null || resJson === void 0 ? void 0 : resJson[0];
|
||||
const streamLinks = [];
|
||||
data?.sources.forEach((source) => {
|
||||
data === null || data === void 0 ? void 0 : data.sources.forEach((source) => {
|
||||
var _a;
|
||||
streamLinks.push({
|
||||
server: source.label,
|
||||
link: (baseUrl + source.file)?.replace(":su", ":ni"),
|
||||
link: (_a = (baseUrl + source.file)) === null || _a === void 0 ? void 0 : _a.replace(":su", ":ni"),
|
||||
type: "m3u8",
|
||||
headers: {
|
||||
Referer: baseUrl,
|
||||
@@ -35,5 +45,5 @@ const getStream = async ({ link: id, providerContext, }) => {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
});
|
||||
exports.getStream = getStream;
|
||||
|
||||
Reference in New Issue
Block a user