mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
renaming
This commit is contained in:
16
providers/netflixMirror/catalog.ts
Normal file
16
providers/netflixMirror/catalog.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export const catalog = [
|
||||
{
|
||||
title: "Home",
|
||||
filter: "/mobile/home?app=1",
|
||||
},
|
||||
{
|
||||
title: "Series",
|
||||
filter: "/mobile/series",
|
||||
},
|
||||
{
|
||||
title: "Movies",
|
||||
filter: "/mobile/movies",
|
||||
},
|
||||
];
|
||||
|
||||
export const genres = [];
|
||||
49
providers/netflixMirror/episodes.ts
Normal file
49
providers/netflixMirror/episodes.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { EpisodeLink, ProviderContext } from "../types";
|
||||
|
||||
export const getEpisodes = async function ({
|
||||
url: link,
|
||||
providerContext,
|
||||
}: {
|
||||
url: string;
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<EpisodeLink[]> {
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
let providerValue = "netflixMirror";
|
||||
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: EpisodeLink[] = [];
|
||||
|
||||
data?.episodes?.map((episode: any) => {
|
||||
episodeList.push({
|
||||
title: "Episode " + episode?.ep.replace("E", ""),
|
||||
link: episode?.id,
|
||||
});
|
||||
});
|
||||
|
||||
return episodeList;
|
||||
} catch (err) {
|
||||
console.error("nfGetEpisodes error", err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
@@ -1,16 +0,0 @@
|
||||
import {nfCatalog, nfGenresList} from './nfCatalog';
|
||||
import {nfGetInfo} from './nfGetInfo';
|
||||
import {nfGetPost, nfGetPostsSearch} from './nfGetPost';
|
||||
import {nfGetEpisodes} from './nfGetEpisodes';
|
||||
import {nfGetStream} from './nfGetSteam';
|
||||
import {ProviderType} from '../types';
|
||||
|
||||
export const netflixMirror: ProviderType = {
|
||||
catalog: nfCatalog,
|
||||
genres: nfGenresList,
|
||||
GetMetaData: nfGetInfo,
|
||||
GetHomePosts: nfGetPost,
|
||||
GetStream: nfGetStream,
|
||||
GetEpisodeLinks: nfGetEpisodes,
|
||||
GetSearchPosts: nfGetPostsSearch,
|
||||
};
|
||||
@@ -1,46 +1,46 @@
|
||||
import {Info, Link} from '../types';
|
||||
import { Info, Link } from "../types";
|
||||
|
||||
export const nfGetInfo = async function ({
|
||||
export const getMeta = async function ({
|
||||
link,
|
||||
}: {
|
||||
link: string;
|
||||
}): Promise<Info> {
|
||||
let providerValue = 'netflixMirror';
|
||||
let providerValue = "netflixMirror";
|
||||
try {
|
||||
const isPrime =
|
||||
providerValue === 'primeMirror' ? 'isPrime=true' : 'isPrime=false';
|
||||
providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false";
|
||||
const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${encodeURIComponent(
|
||||
link,
|
||||
link
|
||||
)}`;
|
||||
console.log('nfifo', url);
|
||||
console.log("nfifo", url);
|
||||
const res = await fetch(url, {
|
||||
credentials: 'omit',
|
||||
credentials: "omit",
|
||||
});
|
||||
const data = await res.json();
|
||||
const id = link.split('id=')[1]?.split('&')[0];
|
||||
const id = link.split("id=")[1]?.split("&")[0];
|
||||
const meta = {
|
||||
title: data.title,
|
||||
synopsis: data.desc,
|
||||
image: `https://img.nfmirrorcdn.top/poster/h/${id}.jpg`,
|
||||
cast: data?.short_cast?.split(','),
|
||||
tags: [data?.year, data?.hdsd, ...data?.thismovieis?.split(',')],
|
||||
imdbId: '',
|
||||
type: 'series',
|
||||
cast: data?.short_cast?.split(","),
|
||||
tags: [data?.year, data?.hdsd, ...data?.thismovieis?.split(",")],
|
||||
imdbId: "",
|
||||
type: "series",
|
||||
};
|
||||
console.log('nfinfo', meta);
|
||||
console.log("nfinfo", meta);
|
||||
|
||||
const linkList: Link[] = [];
|
||||
if (data?.season?.length > 0) {
|
||||
data.season.map((season: any) => {
|
||||
linkList.push({
|
||||
title: 'Season ' + season?.s,
|
||||
title: "Season " + season?.s,
|
||||
episodesLink: season?.id,
|
||||
});
|
||||
});
|
||||
} else {
|
||||
linkList.push({
|
||||
title: meta.title,
|
||||
directLinks: [{link: id, title: 'Movie', type: 'movie'}],
|
||||
directLinks: [{ link: id, title: "Movie", type: "movie" }],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -52,11 +52,11 @@ export const nfGetInfo = async function ({
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
type: '',
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
export const nfCatalog = [
|
||||
{
|
||||
title: 'Home',
|
||||
filter: '/mobile/home?app=1',
|
||||
},
|
||||
{
|
||||
title: 'Series',
|
||||
filter: '/mobile/series',
|
||||
},
|
||||
{
|
||||
title: 'Movies',
|
||||
filter: '/mobile/movies',
|
||||
},
|
||||
];
|
||||
|
||||
export const nfGenresList = [];
|
||||
@@ -1,49 +0,0 @@
|
||||
import {EpisodeLink, ProviderContext} from '../types';
|
||||
|
||||
export const nfGetEpisodes = async function ({
|
||||
url: link,
|
||||
providerContext,
|
||||
}: {
|
||||
url: string;
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<EpisodeLink[]> {
|
||||
const {getBaseUrl, axios} = providerContext;
|
||||
let providerValue = 'netflixMirror';
|
||||
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: EpisodeLink[] = [];
|
||||
|
||||
data?.episodes?.map((episode: any) => {
|
||||
episodeList.push({
|
||||
title: 'Episode ' + episode?.ep.replace('E', ''),
|
||||
link: episode?.id,
|
||||
});
|
||||
});
|
||||
|
||||
return episodeList;
|
||||
} catch (err) {
|
||||
console.error('nfGetEpisodes error', err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
import {Post, ProviderContext} from '../types';
|
||||
import { Post, ProviderContext } from "../types";
|
||||
|
||||
export const nfGetPost = async function ({
|
||||
export const getPosts = async function ({
|
||||
filter,
|
||||
page,
|
||||
providerValue,
|
||||
@@ -14,15 +14,15 @@ export const nfGetPost = async function ({
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Post[]> {
|
||||
try {
|
||||
const {getBaseUrl, cheerio} = providerContext;
|
||||
const baseUrl = await getBaseUrl('nfMirror');
|
||||
const { getBaseUrl, cheerio } = providerContext;
|
||||
const baseUrl = await getBaseUrl("nfMirror");
|
||||
const catalog: Post[] = [];
|
||||
if (page > 1) {
|
||||
return [];
|
||||
}
|
||||
// console.log(filter);
|
||||
const isPrime =
|
||||
providerValue === 'primeMirror' ? 'isPrime=true' : 'isPrime=false';
|
||||
providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false";
|
||||
|
||||
const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${
|
||||
baseUrl + filter
|
||||
@@ -30,29 +30,29 @@ export const nfGetPost = async function ({
|
||||
|
||||
const res = await fetch(url, {
|
||||
signal: signal,
|
||||
method: 'GET',
|
||||
credentials: 'omit',
|
||||
method: "GET",
|
||||
credentials: "omit",
|
||||
});
|
||||
const data = await res.text();
|
||||
// console.log('nfPost', data);
|
||||
const $ = cheerio.load(data);
|
||||
$('a.post-data').map((i, element) => {
|
||||
const title = '';
|
||||
const id = $(element).attr('data-post');
|
||||
$("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') || '';
|
||||
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='
|
||||
providerValue === "netflixMirror"
|
||||
? "/post.php?id="
|
||||
: "/pv/post.php?id="
|
||||
}` +
|
||||
id +
|
||||
'&t=' +
|
||||
"&t=" +
|
||||
Math.round(new Date().getTime() / 1000),
|
||||
image: image,
|
||||
});
|
||||
@@ -61,12 +61,12 @@ export const nfGetPost = async function ({
|
||||
// console.log(catalog);
|
||||
return catalog;
|
||||
} catch (err) {
|
||||
console.error('nf error ', err);
|
||||
console.error("nf error ", err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
export const nfGetPostsSearch = async function ({
|
||||
export const getSearchPosts = async function ({
|
||||
searchQuery,
|
||||
page,
|
||||
providerValue,
|
||||
@@ -79,35 +79,35 @@ export const nfGetPostsSearch = async function ({
|
||||
signal: AbortSignal;
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Post[]> {
|
||||
const {getBaseUrl} = providerContext;
|
||||
const { getBaseUrl } = providerContext;
|
||||
try {
|
||||
if (page > 1) {
|
||||
return [];
|
||||
}
|
||||
const catalog: Post[] = [];
|
||||
const baseUrl = await getBaseUrl('nfMirror');
|
||||
const baseUrl = await getBaseUrl("nfMirror");
|
||||
const isPrime =
|
||||
providerValue === 'primeMirror' ? 'isPrime=true' : 'isPrime=false';
|
||||
providerValue === "primeMirror" ? "isPrime=true" : "isPrime=false";
|
||||
|
||||
const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${baseUrl}${
|
||||
providerValue === 'netflixMirror' ? '' : '/pv'
|
||||
providerValue === "netflixMirror" ? "" : "/pv"
|
||||
}/search.php?s=${encodeURI(searchQuery)}`;
|
||||
|
||||
const res = await fetch(url, {
|
||||
signal: signal,
|
||||
method: 'GET',
|
||||
credentials: 'omit',
|
||||
method: "GET",
|
||||
credentials: "omit",
|
||||
});
|
||||
|
||||
const data = await res.json();
|
||||
|
||||
data?.searchResult?.forEach((result: any) => {
|
||||
const title = result?.t || '';
|
||||
const title = result?.t || "";
|
||||
const id = result?.id;
|
||||
const image =
|
||||
providerValue === 'netflixMirror'
|
||||
providerValue === "netflixMirror"
|
||||
? `https://imgcdn.media/poster/v/${id}.jpg`
|
||||
: '';
|
||||
: "";
|
||||
|
||||
if (id) {
|
||||
catalog.push({
|
||||
@@ -115,12 +115,12 @@ export const nfGetPostsSearch = async function ({
|
||||
link:
|
||||
baseUrl +
|
||||
`${
|
||||
providerValue === 'netflixMirror'
|
||||
? '/mobile/post.php?id='
|
||||
: '/mobile/pv/post.php?id='
|
||||
providerValue === "netflixMirror"
|
||||
? "/mobile/post.php?id="
|
||||
: "/mobile/pv/post.php?id="
|
||||
}` +
|
||||
id +
|
||||
'&t=' +
|
||||
"&t=" +
|
||||
Math.round(new Date().getTime() / 1000),
|
||||
image: image,
|
||||
});
|
||||
@@ -129,7 +129,7 @@ export const nfGetPostsSearch = async function ({
|
||||
|
||||
return catalog;
|
||||
} catch (err) {
|
||||
console.error('Search error:', err);
|
||||
console.error("Search error:", err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
@@ -1,24 +1,24 @@
|
||||
import {ProviderContext, Stream} from '../types';
|
||||
import { ProviderContext, Stream } from "../types";
|
||||
|
||||
export const nfGetStream = async ({
|
||||
export const getStream = async ({
|
||||
link: id,
|
||||
providerContext,
|
||||
}: {
|
||||
link: string;
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Stream[]> => {
|
||||
const {getBaseUrl} = providerContext;
|
||||
const { getBaseUrl } = providerContext;
|
||||
try {
|
||||
let providerValue = 'netflixMirror';
|
||||
const baseUrl = await getBaseUrl('nfMirror');
|
||||
let providerValue = "netflixMirror";
|
||||
const baseUrl = await getBaseUrl("nfMirror");
|
||||
const url = `https://netmirror.8man.me/api/net-proxy?url=${baseUrl}${
|
||||
providerValue === 'netflixMirror'
|
||||
? '/mobile/playlist.php?id='
|
||||
: '/pv/playlist.php?id='
|
||||
providerValue === "netflixMirror"
|
||||
? "/mobile/playlist.php?id="
|
||||
: "/pv/playlist.php?id="
|
||||
}${id}&t=${Math.round(new Date().getTime() / 1000)}`;
|
||||
console.log('nfGetStream, url:', url);
|
||||
console.log("nfGetStream, url:", url);
|
||||
const res = await fetch(url, {
|
||||
credentials: 'omit',
|
||||
credentials: "omit",
|
||||
});
|
||||
const resJson = await res.json();
|
||||
const data = resJson?.[0];
|
||||
@@ -26,12 +26,12 @@ export const nfGetStream = async ({
|
||||
data?.sources.forEach((source: any) => {
|
||||
streamLinks.push({
|
||||
server: source.label,
|
||||
link: (baseUrl + source.file)?.replace(':su', ':ni'),
|
||||
type: 'm3u8',
|
||||
link: (baseUrl + source.file)?.replace(":su", ":ni"),
|
||||
type: "m3u8",
|
||||
headers: {
|
||||
Referer: baseUrl,
|
||||
origin: baseUrl,
|
||||
Cookie: 'hd=on',
|
||||
Cookie: "hd=on",
|
||||
},
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user