mirror of
https://gitlab.com/vyla-entertainment/sdk.git
synced 2026-11-20 09:07:32 -05:00
removed pstream and mysterious
This commit is contained in:
@@ -565,25 +565,6 @@ export const SOURCES = [
|
|||||||
}],
|
}],
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
key: 'mysterious',
|
|
||||||
label: 'Mysterious',
|
|
||||||
sourceFile: 'mysterious',
|
|
||||||
proxyParam: 'mys',
|
|
||||||
timeout: 20000,
|
|
||||||
jitter: 500,
|
|
||||||
retries: 2,
|
|
||||||
multiUrl: true,
|
|
||||||
dedicated: true,
|
|
||||||
cdnHeaders: [{
|
|
||||||
pattern: /speedoflight\.buzz|febbox\.com/i,
|
|
||||||
headers: {
|
|
||||||
Referer: 'https://atlantic.speedoflight.buzz/',
|
|
||||||
Origin: 'https://atlantic.speedoflight.buzz',
|
|
||||||
},
|
|
||||||
}],
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
key: 'net79',
|
key: 'net79',
|
||||||
label: 'Net79',
|
label: 'Net79',
|
||||||
@@ -626,17 +607,6 @@ export const SOURCES = [
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
key: 'pstream',
|
|
||||||
label: 'PStream',
|
|
||||||
sourceFile: 'pstream',
|
|
||||||
proxyParam: 'ps',
|
|
||||||
timeout: 35000,
|
|
||||||
jitter: 500,
|
|
||||||
retries: 1,
|
|
||||||
multiUrl: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
key: 'purstream',
|
key: 'purstream',
|
||||||
sourceFile: 'purstream',
|
sourceFile: 'purstream',
|
||||||
|
|||||||
@@ -1,113 +0,0 @@
|
|||||||
import { fetchJson } from '../utils/helpers.js';
|
|
||||||
|
|
||||||
const BASE_URL = 'https://atlantic.speedoflight.buzz';
|
|
||||||
const UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36';
|
|
||||||
|
|
||||||
function normalizeQuality(q) {
|
|
||||||
if (!q) return '1080p';
|
|
||||||
const str = String(q).trim();
|
|
||||||
return /^\d+$/.test(str) ? `${str}p` : str;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getStream(args) {
|
|
||||||
const { id, s, e } = args || {};
|
|
||||||
if (!id) return null;
|
|
||||||
|
|
||||||
const isTv = s != null && e != null;
|
|
||||||
const season = s || 1;
|
|
||||||
const episode = e || 1;
|
|
||||||
|
|
||||||
const targetUrl = isTv
|
|
||||||
? `${BASE_URL}/api/embed?tmdb_id=${encodeURIComponent(id)}&type=series&season=${encodeURIComponent(season)}&episode=${encodeURIComponent(episode)}`
|
|
||||||
: `${BASE_URL}/api/embed?tmdb_id=${encodeURIComponent(id)}`;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const payload = await fetchJson(targetUrl, {
|
|
||||||
headers: {
|
|
||||||
'User-Agent': UA,
|
|
||||||
Accept: 'application/json',
|
|
||||||
},
|
|
||||||
signal: AbortSignal.timeout(args?.config?.timeout || 10000),
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!payload || (!Array.isArray(payload.qualities) && !payload.download_url && !payload.url)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const allUrls = [];
|
|
||||||
const seenUrls = new Set();
|
|
||||||
|
|
||||||
if (Array.isArray(payload.qualities)) {
|
|
||||||
for (const item of payload.qualities) {
|
|
||||||
if (!item || !item.url || seenUrls.has(item.url)) continue;
|
|
||||||
|
|
||||||
const qualLabel = String(item.quality || '').trim();
|
|
||||||
if (qualLabel.toUpperCase() === 'ORG') continue;
|
|
||||||
|
|
||||||
seenUrls.add(item.url);
|
|
||||||
const quality = normalizeQuality(qualLabel || '1080p');
|
|
||||||
const sizeText = item.sizeText ? ` (${item.sizeText})` : '';
|
|
||||||
|
|
||||||
const ext = item.url.split('?')[0].split('.').pop()?.toLowerCase();
|
|
||||||
const type = ext === 'm3u8' || item.url.includes('.m3u8')
|
|
||||||
? 'hls'
|
|
||||||
: (ext === 'mpd' || item.url.includes('.mpd') ? 'dash' : (ext === 'mkv' ? 'mkv' : 'mp4'));
|
|
||||||
|
|
||||||
allUrls.push({
|
|
||||||
url: item.url,
|
|
||||||
server: `Mysterious - Direct ${quality}${sizeText}`,
|
|
||||||
quality,
|
|
||||||
type,
|
|
||||||
skipProxy: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const directUrl = payload.download_url || payload.url;
|
|
||||||
if (directUrl && !seenUrls.has(directUrl)) {
|
|
||||||
seenUrls.add(directUrl);
|
|
||||||
const qMatch = (payload.file_name || '').match(/\b(2160p|1080p|720p|480p|360p|4k)\b/i);
|
|
||||||
const quality = qMatch ? qMatch[1].toLowerCase() : 'Auto';
|
|
||||||
const sizeText = payload.file_size ? ` (${payload.file_size})` : '';
|
|
||||||
const ext = directUrl.split('?')[0].split('.').pop()?.toLowerCase();
|
|
||||||
const type = ext === 'm3u8' || directUrl.includes('.m3u8')
|
|
||||||
? 'hls'
|
|
||||||
: (ext === 'mpd' || directUrl.includes('.mpd') ? 'dash' : (ext === 'mkv' || (payload.file_name && payload.file_name.endsWith('.mkv')) ? 'mkv' : 'mp4'));
|
|
||||||
|
|
||||||
allUrls.push({
|
|
||||||
url: directUrl,
|
|
||||||
server: `Mysterious - Direct ${quality}${sizeText}`,
|
|
||||||
quality,
|
|
||||||
type,
|
|
||||||
skipProxy: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (payload.download_url && !seenUrls.has(payload.download_url)) {
|
|
||||||
seenUrls.add(payload.download_url);
|
|
||||||
const qMatch = (payload.file_name || '').match(/\b(2160p|1080p|720p|480p|360p|4k)\b/i);
|
|
||||||
const quality = qMatch ? qMatch[1].toLowerCase() : 'Auto';
|
|
||||||
const sizeText = payload.file_size ? ` (${payload.file_size})` : '';
|
|
||||||
const ext = payload.download_url.split('?')[0].split('.').pop()?.toLowerCase();
|
|
||||||
const type = ext === 'm3u8' ? 'hls' : (ext === 'mpd' ? 'dash' : (ext === 'mkv' || (payload.file_name && payload.file_name.endsWith('.mkv')) ? 'mkv' : 'mp4'));
|
|
||||||
|
|
||||||
allUrls.push({
|
|
||||||
url: payload.download_url,
|
|
||||||
server: `Mysterious - Direct ${quality}${sizeText}`,
|
|
||||||
quality,
|
|
||||||
type,
|
|
||||||
skipProxy: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!allUrls.length) return null;
|
|
||||||
|
|
||||||
return {
|
|
||||||
url: allUrls[0].url,
|
|
||||||
headers: allUrls[0].headers,
|
|
||||||
allUrls,
|
|
||||||
};
|
|
||||||
} catch {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
import { USER_AGENT } from '../utils/helpers.js';
|
|
||||||
|
|
||||||
async function safeImport(moduleName) {
|
|
||||||
try {
|
|
||||||
return await import(`./${moduleName}.js`);
|
|
||||||
} catch {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getStream(args) {
|
|
||||||
const { id, s, e, clientIP, sdk } = args || {};
|
|
||||||
const isTv = s != null && e != null;
|
|
||||||
const type = isTv ? 'tv' : 'movie';
|
|
||||||
const allUrls = [];
|
|
||||||
|
|
||||||
const providers = [
|
|
||||||
{ name: 'CineSu', key: 'cinesu', fnName: 'fetchCineSuStreams' },
|
|
||||||
{ name: 'ZxcStream', key: 'zxcstream', fnName: 'fetchZxcStreams' },
|
|
||||||
{ name: 'VidFast', key: 'vidfast', fnName: 'fetchVidFastStreams' },
|
|
||||||
{ name: '1Embed', key: '1embed', fnName: 'fetchOneEmbedStreams' },
|
|
||||||
];
|
|
||||||
|
|
||||||
await Promise.all(
|
|
||||||
providers.map(async ({ name, key, fnName }) => {
|
|
||||||
try {
|
|
||||||
let streamResult = null;
|
|
||||||
|
|
||||||
if (sdk) {
|
|
||||||
try {
|
|
||||||
streamResult = await sdk.getStream(key, id, s, e, clientIP);
|
|
||||||
} catch { }
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!streamResult) {
|
|
||||||
const mod = await safeImport(key);
|
|
||||||
if (mod) {
|
|
||||||
if (typeof mod.getStream === 'function') {
|
|
||||||
streamResult = await mod.getStream(args);
|
|
||||||
} else if (typeof mod[fnName] === 'function') {
|
|
||||||
const raw = await mod[fnName]({ type, id, season: s, episode: e });
|
|
||||||
if (Array.isArray(raw)) {
|
|
||||||
streamResult = { allUrls: raw };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!streamResult) return;
|
|
||||||
|
|
||||||
const streams = streamResult.allUrls || (streamResult.url ? [streamResult] : []);
|
|
||||||
for (const item of streams) {
|
|
||||||
allUrls.push({
|
|
||||||
url: item.url,
|
|
||||||
server: `FlyStream (${item.source || item.server || name})`,
|
|
||||||
quality: item.quality || 'Auto',
|
|
||||||
type: item.type || item.format || (item.url?.includes('.m3u8') ? 'hls' : 'mp4'),
|
|
||||||
headers: item.headers || {
|
|
||||||
'User-Agent': USER_AGENT,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch { }
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!allUrls.length) return null;
|
|
||||||
|
|
||||||
return {
|
|
||||||
url: allUrls[0].url,
|
|
||||||
headers: allUrls[0].headers,
|
|
||||||
allUrls,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user