mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
fix: update getStream function to use dynamic base URL from provider context
This commit is contained in:
@@ -10,7 +10,8 @@ export const getStream = async ({
|
||||
const { getBaseUrl } = providerContext;
|
||||
try {
|
||||
let providerValue = "netflixMirror";
|
||||
const baseUrl = "https://netfree2.cc";
|
||||
const baseUrl = await getBaseUrl("nfMirror");
|
||||
console.log("nfGetStream, baseUrl:", baseUrl);
|
||||
const url = `https://netmirror.8man.dev/api/net-proxy?url=${baseUrl}${
|
||||
providerValue === "netflixMirror"
|
||||
? "/mobile/playlist.php?id="
|
||||
@@ -26,7 +27,9 @@ export const getStream = async ({
|
||||
data?.sources.forEach((source: any) => {
|
||||
streamLinks.push({
|
||||
server: source.label,
|
||||
link: source.file?.replace(":su", ":ni"),
|
||||
link: source.file?.startsWith("http")
|
||||
? source.file
|
||||
: `${baseUrl}${source.file}`,
|
||||
type: "m3u8",
|
||||
headers: {
|
||||
Referer: baseUrl,
|
||||
|
||||
@@ -10,7 +10,7 @@ export const getStream = async ({
|
||||
const { getBaseUrl } = providerContext;
|
||||
try {
|
||||
let providerValue = "primeMirror";
|
||||
const baseUrl = "https://netfree2.cc";
|
||||
const baseUrl = await getBaseUrl("nfMirror");
|
||||
const url = `https://netmirror.8man.dev/api/net-proxy?url=${baseUrl}${
|
||||
providerValue === "netflixMirror"
|
||||
? "/mobile/playlist.php?id="
|
||||
@@ -26,7 +26,9 @@ export const getStream = async ({
|
||||
data?.sources.forEach((source: any) => {
|
||||
streamLinks.push({
|
||||
server: source.label,
|
||||
link: (baseUrl + source.file)?.replace(":su", ":ni"),
|
||||
link: source.file?.startsWith("http")
|
||||
? source.file
|
||||
: `${baseUrl}${source.file}`,
|
||||
type: "m3u8",
|
||||
headers: {
|
||||
Referer: baseUrl,
|
||||
|
||||
Reference in New Issue
Block a user