@vyla-entertainment/sdk 1.11.0 → 1.13.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 +80 -245
- 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/dulo.js +150 -0
- package/src/sources/movienight.js +117 -0
- package/src/sources/movy.js +282 -0
- package/src/sources/purstream.js +2 -2
- package/src/sources/streamaggregator.js +129 -0
- package/src/sources/vidvault.js +131 -57
- 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/cinejoy.js +0 -195
- package/src/sources/cinesrc.js +0 -212
- package/src/sources/cinesu.js +0 -148
- package/src/sources/frame.js +0 -88
- package/src/sources/fsharetv.js +0 -44
- package/src/sources/fsonic.js +0 -49
- package/src/sources/hexa.js +0 -82
- package/src/sources/luna.js +0 -125
- package/src/sources/mapple.js +0 -151
- package/src/sources/megasource.js +0 -47
- package/src/sources/meowtv.js +0 -103
- package/src/sources/nova.js +0 -46
- package/src/sources/peestream.js +0 -122
- package/src/sources/vidcore.js +0 -43
- package/src/sources/videasy.js +0 -94
- package/src/sources/vidfast.js +0 -53
- package/src/sources/xpass.js +0 -40
- package/src/sources/zxcstream.js +0 -141
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
|
-
}
|
package/src/sources/zxcstream.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import crypto from 'crypto';
|
|
2
|
-
import { getTmdbInfo, getUA } from '../utils/helpers.js';
|
|
3
|
-
|
|
4
|
-
const BASE_URL = 'https://player.zxcstream.xyz';
|
|
5
|
-
const AES_KEY = '7f4c9e2a81d63b05c4f7a9e8126d3b50e1a8c7f23d9465ab0c6e9f1d4a7b832c';
|
|
6
|
-
const SERVERS = ['berkas', 'orion', 'aquarius', 'resshin'];
|
|
7
|
-
|
|
8
|
-
function decryptCryptoJS(ciphertextB64, passphrase) {
|
|
9
|
-
try {
|
|
10
|
-
const buf = Buffer.from(ciphertextB64, 'base64');
|
|
11
|
-
if (buf.slice(0, 8).toString('utf8') !== 'Salted__') {
|
|
12
|
-
const key = crypto.createHash('md5').update(passphrase).digest();
|
|
13
|
-
const iv = Buffer.alloc(16, 0);
|
|
14
|
-
const decipher = crypto.createDecipheriv('aes-128-cbc', key, iv);
|
|
15
|
-
return Buffer.concat([decipher.update(buf), decipher.final()]).toString('utf8');
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const salt = buf.slice(8, 16);
|
|
19
|
-
const cipherBytes = buf.slice(16);
|
|
20
|
-
|
|
21
|
-
let hash = Buffer.alloc(0);
|
|
22
|
-
let keyAndIv = Buffer.alloc(0);
|
|
23
|
-
while (keyAndIv.length < 48) {
|
|
24
|
-
hash = crypto.createHash('md5').update(Buffer.concat([hash, Buffer.from(passphrase), salt])).digest();
|
|
25
|
-
keyAndIv = Buffer.concat([keyAndIv, hash]);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const key = keyAndIv.slice(0, 32);
|
|
29
|
-
const iv = keyAndIv.slice(32, 48);
|
|
30
|
-
|
|
31
|
-
const decipher = crypto.createDecipheriv('aes-256-cbc', key, iv);
|
|
32
|
-
return Buffer.concat([decipher.update(cipherBytes), decipher.final()]).toString('utf8');
|
|
33
|
-
} catch {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export async function getStream({ id, s, e }) {
|
|
39
|
-
try {
|
|
40
|
-
const isTv = Boolean(s && e);
|
|
41
|
-
const mediaType = isTv ? 'tv' : 'movie';
|
|
42
|
-
|
|
43
|
-
let title = 'Media';
|
|
44
|
-
let year = '2024';
|
|
45
|
-
|
|
46
|
-
try {
|
|
47
|
-
const info = await getTmdbInfo(id, mediaType, s);
|
|
48
|
-
if (info?.title) title = info.title;
|
|
49
|
-
if (info?.year) year = String(info.year);
|
|
50
|
-
} catch { }
|
|
51
|
-
|
|
52
|
-
const headers = {
|
|
53
|
-
'User-Agent': getUA(),
|
|
54
|
-
Referer: `${BASE_URL}/`,
|
|
55
|
-
Origin: BASE_URL,
|
|
56
|
-
Accept: 'application/json, text/plain, */*',
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const serverResults = await Promise.all(
|
|
60
|
-
SERVERS.map(async (server) => {
|
|
61
|
-
try {
|
|
62
|
-
const tokenRes = await fetch(`${BASE_URL}/backend/you-are-gay`, {
|
|
63
|
-
method: 'POST',
|
|
64
|
-
headers: { ...headers, 'Content-Type': 'application/json' },
|
|
65
|
-
body: JSON.stringify({
|
|
66
|
-
id,
|
|
67
|
-
media_type: mediaType,
|
|
68
|
-
path: server,
|
|
69
|
-
...(isTv ? { season: Number(s || 1), episode: Number(e || 1) } : {}),
|
|
70
|
-
}),
|
|
71
|
-
signal: AbortSignal.timeout(8000),
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
if (!tokenRes.ok) return [];
|
|
75
|
-
const tokenData = await tokenRes.json();
|
|
76
|
-
if (!tokenData?.token) return [];
|
|
77
|
-
|
|
78
|
-
const params = new URLSearchParams({
|
|
79
|
-
id,
|
|
80
|
-
b: mediaType,
|
|
81
|
-
ts: String(tokenData.ts),
|
|
82
|
-
token: tokenData.token,
|
|
83
|
-
title,
|
|
84
|
-
year,
|
|
85
|
-
date: year,
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
if (isTv) {
|
|
89
|
-
params.append('season', String(s || 1));
|
|
90
|
-
params.append('episode', String(e || 1));
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const sourcesRes = await fetch(`${BASE_URL}/backend_/sources/${server}?${params.toString()}`, {
|
|
94
|
-
headers,
|
|
95
|
-
signal: AbortSignal.timeout(8000),
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
if (!sourcesRes.ok) return [];
|
|
99
|
-
const sourcesData = await sourcesRes.json();
|
|
100
|
-
|
|
101
|
-
const links = [];
|
|
102
|
-
if (Array.isArray(sourcesData?.links)) {
|
|
103
|
-
for (const item of sourcesData.links) {
|
|
104
|
-
if (!item.link) continue;
|
|
105
|
-
const decryptedUrl = decryptCryptoJS(item.link, AES_KEY);
|
|
106
|
-
if (decryptedUrl && decryptedUrl.startsWith('http')) {
|
|
107
|
-
links.push({
|
|
108
|
-
url: decryptedUrl,
|
|
109
|
-
type: decryptedUrl.includes('.m3u8') ? 'hls' : decryptedUrl.includes('.mpd') ? 'dash' : 'mp4',
|
|
110
|
-
quality: item.resolution || 'Auto',
|
|
111
|
-
server: `ZxcStream-${server.toUpperCase()}`,
|
|
112
|
-
headers: {
|
|
113
|
-
Referer: `${BASE_URL}/`,
|
|
114
|
-
Origin: BASE_URL,
|
|
115
|
-
},
|
|
116
|
-
skipProxy: true,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
return links;
|
|
123
|
-
} catch {
|
|
124
|
-
return [];
|
|
125
|
-
}
|
|
126
|
-
})
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
const allUrls = serverResults.flat();
|
|
130
|
-
if (!allUrls.length) return null;
|
|
131
|
-
|
|
132
|
-
return { allUrls };
|
|
133
|
-
} catch {
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export async function getSources(args) {
|
|
139
|
-
const stream = await getStream(args);
|
|
140
|
-
return stream?.allUrls ? [...new Set(stream.allUrls.map(u => u.server))] : [];
|
|
141
|
-
}
|