organized/fixed streams

This commit is contained in:
2026-10-31 12:37:24 -07:00
parent 95f4991914
commit 7473c0fa15
51 changed files with 2920 additions and 3059 deletions

View File

@@ -1,16 +1,20 @@
import { fetchJson } from '../utils/helpers.js';
export async function getStream({ id, s, e }) {
const BASE_URL = 'https://net79.cc';
export async function getStream(args) {
const { id, s, e } = args || {};
const isTv = s != null && e != null;
const url = isTv
? `https://net79.cc/api/embed-tmdb/${id}?type=tv&se=${s}&ep=${e}`
: `https://net79.cc/api/embed-tmdb/${id}?type=movie`;
? `${BASE_URL}/api/embed-tmdb/${id}?type=tv&se=${s}&ep=${e}`
: `${BASE_URL}/api/embed-tmdb/${id}?type=movie`;
const headers = {
'Accept': 'application/json',
'Referer': 'https://net79.cc/',
'Origin': 'https://net79.cc',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36'
Accept: 'application/json',
Referer: `${BASE_URL}/`,
Origin: BASE_URL,
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36',
};
const res = await fetchJson(url, { headers }).catch(() => null);
@@ -27,9 +31,9 @@ export async function getStream({ id, s, e }) {
server: `Net79 - ${stream.resolution ? `${stream.resolution}p` : 'MP4'}`,
type: stream.url.includes('.m3u8') ? 'hls' : 'mp4',
headers: {
Referer: 'https://net79.cc/',
Origin: 'https://net79.cc'
}
Referer: `${BASE_URL}/`,
Origin: BASE_URL,
},
});
}
}
@@ -40,9 +44,9 @@ export async function getStream({ id, s, e }) {
server: `Net79 - ${res.resolution ? `${res.resolution}p` : 'MP4'}`,
type: res.mp4.includes('.m3u8') ? 'hls' : 'mp4',
headers: {
Referer: 'https://net79.cc/',
Origin: 'https://net79.cc'
}
Referer: `${BASE_URL}/`,
Origin: BASE_URL,
},
});
}
@@ -51,6 +55,6 @@ export async function getStream({ id, s, e }) {
return {
url: allUrls[0].url,
headers: allUrls[0].headers,
allUrls
allUrls,
};
}