@vyla-entertainment/sdk 1.10.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/config.js +212 -98
- package/src/downloads/downloads.js +51 -10
- package/src/sdk.d.ts +0 -1
- package/src/sdk.js +1 -1
- package/src/sources/111477.js +101 -0
- package/src/sources/4khdhub.js +324 -0
- package/src/sources/bcine.js +202 -0
- package/src/sources/cinesrc.js +212 -0
- package/src/sources/cinesu.js +148 -0
- package/src/sources/downloadeverything.js +338 -0
- package/src/sources/meowtv.js +42 -3
- package/src/sources/movienight.js +117 -0
- package/src/sources/movy.js +282 -0
- package/src/sources/pstream.js +68 -0
- package/src/sources/purstream.js +2 -2
- package/src/sources/streamaggregator.js +127 -0
- package/src/sources/vadapav.js +85 -0
- package/src/sources/vidvault.js +131 -57
- package/src/sources/vuflix.js +249 -0
- package/src/sources/xdownloader.js +129 -0
- package/src/subtitles.js +35 -40
- package/src/downloads/sources/trendimovies.js +0 -63
- package/src/sources/anipm.js +0 -70
- package/src/sources/mapple.js +0 -151
- package/src/sources/megasource.js +0 -47
- package/src/sources/nova.js +0 -46
- package/src/sources/videasy.js +0 -94
- package/src/sources/vidrift.js +0 -95
- package/src/sources/vidsync.js +0 -38
- package/src/sources/xpass.js +0 -40
package/src/sources/videasy.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { getTmdbInfo, fetchJson, fetchText, USER_AGENT } from '../utils/helpers.js';
|
|
2
|
-
|
|
3
|
-
const SPEEDRACE_BASE = "https://api.speedracelight.com";
|
|
4
|
-
const HEADERS = { "Accept": "*/*", "Origin": "https://player.videasy.to", "Referer": "https://player.videasy.to/", "User-Agent": USER_AGENT };
|
|
5
|
-
const SERVERS = [
|
|
6
|
-
{ id: 'cdn', name: 'Yoru' },
|
|
7
|
-
{ id: 'm4uhd', name: 'Breach' },
|
|
8
|
-
{ id: 'vsrc', name: 'Neon' },
|
|
9
|
-
{ id: 'hdmovie', name: 'Vyse' },
|
|
10
|
-
{ id: 'meine', name: 'Killjoy' },
|
|
11
|
-
{ id: 'lamovie', name: 'Omen' },
|
|
12
|
-
{ id: 'superflix', name: 'Raze' }
|
|
13
|
-
];
|
|
14
|
-
|
|
15
|
-
export async function getStream({ id, s, e, server, sdk }) {
|
|
16
|
-
const tmdbApiKey = sdk?.tmdbApiKey || null;
|
|
17
|
-
if (!tmdbApiKey) return null;
|
|
18
|
-
try {
|
|
19
|
-
const isTv = s != null && e != null;
|
|
20
|
-
const info = await getTmdbInfo(tmdbApiKey, id, isTv ? 'tv' : 'movie');
|
|
21
|
-
if (!info?.titles?.length) return null;
|
|
22
|
-
|
|
23
|
-
const seedData = await fetchJson(`${SPEEDRACE_BASE}/seed?mediaId=${id}`, { headers: HEADERS, signal: AbortSignal.timeout(5000) });
|
|
24
|
-
const seed = seedData?.seed;
|
|
25
|
-
if (!seed) return null;
|
|
26
|
-
|
|
27
|
-
const encTitle = encodeURIComponent(encodeURIComponent(info.titles[0]));
|
|
28
|
-
let targets = SERVERS;
|
|
29
|
-
|
|
30
|
-
if (server && server !== 'all') {
|
|
31
|
-
const cleanName = server.replace('VidEasy - ', '');
|
|
32
|
-
targets = SERVERS.filter(sv => sv.name === cleanName);
|
|
33
|
-
if (!targets.length) targets = SERVERS;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const settled = await Promise.allSettled(targets.map(async srv => {
|
|
37
|
-
let url = `${SPEEDRACE_BASE}/${srv.id}/sources-with-title?title=${encTitle}&mediaType=${isTv ? 'tv' : 'movie'}&year=${info.year || ''}&tmdbId=${id}&imdbId=${info.imdbId || "tt0000000"}&enc=2&seed=${seed}`;
|
|
38
|
-
if (isTv) url += `&episodeId=${e}&seasonId=${s}`;
|
|
39
|
-
|
|
40
|
-
const encText = await fetchText(url, { headers: HEADERS, signal: AbortSignal.timeout(10000) });
|
|
41
|
-
const decJson = await fetchJson("https://enc-dec.app/api/dec-videasy", {
|
|
42
|
-
method: 'POST',
|
|
43
|
-
headers: { 'Content-Type': 'application/json' },
|
|
44
|
-
body: JSON.stringify({ text: encText, id: String(id), seed }),
|
|
45
|
-
signal: AbortSignal.timeout(10000)
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
if (decJson.status !== 200 || !decJson.result) throw new Error();
|
|
49
|
-
|
|
50
|
-
let sourcesArray = [];
|
|
51
|
-
let subsArray = [];
|
|
52
|
-
|
|
53
|
-
if (Array.isArray(decJson.result)) {
|
|
54
|
-
sourcesArray = decJson.result;
|
|
55
|
-
} else if (decJson.result.sources && Array.isArray(decJson.result.sources)) {
|
|
56
|
-
sourcesArray = decJson.result.sources;
|
|
57
|
-
if (decJson.result.subtitles && Array.isArray(decJson.result.subtitles)) {
|
|
58
|
-
subsArray = decJson.result.subtitles.map(sub => ({
|
|
59
|
-
url: sub.url || sub.file,
|
|
60
|
-
lang: sub.language || sub.lang || sub.label || 'Unknown'
|
|
61
|
-
})).filter(sub => sub.url);
|
|
62
|
-
}
|
|
63
|
-
} else {
|
|
64
|
-
sourcesArray = [decJson.result];
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return sourcesArray.map(res => {
|
|
68
|
-
const streamUrl = res.url || res.file || res.link || res.playlist || res.stream;
|
|
69
|
-
return streamUrl ? {
|
|
70
|
-
url: streamUrl,
|
|
71
|
-
quality: res.quality || "Auto",
|
|
72
|
-
server: `VidEasy - ${srv.name}`,
|
|
73
|
-
type: streamUrl.includes('.m3u8') ? 'hls' : 'mp4',
|
|
74
|
-
headers: HEADERS,
|
|
75
|
-
subtitles: subsArray.length > 0 ? subsArray : undefined,
|
|
76
|
-
skipProxy: false,
|
|
77
|
-
skipVerify: true,
|
|
78
|
-
skipHlsCheck: true
|
|
79
|
-
} : null;
|
|
80
|
-
}).filter(Boolean);
|
|
81
|
-
}));
|
|
82
|
-
|
|
83
|
-
const allUrls = [];
|
|
84
|
-
for (const r of settled) {
|
|
85
|
-
if (r.status === 'fulfilled' && r.value) allUrls.push(...r.value);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return allUrls.length ? { allUrls } : null;
|
|
89
|
-
} catch { return null; }
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export async function getSources() {
|
|
93
|
-
return SERVERS.map(s => `VidEasy - ${s.name}`);
|
|
94
|
-
}
|
package/src/sources/vidrift.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const BASE = "https://embed.vidrift.in";
|
|
4
|
-
|
|
5
|
-
const DEFAULT_HEADERS = {
|
|
6
|
-
"Accept": "*/*",
|
|
7
|
-
"Accept-Language": "en-US,en;q=0.9",
|
|
8
|
-
"Cache-Control": "no-cache",
|
|
9
|
-
"Pragma": "no-cache",
|
|
10
|
-
"Referer": `${BASE}/`,
|
|
11
|
-
"Origin": BASE,
|
|
12
|
-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36 Edg/150.0.0.0"
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
function decodeStreams(encodedStr) {
|
|
16
|
-
try {
|
|
17
|
-
const base64Str = encodedStr.replace(/-/g, '+').replace(/_/g, '/');
|
|
18
|
-
|
|
19
|
-
const binaryStr = typeof atob === 'function'
|
|
20
|
-
? atob(base64Str)
|
|
21
|
-
: Buffer.from(base64Str, 'base64').toString('binary');
|
|
22
|
-
|
|
23
|
-
const bytes = new Uint8Array(binaryStr.length);
|
|
24
|
-
for (let i = 0; i < binaryStr.length; i++) {
|
|
25
|
-
bytes[i] = binaryStr.charCodeAt(i);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const key = bytes[0];
|
|
29
|
-
let decodedStr = '';
|
|
30
|
-
for (let i = 1; i < bytes.length; i++) {
|
|
31
|
-
decodedStr += String.fromCharCode(bytes[i] ^ key);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return JSON.parse(decodedStr);
|
|
35
|
-
} catch (e) {
|
|
36
|
-
return [];
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export async function getStream(args) {
|
|
41
|
-
const { id, s, e, server: serverName } = args;
|
|
42
|
-
const type = s != null && e != null ? "tv" : "movie";
|
|
43
|
-
|
|
44
|
-
const endpoint = type === "tv"
|
|
45
|
-
? `${BASE}/embed/tv/${id}/${s}/${e}`
|
|
46
|
-
: `${BASE}/embed/movie/${id}`;
|
|
47
|
-
|
|
48
|
-
try {
|
|
49
|
-
const res = await fetch(endpoint, {
|
|
50
|
-
headers: {
|
|
51
|
-
...DEFAULT_HEADERS,
|
|
52
|
-
"Accept": "text/html",
|
|
53
|
-
},
|
|
54
|
-
signal: AbortSignal.timeout(10000)
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
if (!res.ok) return null;
|
|
58
|
-
|
|
59
|
-
const html = await res.text();
|
|
60
|
-
|
|
61
|
-
const match = html.match(/var\s+_s\s*=\s*['"]([^'"]+)['"]/);
|
|
62
|
-
if (!match) return null;
|
|
63
|
-
|
|
64
|
-
const encodedStreams = match[1];
|
|
65
|
-
const streamsData = decodeStreams(encodedStreams);
|
|
66
|
-
|
|
67
|
-
if (!Array.isArray(streamsData) || !streamsData.length) {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const allUrls = streamsData.map((stream, index) => ({
|
|
72
|
-
url: stream.url.startsWith("http")
|
|
73
|
-
? stream.url
|
|
74
|
-
: `${BASE}${stream.url}`,
|
|
75
|
-
server: stream.label || `VidRift - Server ${index + 1}`,
|
|
76
|
-
type: "hls",
|
|
77
|
-
headers: DEFAULT_HEADERS
|
|
78
|
-
}));
|
|
79
|
-
|
|
80
|
-
if (serverName && serverName !== "all") {
|
|
81
|
-
const filtered = allUrls.filter(x => x.server === serverName);
|
|
82
|
-
return filtered.length ? { allUrls: filtered } : null;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return { allUrls };
|
|
86
|
-
} catch (err) {
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export async function getSources(args) {
|
|
92
|
-
const res = await getStream(args);
|
|
93
|
-
if (!res?.allUrls) return ["VidRift - Server 1"];
|
|
94
|
-
return res.allUrls.map(x => x.server);
|
|
95
|
-
}
|
package/src/sources/vidsync.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { fetchJson, fetchText, USER_AGENT, getTmdbInfo } from '../utils/helpers.js';
|
|
2
|
-
|
|
3
|
-
const API_BASE = "https://enc-dec.app/api";
|
|
4
|
-
const DOMAIN = "https://vidsync.xyz";
|
|
5
|
-
const HEADERS = { "Accept": "*/*", "Origin": DOMAIN, "Referer": `${DOMAIN}/`, "User-Agent": USER_AGENT, "X-Requested-With": "XMLHttpRequest" };
|
|
6
|
-
const SERVERS = ["cinevault", "cinedub", "cinebox", "cineflix", "cinevip", "cinecloud", "cine4k"];
|
|
7
|
-
|
|
8
|
-
export async function getStream({ id, s, e, server }) {
|
|
9
|
-
try {
|
|
10
|
-
const isTv = s != null && e != null;
|
|
11
|
-
const type = isTv ? 'tv' : 'movie';
|
|
12
|
-
const info = await getTmdbInfo(id, type);
|
|
13
|
-
if (!info?.titles?.length) return null;
|
|
14
|
-
const turnstileJson = await fetchJson(`${API_BASE}/enc-vidsync`, { signal: AbortSignal.timeout(5000) });
|
|
15
|
-
if (turnstileJson.status !== 200 || !turnstileJson.result?.token) return null;
|
|
16
|
-
const turnstileToken = turnstileJson.result.token;
|
|
17
|
-
let targets = SERVERS;
|
|
18
|
-
if (server && server !== 'all') {
|
|
19
|
-
const clean = server.replace('VidSync - ', '');
|
|
20
|
-
targets = SERVERS.includes(clean) ? [clean] : SERVERS;
|
|
21
|
-
}
|
|
22
|
-
const encTitle = encodeURIComponent(info.titles[0]).replace(/%20/g, '+');
|
|
23
|
-
const results = await Promise.allSettled(targets.map(async srv => {
|
|
24
|
-
let url = `${DOMAIN}/api/stream/fetch?title=${encTitle}&type=${type}&releaseYear=${info.year}&mediaId=${id}&serverName=${srv}`;
|
|
25
|
-
if (isTv) url += `&season=${s}&episode=${e}`;
|
|
26
|
-
const encryptedText = await fetchText(url, { headers: { ...HEADERS, "X-Cf-Turnstile": turnstileToken }, signal: AbortSignal.timeout(10000) });
|
|
27
|
-
const decJson = await fetchJson(`${API_BASE}/dec-vidsync`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ text: encryptedText, id: String(id) }), signal: AbortSignal.timeout(10000) });
|
|
28
|
-
if (decJson.status !== 200 || !decJson.result) throw new Error();
|
|
29
|
-
const streams = Array.isArray(decJson.result) ? decJson.result : [decJson.result];
|
|
30
|
-
return streams.map(st => ({ url: st.url || st.file, server: `VidSync - ${srv}`, quality: st.quality || "Auto", type: (st.url || st.file || "").includes(".m3u8") ? "hls" : "mp4", headers: { ...HEADERS, "Origin": DOMAIN }, skipProxy: false, skipVerify: true, skipHlsCheck: true }));
|
|
31
|
-
}));
|
|
32
|
-
const allUrls = [];
|
|
33
|
-
for (const r of results) if (r.status === 'fulfilled') allUrls.push(...r.value);
|
|
34
|
-
return allUrls.length ? { allUrls } : null;
|
|
35
|
-
} catch { return null; }
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export async function getSources() { return SERVERS.map(s => `VidSync - ${s}`); }
|
package/src/sources/xpass.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { fetchJson, fetchText, USER_AGENT } from '../utils/helpers.js';
|
|
2
|
-
|
|
3
|
-
const BASE = "https://play.xpass.top";
|
|
4
|
-
const HEADERS = { "accept": "*/*", "accept-language": "en-US,en;q=0.9", "cache-control": "no-cache", "pragma": "no-cache", "User-Agent": USER_AGENT, "Origin": BASE, "Referrer": `${BASE}/`, "Cookie": "auth_token=de21073d24bca9b50f189b402ac870734cf945f2085cb7e1a4fc453fcfe4f57e" };
|
|
5
|
-
|
|
6
|
-
export async function getStream({ id, s, e, server }) {
|
|
7
|
-
const isTv = s && e && s !== 'null' && e !== 'null';
|
|
8
|
-
const hdrs = { ...HEADERS, referer: `${BASE}/e/${isTv ? 'tv' : 'movie'}/${id}?autostart=true` };
|
|
9
|
-
try {
|
|
10
|
-
let sources = [];
|
|
11
|
-
if (!isTv) {
|
|
12
|
-
const text = await fetchText(`${BASE}/e/movie/${id}?autostart=true`, { headers: hdrs, signal: AbortSignal.timeout(7000) });
|
|
13
|
-
const match = text.match(/var backups=(\[[\s\S]*?\])/);
|
|
14
|
-
if (match) sources = JSON.parse(match[1]);
|
|
15
|
-
} else {
|
|
16
|
-
sources = await fetchJson(`${BASE}/data/tv/${id}/${s}/${e}?autostart=true&force=true`, { headers: hdrs, signal: AbortSignal.timeout(7000) });
|
|
17
|
-
}
|
|
18
|
-
if (!sources?.length) return null;
|
|
19
|
-
if (server && server !== 'all') {
|
|
20
|
-
const exact = sources.find(src => src.name === server.replace('XPass - ', ''));
|
|
21
|
-
if (exact) sources = [exact]; else return null;
|
|
22
|
-
}
|
|
23
|
-
const allUrls = [];
|
|
24
|
-
for (const source of sources) {
|
|
25
|
-
if (!source.url) continue;
|
|
26
|
-
try {
|
|
27
|
-
const mdata = await fetchJson(`${BASE}${source.url}`, { headers: hdrs, signal: AbortSignal.timeout(5000) });
|
|
28
|
-
if (!mdata?.playlist?.[0]?.sources) continue;
|
|
29
|
-
const targetStream = mdata.playlist[0].sources.find(st => st.type === 'hls') || mdata.playlist[0].sources[0];
|
|
30
|
-
if (targetStream?.file) allUrls.push({ server: `XPass - ${source.name}`, type: targetStream.type === 'hls' ? 'hls' : 'mp4', url: targetStream.file, headers: { "Origin": HEADERS.Origin, "Referer": HEADERS.Referrer, "User-Agent": HEADERS["User-Agent"] } });
|
|
31
|
-
} catch { }
|
|
32
|
-
}
|
|
33
|
-
return allUrls.length ? { allUrls } : null;
|
|
34
|
-
} catch { return null; }
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export async function getSources(args) {
|
|
38
|
-
const stream = await getStream(args);
|
|
39
|
-
return stream?.allUrls ? stream.allUrls.map(u => u.server) : [];
|
|
40
|
-
}
|