added embed config and adde dedicated section for config

This commit is contained in:
2026-11-15 20:39:42 -08:00
parent 6b51a76ed4
commit bf7c5885b2
4 changed files with 552 additions and 55 deletions

View File

@@ -1,3 +1,5 @@
// some dedicated sources in the config may be wrong :shrug:
export const SOURCES = [
{
key: '3eyedraven',
@@ -44,6 +46,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: false,
dedicated: true,
cdnHeaders: [{
pattern: /hlsx\d+cdn\.|burntburst\d+\.store|echovideo\.ru/i,
headers: {
@@ -62,6 +65,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
cdnHeaders: [{
pattern: /111477\.xyz/i,
headers: {
@@ -116,6 +120,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
cdnHeaders: [{
pattern: /anizone\.to/i,
headers: {
@@ -134,6 +139,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
cdnHeaders: [{
pattern: /anv\.to/i,
headers: {
@@ -152,6 +158,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
cdnHeaders: [{
pattern: /braflix\.dev/i,
headers: {
@@ -170,6 +177,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
},
{
@@ -217,6 +225,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
cdnHeaders: [{
pattern: /cinema\.army/i,
headers: {
@@ -253,6 +262,7 @@ export const SOURCES = [
jitter: 300,
retries: 1,
multiUrl: true,
dedicated: true,
cdnHeaders: [{
pattern: /cno\.to/i,
headers: {
@@ -316,17 +326,6 @@ export const SOURCES = [
}],
},
{
key: 'frost',
label: 'FrostStream',
sourceFile: 'frost',
proxyParam: 'fst',
timeout: 25000,
jitter: 500,
retries: 2,
multiUrl: true,
},
{
key: 'fsonline',
label: 'FSOnline',
@@ -336,6 +335,7 @@ export const SOURCES = [
retries: 1,
jitter: 0,
multiUrl: true,
dedicated: true,
},
{
@@ -347,6 +347,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
},
{
@@ -376,6 +377,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
cdnHeaders: [{
pattern: /krussdomi\.com/i,
headers: {
@@ -411,6 +413,7 @@ export const SOURCES = [
timeout: 30000,
jitter: 500,
retries: 1,
dedicated: true,
},
{
@@ -422,6 +425,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
},
{
@@ -433,6 +437,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
verifyHeaders: {
'Accept-Language': 'en-US,en;q=0.9',
},
@@ -483,6 +488,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
cdnHeaders: [{
pattern: /movenerds\.space/i,
headers: {
@@ -501,6 +507,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
cdnHeaders: [{
pattern: /mzfi\.me|net79\.cc/i,
headers: {
@@ -529,6 +536,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
cdnHeaders: [{
pattern: /wecollege\.net|movy\.sx|goldenkite\.top/i,
headers: {
@@ -547,6 +555,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
cdnHeaders: [{
pattern: /speedoflight\.buzz|febbox\.com/i,
headers: {
@@ -595,6 +604,7 @@ export const SOURCES = [
retries: 1,
multiUrl: true,
disabled: false,
},
{
@@ -616,6 +626,7 @@ export const SOURCES = [
timeout: 20000,
jitter: 500,
retries: 2,
dedicated: true,
},
{
@@ -728,6 +739,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
cdnHeaders: [{
pattern: /trendimovies\.com|tgstream/i,
headers: {
@@ -775,6 +787,7 @@ export const SOURCES = [
jitter: 500,
retries: 1,
multiUrl: true,
dedicated: true,
cdnHeaders: [{
pattern: /vidcore\.io/i,
headers: {
@@ -793,6 +806,7 @@ export const SOURCES = [
jitter: 500,
retries: 1,
multiUrl: true,
dedicated: true,
cdnHeaders: [{
pattern: /vidfast\.vc/i,
headers: {
@@ -829,6 +843,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
},
{
@@ -930,6 +945,7 @@ export const SOURCES = [
jitter: 500,
retries: 1,
multiUrl: true,
dedicated: true,
},
{
@@ -941,6 +957,7 @@ export const SOURCES = [
jitter: 500,
retries: 2,
multiUrl: true,
dedicated: true,
},
{
@@ -970,6 +987,7 @@ export const SOURCES = [
sourcesTimeout: 10000,
jitter: 400,
retries: 3,
dedicated: true,
verifyHeaders: {
Accept: '/',
'Accept-Language': 'en-US,en;q=0.9',
@@ -987,6 +1005,7 @@ export const SOURCES = [
jitter: 0,
retries: 2,
multiUrl: false,
dedicated: true,
verifyHeaders: {
Accept: 'application/json, text/javascript, /; q=0.01',
'Accept-Language': 'en-US,en;q=0.9',
@@ -1086,4 +1105,6 @@ export const SOURCES = [
export const HEALTH_PROBE_ID = '155';
export const SOURCE_MAP = Object.fromEntries(SOURCES.map(s => [s.key, s]));
export const DEDICATED_SOURCES = SOURCES.filter(s => s.dedicated);
export const AGGREGATOR_SOURCES = SOURCES.filter(s => !s.dedicated);
export default SOURCES;

488
src/embed_config.js Normal file
View File

@@ -0,0 +1,488 @@
export const EMBEDS = [
{
key: 'cinezo',
label: 'Cinezo',
movie: 'https://player.cinezo.live/embed/movie/{id}',
tv: 'https://player.cinezo.live/embed/tv/{id}/{s}/{e}',
ads: false,
},
{
key: 'cinesrc',
label: 'CineSrc',
movie: 'https://cinesrc.st/embed/movie/{id}',
tv: 'https://cinesrc.st/embed/tv/{id}?s={s}&e={e}',
ads: false,
},
{
key: 'peestream',
label: 'PeeStream',
movie: 'https://peestream.in/embed/?tmdbId={id}&type=movie',
tv: 'https://peestream.in/embed/?tmdbId={id}&type=show&season={s}&episode={e}',
ads: false,
},
{
key: 'flaxmovies',
label: 'FlaxMovies',
movie: 'https://flaxmovies.xyz/embed/movie/{id}',
tv: 'https://flaxmovies.xyz/embed/tv/{id}/{s}/{e}',
ads: false,
},
{
key: 'moviesapi',
label: 'MoviesAPI',
movie: 'https://moviesapi.to/movie/{id}',
tv: 'https://moviesapi.to/tv/{id}-{s}-{e}',
ads: false,
},
{
key: 'helium',
label: 'Helium',
movie: 'https://nxsha.space/embed/movie/{id}?lang=hi&sub=en&disable_app_ad=true&server=MhPly-[Multi-Lang]',
tv: 'https://nxsha.space/embed/tv/{id}/{s}/{e}?lang=hi&sub=en&disable_app_ad=true&server=MhPly-[Multi-Lang]',
ads: false,
},
{
key: 'vidbolt',
label: 'VidBolt',
movie: 'https://vidbolt.xyz/embed/movie/{id}',
tv: 'https://vidbolt.xyz/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidfast',
label: 'VidFast',
movie: 'https://vidfast.vc/movie/{id}',
tv: 'https://vidfast.vc/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidlink',
label: 'VidLink',
movie: 'https://vidlink.pro/movie/{id}',
tv: 'https://vidlink.pro/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidcore',
label: 'VidCore',
movie: 'https://vidcore.io/movie/{id}',
tv: 'https://vidcore.io/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidup',
label: 'VidUp',
movie: 'https://vidup.to/movie/{id}',
tv: 'https://vidup.to/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidy',
label: 'Vidy',
movie: 'https://www.vidy.st/movie/{id}',
tv: 'https://www.vidy.st/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vixsrc',
label: 'VixSrc',
movie: 'https://vixsrc.to/movie/{id}',
tv: 'https://vixsrc.to/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'videasy',
label: 'Videasy',
movie: 'https://player.videasy.net/movie/{id}',
tv: 'https://player.videasy.net/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidzee',
label: 'VidZee',
movie: 'https://player.vidzee.wtf/embed/movie/{id}',
tv: 'https://player.vidzee.wtf/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidking',
label: 'VidKing',
movie: 'https://www.vidking.net/embed/movie/{id}',
tv: 'https://www.vidking.net/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidnest',
label: 'VidNest',
movie: 'https://vidnest.fun/movie/{id}',
tv: 'https://vidnest.fun/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidrock',
label: 'VidRock',
movie: 'https://vidrock.net/movie/{id}',
tv: 'https://vidrock.net/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidlove',
label: 'VidLove',
movie: 'https://player.vidlove.cc/embed/movie/{id}',
tv: 'https://player.vidlove.cc/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidify',
label: 'Vidify',
movie: 'https://player.vidify.top/embed/movie/{id}',
tv: 'https://player.vidify.top/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidbinge',
label: 'VidBinge',
movie: 'https://vidbinge.dev/embed/movie/{id}',
tv: 'https://vidbinge.dev/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidgod',
label: 'VidGod',
movie: 'https://vidgod.net/movie/{id}',
tv: 'https://vidgod.net/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'videm',
label: 'Videm',
movie: 'https://videm.cc/embed/movie/{id}',
tv: 'https://videm.cc/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'viduki',
label: 'Viduki',
movie: 'https://www.viduki.net/1/movie/{id}',
tv: 'https://www.viduki.net/1/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'mapple',
label: 'Mapple',
movie: 'https://mapple.fun/watch/movie/{id}',
tv: 'https://mapple.fun/watch/tv/{id}-{s}-{e}',
ads: true,
},
{
key: 'smashystream',
label: 'SmashyStream',
movie: 'https://player.smashy.stream/movie/{id}',
tv: 'https://player.smashy.stream/tv/{id}?s={s}&e={e}',
ads: true,
},
{
key: '111movies',
label: '111Movies',
movie: 'https://111movies.com/movie/{id}',
tv: 'https://111movies.com/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'primesrc',
label: 'PrimeSrc',
movie: 'https://primesrc.me/embed/movie?tmdb={id}',
tv: 'https://primesrc.me/embed/tv?tmdb={id}&season={s}&episode={e}',
ads: true,
},
{
key: 'multiembed',
label: 'MultiEmbed',
movie: 'https://multiembed.mov/?video_id={id}&tmdb=1',
tv: 'https://multiembed.mov/?video_id={id}&tmdb=1&s={s}&e={e}',
ads: true,
},
{
key: 'superembed',
label: 'SuperEmbed',
movie: 'https://superembed.stream/movie?tmdb=1&id={id}',
tv: 'https://superembed.stream/tv?tmdb=1&id={id}&season={s}&episode={e}',
ads: true,
},
{
key: 'autoembed',
label: 'AutoEmbed',
movie: 'https://player.autoembed.cc/embed/movie/{id}',
tv: 'https://player.autoembed.cc/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'autoembed_co',
label: 'AutoEmbed CO',
movie: 'https://autoembed.co/movie/tmdb/{id}',
tv: 'https://autoembed.co/tv/tmdb/{id}-{s}-{e}',
ads: true,
},
{
key: 'embed_su',
label: 'Embed.su',
movie: 'https://embed.su/embed/movie/{id}',
tv: 'https://embed.su/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'two_embed',
label: '2Embed',
movie: 'https://www.2embed.cc/embed/{id}',
tv: 'https://www.2embed.cc/embedtv/{id}&s={s}&e={e}',
ads: true,
},
{
key: '1embed',
label: '1Embed',
movie: 'https://1embed.cc/embed/movie/{id}',
tv: 'https://1embed.cc/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'embedmaster',
label: 'EmbedMaster',
movie: 'https://embedmaster.link/py4vltalbjyhkaae/movie/{id}',
tv: 'https://embedmaster.link/py4vltalbjyhkaae/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'embedheaven',
label: 'EmbedHeaven',
movie: 'https://player.embedheaven.st/movie/{id}',
tv: 'https://player.embedheaven.st/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'embed_api',
label: 'EmbedAPI',
movie: 'https://watch.embed-api.stream/embed/movie/{id}',
tv: 'https://watch.embed-api.stream/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidsrc_me',
label: 'VidSrc.me',
movie: 'https://vidsrc.me/embed/movie/{id}',
tv: 'https://vidsrc.me/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidsrc_to',
label: 'VidSrc.to',
movie: 'https://vidsrc.to/embed/movie/{id}',
tv: 'https://vidsrc.to/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidsrc_embed',
label: 'VidSrc Embed',
movie: 'https://vidsrc-embed.ru/embed/movie/{id}',
tv: 'https://vidsrc-embed.ru/embed/tv/{id}-{s}-{e}',
ads: true,
},
{
key: 'vidsrc_pro',
label: 'VidSrc Pro',
movie: 'https://vidsrc.pro/embed/movie/{id}',
tv: 'https://vidsrc.pro/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidsrc_cc',
label: 'VidSrc CC',
movie: 'https://vidsrc.cc/v2/embed/movie/{id}',
tv: 'https://vidsrc.cc/v2/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidsrc_icu',
label: 'VidSrc ICU',
movie: 'https://vidsrc.icu/embed/movie/{id}',
tv: 'https://vidsrc.icu/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidsrc_rip',
label: 'VidSrc RIP',
movie: 'https://vidsrc.rip/embed/movie/{id}',
tv: 'https://vidsrc.rip/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidsrc_net',
label: 'VidSrc Net',
movie: 'https://vidsrc.net/embed/movie/{id}',
tv: 'https://vidsrc.net/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidsrc_in',
label: 'VidSrc IN',
movie: 'https://vidsrc.in/embed/movie/{id}',
tv: 'https://vidsrc.in/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidsrc_pm',
label: 'VidSrc PM',
movie: 'https://vidsrc.pm/embed/movie/{id}',
tv: 'https://vidsrc.pm/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vidsrc_su',
label: 'VidSrc.su',
movie: 'https://vidsrc.su/movie/{id}',
tv: 'https://vidsrc.su/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'nontongo',
label: 'NontonGo',
movie: 'https://www.nontongo.win/embed/movie/{id}',
tv: 'https://www.nontongo.win/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'cinejoy',
label: 'CineJoy',
movie: 'https://cinejoy.pk/watch/movie/{id}',
tv: 'https://cinejoy.pk/watch/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'moviee',
label: 'Moviee',
movie: 'https://moviee.tv/embed/movie/{id}',
tv: 'https://moviee.tv/embed/tv/{id}?s={s}&e={e}',
ads: true,
},
{
key: 'warezcdn',
label: 'WarezCDN',
movie: 'https://embed.warezcdn.link/movie/{id}',
tv: 'https://embed.warezcdn.link/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'filmu',
label: 'Filmu',
movie: 'https://embed.filmu.in/movie/{id}',
tv: 'https://embed.filmu.in/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vaplayer',
label: 'VAPlayer',
movie: 'https://vaplayer.ru/embed/movie/{id}',
tv: 'https://vaplayer.ru/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vares',
label: 'Vares',
movie: 'https://vares.app/movie/{id}',
tv: 'https://vares.app/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'xpass',
label: 'XPass',
movie: 'https://play.xpass.top/e/movie/{id}',
tv: 'https://play.xpass.top/e/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'zxcprime',
label: 'ZXCPrime',
movie: 'https://player.zxcprime.xyz/player/movie/{id}',
tv: 'https://player.zxcprime.xyz/player/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'zxcstream',
label: 'ZXCStream',
movie: 'https://zxcstream.xyz/player/movie/{id}',
tv: 'https://zxcstream.xyz/player/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'zxcstream_mirror',
label: 'ZXCStream Mirror',
movie: 'https://zxcstream-mirror.vercel.app/player/movie/{id}',
tv: 'https://zxcstream-mirror.vercel.app/player/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'vsembed',
label: 'VSEmbed',
movie: 'https://vsembed.ru/embed/movie/{id}',
tv: 'https://vsembed.ru/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'atlantic',
label: 'Atlantic',
movie: 'https://atlantic.st/embed/movie/{id}',
tv: 'https://atlantic.st/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'cinemaos',
label: 'CinemaOS',
movie: 'https://cinemaos.tech/player/{id}',
tv: 'https://cinemaos.tech/player/{id}/{s}/{e}',
ads: true,
},
{
key: 'hexa',
label: 'Hexa',
movie: 'https://api.hexa.watch/movie/{id}',
tv: 'https://api.hexa.watch/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'screenscape',
label: 'Screenscape',
movie: 'https://screenscape.me/embed?tmdb={id}&type=movie',
tv: 'https://screenscape.me/embed?tmdb={id}&type=tv&s={s}&e={e}',
ads: true,
},
{
key: 'stellar',
label: 'Stellar',
movie: 'https://stellar.rip/en/watch/embed/movie/{id}',
tv: 'https://stellar.rip/en/watch/embed/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'youplex',
label: 'Youplex',
movie: 'https://youplex.site/embed/movie/{id}#live-player',
tv: 'https://youplex.site/embed/tv/{id}/{s}/{e}#live-player',
ads: true,
},
{
key: 'spencer',
label: 'Spencer',
movie: 'https://spencerdevs.xyz/movie/{id}',
tv: 'https://spencerdevs.xyz/tv/{id}/{s}/{e}',
ads: true,
},
{
key: 'peachify',
label: 'Peachify',
movie: 'https://peachify.top/embed/movie/{id}',
tv: 'https://peachify.top/embed/tv/{id}/{s}/{e}',
ads: true,
},
];
export const EMBED_MAP = Object.fromEntries(EMBEDS.map(e => [e.key, e]));
export default EMBEDS;

View File

@@ -1,4 +1,5 @@
import SOURCES, { SOURCE_MAP } from "./config.js";
import SOURCES, { AGGREGATOR_SOURCES, DEDICATED_SOURCES, SOURCE_MAP } from "./config.js";
import EMBEDS, { EMBED_MAP } from "./embed_config.js";
import { fetchDownloads } from "./downloads/downloads.js";
import { probeSource } from "./health.js";
import { getChapterPages, getMangaDetails, searchManga } from "./manga/atsu.js";
@@ -20,11 +21,37 @@ export default class VylaSDK {
this.tmdbApiKey = tmdbApiKey || null;
this.penguManifest = penguManifest || null;
}
getSources(excludeDisabled = false) {
if (excludeDisabled) {
return SOURCES.filter(cfg => !cfg.disabled);
getSources(excludeDisabled = false, dedicated = null) {
let list = SOURCES;
if (dedicated === true) {
list = DEDICATED_SOURCES;
} else if (dedicated === false) {
list = AGGREGATOR_SOURCES;
}
return SOURCES;
if (excludeDisabled) {
return list.filter(cfg => !cfg.disabled);
}
return list;
}
getEmbeds({ ads = null } = {}) {
if (typeof ads === 'boolean') {
return EMBEDS.filter(cfg => cfg.ads === ads);
}
return EMBEDS;
}
getEmbedUrl(key, id, s = null, e = null) {
const cfg = EMBED_MAP[key];
if (!cfg) throw new Error(`Embed with key "${key}" not found`);
const isTv = s != null && e != null;
const template = isTv ? cfg.tv : cfg.movie;
if (!template || id == null) return null;
let url = template.replace('{id}', encodeURIComponent(String(id)));
if (isTv) {
url = url
.replace('{s}', encodeURIComponent(String(s)))
.replace('{e}', encodeURIComponent(String(e)));
}
return url;
}
async probeAllSources() {
const active = SOURCES.filter(cfg => !cfg.disabled);

View File

@@ -1,39 +0,0 @@
import { fetchJson, resolveImdbId, resolveTmdbKey } from '../utils/helpers.js';
const BASE_URL = 'https://froststream.cloutteam.com';
export async function getStream(args) {
const { id, s, e, sdk } = args || {};
const isTv = s != null && e != null;
const type = isTv ? 'series' : 'movie';
const apiKey = resolveTmdbKey(args, sdk);
const imdb = await resolveImdbId(id, isTv, apiKey);
if (!imdb) return null;
const url = isTv
? `${BASE_URL}/stream/series/${imdb}:${s}:${e}.json`
: `${BASE_URL}/stream/movie/${imdb}.json`;
const res = await fetchJson(url).catch(() => null);
if (!res || !Array.isArray(res.streams) || !res.streams.length) return null;
const allUrls = res.streams
.filter(st => st.url)
.map(st => ({
url: st.url,
server: `Frost - ${st.name || 'Server'}${st.title ? ` - ${st.title}` : ''}`,
quality: 'Auto',
type: st.url.includes('.m3u8') ? 'hls' : 'mp4',
headers: st.behaviorHints?.proxyHeaders?.request || undefined,
skipProxy: st.behaviorHints?.notWebReady === false,
}));
if (!allUrls.length) return null;
return {
url: allUrls[0].url,
headers: allUrls[0].headers,
allUrls,
};
}