mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
init
This commit is contained in:
17
dist/primeMirror/index.js
vendored
Normal file
17
dist/primeMirror/index.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.primeMirror = void 0;
|
||||
const nfCatalog_1 = require("../netflixMirror/nfCatalog");
|
||||
const nfGetPost_1 = require("../netflixMirror/nfGetPost");
|
||||
const pmGetInfo_1 = require("./pmGetInfo");
|
||||
const pmGetStream_1 = require("./pmGetStream");
|
||||
const pmGetEpisodes_1 = require("./pmGetEpisodes");
|
||||
exports.primeMirror = {
|
||||
catalog: nfCatalog_1.nfCatalog,
|
||||
genres: nfCatalog_1.nfGenresList,
|
||||
GetMetaData: pmGetInfo_1.pmGetInfo,
|
||||
GetHomePosts: nfGetPost_1.nfGetPost,
|
||||
GetStream: pmGetStream_1.pmGetStream,
|
||||
GetEpisodeLinks: pmGetEpisodes_1.pmGetEpisodes,
|
||||
GetSearchPosts: nfGetPost_1.nfGetPostsSearch,
|
||||
};
|
||||
39
dist/primeMirror/pmGetEpisodes.js
vendored
Normal file
39
dist/primeMirror/pmGetEpisodes.js
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.pmGetEpisodes = void 0;
|
||||
const pmGetEpisodes = 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,
|
||||
});
|
||||
});
|
||||
return episodeList;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('nfGetEpisodes error', err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.pmGetEpisodes = pmGetEpisodes;
|
||||
57
dist/primeMirror/pmGetInfo.js
vendored
Normal file
57
dist/primeMirror/pmGetInfo.js
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.pmGetInfo = void 0;
|
||||
const pmGetInfo = async function ({ link, }) {
|
||||
let providerValue = 'primeMirror';
|
||||
try {
|
||||
const isPrime = providerValue === 'primeMirror' ? 'isPrime=true' : 'isPrime=false';
|
||||
const url = `https://netmirror.8man.me/api/net-proxy?${isPrime}&url=${encodeURIComponent(link)}`;
|
||||
console.log('nfifo', url);
|
||||
const res = await fetch(url, {
|
||||
credentials: 'omit',
|
||||
});
|
||||
const data = await res.json();
|
||||
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',
|
||||
};
|
||||
console.log('nfinfo', meta);
|
||||
const linkList = [];
|
||||
if (data?.season?.length > 0) {
|
||||
data.season.map((season) => {
|
||||
linkList.push({
|
||||
title: 'Season ' + season?.s,
|
||||
episodesLink: season?.id,
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
linkList.push({
|
||||
title: meta.title,
|
||||
directLinks: [{ link: id, title: 'Movie', type: 'movie' }],
|
||||
});
|
||||
}
|
||||
return {
|
||||
...meta,
|
||||
linkList: linkList,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
type: '',
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.pmGetInfo = pmGetInfo;
|
||||
39
dist/primeMirror/pmGetStream.js
vendored
Normal file
39
dist/primeMirror/pmGetStream.js
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.pmGetStream = void 0;
|
||||
const pmGetStream = async ({ link: id, providerContext, }) => {
|
||||
const { getBaseUrl } = providerContext;
|
||||
try {
|
||||
let providerValue = 'primeMirror';
|
||||
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='}${id}&t=${Math.round(new Date().getTime() / 1000)}`;
|
||||
console.log('nfGetStream, url:', url);
|
||||
const res = await fetch(url, {
|
||||
credentials: 'omit',
|
||||
});
|
||||
const resJson = await res.json();
|
||||
const data = resJson?.[0];
|
||||
const streamLinks = [];
|
||||
data?.sources.forEach((source) => {
|
||||
streamLinks.push({
|
||||
server: source.label,
|
||||
link: (baseUrl + source.file)?.replace(':su', ':ni'),
|
||||
type: 'm3u8',
|
||||
headers: {
|
||||
Referer: baseUrl,
|
||||
origin: baseUrl,
|
||||
Cookie: 'hd=on',
|
||||
},
|
||||
});
|
||||
});
|
||||
console.log(streamLinks);
|
||||
return streamLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.pmGetStream = pmGetStream;
|
||||
Reference in New Issue
Block a user