@vyla-entertainment/sdk 1.20.0 → 1.21.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.
Files changed (52) hide show
  1. package/package.json +3 -2
  2. package/src/config.js +10 -85
  3. package/src/sdk.d.ts +94 -121
  4. package/src/sdk.js +82 -78
  5. package/src/sources/111477.js +88 -100
  6. package/src/sources/123anime.js +120 -56
  7. package/src/sources/3eyedraven.js +82 -135
  8. package/src/sources/cinecat.js +37 -18
  9. package/src/sources/cinemaarmy.js +179 -180
  10. package/src/sources/cinesrc.js +401 -397
  11. package/src/sources/cno.js +101 -94
  12. package/src/sources/dulo.js +134 -149
  13. package/src/sources/flaxmovies.js +114 -105
  14. package/src/sources/frost.js +38 -29
  15. package/src/sources/fsonline.js +95 -47
  16. package/src/sources/hdhub.js +43 -36
  17. package/src/sources/hexa.js +60 -53
  18. package/src/sources/hyper.js +42 -35
  19. package/src/sources/kickassanime.js +117 -124
  20. package/src/sources/kisskh.js +114 -59
  21. package/src/sources/lmscript.js +72 -70
  22. package/src/sources/lookmovie.js +80 -79
  23. package/src/sources/movenerds.js +74 -124
  24. package/src/sources/movy.js +197 -209
  25. package/src/sources/net79.js +59 -55
  26. package/src/sources/peestream.js +126 -138
  27. package/src/sources/pengu.js +46 -49
  28. package/src/sources/pstream.js +73 -67
  29. package/src/sources/purstream.js +96 -104
  30. package/src/sources/rivestream.js +182 -176
  31. package/src/sources/rivo.js +58 -53
  32. package/src/sources/streamaggregator.js +114 -128
  33. package/src/sources/thugtv.js +70 -62
  34. package/src/sources/vidapi.js +122 -114
  35. package/src/sources/vidcore.js +14 -122
  36. package/src/sources/vidfast.js +14 -122
  37. package/src/sources/vidlink.js +78 -27
  38. package/src/sources/vidup.js +14 -122
  39. package/src/sources/vidvault.js +133 -187
  40. package/src/sources/vidy.js +192 -187
  41. package/src/sources/vidzee.js +189 -183
  42. package/src/sources/vixsrc.js +123 -113
  43. package/src/sources/watchout.js +60 -46
  44. package/src/sources/xdownloader.js +127 -128
  45. package/src/sources/yapgrid.js +68 -62
  46. package/src/sources/yastream.js +35 -29
  47. package/src/subtitles.js +105 -122
  48. package/src/utils/helpers.js +586 -247
  49. package/src/sources/bcine.js +0 -202
  50. package/src/sources/cinezo.js +0 -55
  51. package/src/sources/vidora.js +0 -62
  52. package/src/sources/vidrock.js +0 -145
@@ -1,202 +0,0 @@
1
- import { USER_AGENT } from '../utils/helpers.js';
2
-
3
- const _sInit = [23, 27, 30, 31, 86, 28, 19, 86, 9, 18, 19, 21, 26, 27, 86, 120, 114, 120, 116, 86, 9, 18, 19, 21, 26, 27, 122, 89, 25, 23];
4
- const _vParam = `_v=${(_sInit[15] ^ 0x5a)}${(_sInit[16] ^ 0x5a)}${(_sInit[17] ^ 0x5a)}${(_sInit[18] ^ 0x5a)}`;
5
-
6
- const nD = '4860ac8bfddb';
7
- const aD = '224eff10e662e9635c9f671cf46351dcd69af42b1edd56f5e5fa21751f44b9c8';
8
- const Ls = [17, 91, 203, 44, 8, 177, 62, 239, 119, 3, 154, 81, 28, 210, 101, 7];
9
- const wa = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
10
-
11
- const SERVERS = [
12
- { id: 'NIGHT', endpoint: '/server/night' },
13
- { id: 'EMP', endpoint: '/server/emp' },
14
- { id: 'MAIN', endpoint: '/server/vidsrc' }
15
- ];
16
-
17
- const CORS_PROXY = 'https://eve.pstream.cfd';
18
- let cachedToken = null;
19
- let tokenExpiry = 0;
20
-
21
- function ab(e) {
22
- let t = e >>> 0;
23
- t ^= t >>> 16;
24
- t = Math.imul(t, 2146121005) >>> 0;
25
- t ^= t >>> 15;
26
- t = Math.imul(t, 2221713035) >>> 0;
27
- return (t ^ (t >>> 16)) >>> 0;
28
- }
29
-
30
- function sD(e) {
31
- const t = new TextEncoder().encode(aD);
32
- const r = Math.max(32, Math.min(128, e + 17));
33
- const n = new Uint8Array(r);
34
- let a = 2166136261;
35
- for (let s = 0; s < r; s += 1) {
36
- a ^= t[s % t.length] ?? s;
37
- a = ab((a + Ls[s % Ls.length] + ((2654435761 * s) >>> 0)) >>> 0);
38
- n[s] = a & 255;
39
- }
40
- return n;
41
- }
42
-
43
- function iD(e) {
44
- let t = '';
45
- for (let r = 0; r < e.length; r += 3) {
46
- const n = e[r];
47
- const a = e[r + 1];
48
- const s = e[r + 2];
49
- t += wa[n >>> 2];
50
- t += wa[((3 & n) << 4) | ((a ?? 0) >>> 4)];
51
- if (a === undefined) break;
52
- t += wa[((15 & a) << 2) | ((s ?? 0) >>> 6)];
53
- if (s === undefined) break;
54
- t += wa[63 & s];
55
- }
56
- return t;
57
- }
58
-
59
- function generateDirectHlsUrl(id, s, e) {
60
- const isTv = s != null && e != null;
61
- const tmdbId = Math.floor(Number(id));
62
- const season = isTv ? Math.floor(Number(s || 1)) : 0;
63
- const episode = isTv ? Math.floor(Number(e || 1)) : 0;
64
-
65
- const str = `${nD}:${isTv ? 's' : 'm'}:${tmdbId}:${season}:${episode}`;
66
- const a = new TextEncoder().encode(str);
67
- const sArr = sD(a.length);
68
- const i = new Uint8Array(a.length + 2);
69
- i[0] = a.length & 255;
70
- i[1] = (a.length >>> 8) & 255;
71
- let o = (2654435769 ^ a.length) >>> 0;
72
- for (let l = 0; l < a.length; l += 1) {
73
- o = ab((o + sArr[l % sArr.length] + Ls[l % Ls.length] + l) >>> 0);
74
- i[l + 2] = (a[l] ^ (255 & o)) ^ sArr[(7 * l + 3) % sArr.length];
75
- }
76
-
77
- return `https://glendale-plumbing.com/c/v1/${iD(i)}/master.m3u8`;
78
- }
79
-
80
- async function fetchInternalToken() {
81
- if (cachedToken && Date.now() < tokenExpiry) return cachedToken;
82
- try {
83
- const res = await fetch('https://1embed.cc/api/token', {
84
- headers: {
85
- 'User-Agent': USER_AGENT,
86
- 'Referer': 'https://1embed.cc/',
87
- 'Accept': 'application/json, text/plain, */*'
88
- },
89
- signal: AbortSignal.timeout(4000)
90
- });
91
- if (res.ok) {
92
- const data = await res.json();
93
- if (data?.token) {
94
- cachedToken = data.token;
95
- tokenExpiry = Date.now() + 1800 * 1000;
96
- return cachedToken;
97
- }
98
- }
99
- } catch { }
100
-
101
- try {
102
- const proxiedUrl = `${CORS_PROXY}/?destination=${encodeURIComponent('https://1embed.cc/api/token')}`;
103
- const res = await fetch(proxiedUrl, {
104
- headers: {
105
- 'X-Referer': 'https://1embed.cc/',
106
- 'X-User-Agent': USER_AGENT
107
- },
108
- signal: AbortSignal.timeout(4000)
109
- });
110
- if (res.ok) {
111
- const data = await res.json();
112
- if (data?.token) {
113
- cachedToken = data.token;
114
- tokenExpiry = Date.now() + 1800 * 1000;
115
- return cachedToken;
116
- }
117
- }
118
- } catch { }
119
-
120
- return '';
121
- }
122
-
123
- export async function getStream(args) {
124
- const { id, s, e, clientIP } = args;
125
- const isTv = s != null && e != null;
126
- const isMovie = !isTv;
127
- const allUrls = [];
128
-
129
- const directHlsUrl = generateDirectHlsUrl(id, s, e);
130
- const masterUrlWithMark = `${directHlsUrl}?${_vParam}`;
131
-
132
- allUrls.push({
133
- url: masterUrlWithMark,
134
- server: 'Bcine (Direct Master)',
135
- quality: 'Auto',
136
- type: 'hls',
137
- headers: {
138
- 'User-Agent': USER_AGENT,
139
- 'Referer': 'https://bcine.ru/',
140
- 'Origin': 'https://bcine.ru',
141
- ...(clientIP && { 'X-Forwarded-For': clientIP })
142
- }
143
- });
144
-
145
- const token = await fetchInternalToken();
146
-
147
- await Promise.allSettled(
148
- SERVERS.map(async (server) => {
149
- const query = isTv
150
- ? `id=${id}?type=tv&s=${s || 1}&e=${e || 1}`
151
- : `id=${id}?type=movie`;
152
-
153
- const stParam = token ? `&_st=${token}` : '';
154
- const targetUrl = `https://1embed.cc${server.endpoint}/${query}${stParam}`;
155
-
156
- const headers = {
157
- 'User-Agent': USER_AGENT,
158
- 'Referer': 'https://bcine.ru/',
159
- 'Accept': 'application/json, text/plain, */*',
160
- ...(token && { 'X-Stream-Token': token }),
161
- ...(clientIP && { 'X-Forwarded-For': clientIP })
162
- };
163
-
164
- let res = await fetch(targetUrl, { headers, signal: AbortSignal.timeout(5000) }).catch(() => null);
165
- if (!res || !res.ok) {
166
- const proxiedUrl = `${CORS_PROXY}/?destination=${encodeURIComponent(targetUrl)}`;
167
- res = await fetch(proxiedUrl, {
168
- headers: {
169
- 'X-Referer': 'https://bcine.ru/',
170
- 'X-User-Agent': USER_AGENT
171
- },
172
- signal: AbortSignal.timeout(5000)
173
- }).catch(() => null);
174
- }
175
-
176
- if (res && res.ok) {
177
- try {
178
- const data = await res.json();
179
- if (data && data.success !== false) {
180
- const streamUrl = data.streams?.proxy_m3u8 || data.streams?.raw_m3u8 || data.streams?.m3u8 || data.streamUrl;
181
- if (streamUrl && typeof streamUrl === 'string') {
182
- const urlWithMark = streamUrl.includes('?') ? `${streamUrl}&${_vParam}` : `${streamUrl}?${_vParam}`;
183
- allUrls.push({
184
- url: urlWithMark,
185
- server: `Bcine (${data.selectedSource || data.provider || server.id})`,
186
- quality: 'Auto',
187
- type: streamUrl.includes('.m3u8') ? 'hls' : 'mp4',
188
- headers: {
189
- 'User-Agent': USER_AGENT,
190
- 'Referer': 'https://bcine.ru/',
191
- 'Origin': 'https://bcine.ru'
192
- }
193
- });
194
- }
195
- }
196
- } catch { }
197
- }
198
- })
199
- );
200
-
201
- return allUrls.length ? { allUrls } : null;
202
- }
@@ -1,55 +0,0 @@
1
- import { fetchJson } from '../utils/helpers.js';
2
-
3
- export async function getStream({ id, s, e }) {
4
- const isTv = s != null && e != null;
5
- const referer = isTv
6
- ? `https://player.cinezo.live/embed/tv/${id}?s=${s}&e=${e}`
7
- : `https://player.cinezo.live/embed/movie/${id}`;
8
-
9
- const headers = {
10
- 'Accept': '*/*',
11
- 'Origin': 'https://player.cinezo.live',
12
- 'Referer': referer,
13
- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36 Edg/155.0.0.0'
14
- };
15
-
16
- const hosts = [
17
- 'https://proxy.yenime.net',
18
- 'https://proxy1.flikhub.net'
19
- ];
20
-
21
- const sources = ['zendaya', 'berlin', 'jennifer', 'scarlet'];
22
- const allUrls = [];
23
-
24
- for (const host of hosts) {
25
- for (const source of sources) {
26
- const url = isTv
27
- ? `${host}/tv?id=${id}&season=${s}&episode=${e}&mode=json&sources=${source}&hevc=1`
28
- : `${host}/movie?id=${id}&mode=json&sources=${source}&hevc=1`;
29
-
30
- try {
31
- const res = await fetchJson(url, { headers });
32
- const streamUrl = res?.source?.url;
33
- if (streamUrl) {
34
- allUrls.push({
35
- url: streamUrl,
36
- server: `Cinezo - ${res.source.label || source}`,
37
- headers: {
38
- Referer: 'https://player.cinezo.live/',
39
- Origin: 'https://player.cinezo.live'
40
- }
41
- });
42
- }
43
- } catch { }
44
- }
45
- if (allUrls.length) break;
46
- }
47
-
48
- if (!allUrls.length) return null;
49
-
50
- return {
51
- url: allUrls[0].url,
52
- headers: allUrls[0].headers,
53
- allUrls
54
- };
55
- }
@@ -1,62 +0,0 @@
1
- import { fetchText } from '../utils/helpers.js';
2
-
3
- export async function getStream({ id, s, e }) {
4
- const isTv = s != null && e != null;
5
- const url = isTv
6
- ? `https://vidora-3l2w.onrender.com/api/sources?type=tv&id=${id}&season=${s}&episode=${e}`
7
- : `https://vidora-3l2w.onrender.com/api/sources?type=movie&id=${id}`;
8
-
9
- const headers = {
10
- 'Accept': 'text/event-stream',
11
- 'Referer': 'https://vidora-3l2w.onrender.com/',
12
- 'Origin': 'https://vidora-3l2w.onrender.com',
13
- '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'
14
- };
15
-
16
- const raw = await fetchText(url, { headers }).catch(() => null);
17
- if (!raw) return null;
18
-
19
- const lines = raw.split('\n');
20
- let doneSources = null;
21
- const streamItems = [];
22
-
23
- for (const line of lines) {
24
- const trimmed = line.trim();
25
- if (!trimmed.startsWith('{') || !trimmed.endsWith('}')) continue;
26
-
27
- try {
28
- const parsed = JSON.parse(trimmed);
29
- if (parsed.event === 'source' && parsed.source?.url) {
30
- streamItems.push(parsed.source);
31
- } else if (parsed.event === 'done' && Array.isArray(parsed.sources)) {
32
- doneSources = parsed.sources;
33
- }
34
- } catch { }
35
- }
36
-
37
- const targetList = (doneSources && doneSources.length > 0) ? doneSources : streamItems;
38
- if (!targetList.length) return null;
39
-
40
- const allUrls = [];
41
-
42
- for (const src of targetList) {
43
- if (!src.url || !src.url.startsWith('http')) continue;
44
-
45
- allUrls.push({
46
- url: src.url,
47
- server: `Vidora - ${src.label || src.server || src.providerGroup || 'Server'} (${src.quality || 'Auto'})`,
48
- headers: src.headers || {
49
- Referer: 'https://vidora-3l2w.onrender.com/',
50
- Origin: 'https://vidora-3l2w.onrender.com'
51
- }
52
- });
53
- }
54
-
55
- if (!allUrls.length) return null;
56
-
57
- return {
58
- url: allUrls[0].url,
59
- headers: allUrls[0].headers,
60
- allUrls
61
- };
62
- }
@@ -1,145 +0,0 @@
1
- import { webcrypto } from 'node:crypto';
2
- import { fetchJson, USER_AGENT } from '../utils/helpers.js';
3
-
4
- const GCM_HEX_KEY = '7f3e9c2a8b5d1f4e6a9c3b7d2e5f8a1c4b6d9e2f5a8c1b4d7e9f2a5c8b1d4e7f';
5
- const BASE_URL = 'https://vidrock.ru/';
6
- const PROXY_PREFIX = 'https://proxy.vidrock.store/';
7
-
8
- let cryptoKey = null;
9
-
10
- function hexToBytes(hex) {
11
- const bytes = new Uint8Array(hex.length / 2);
12
-
13
- for (let i = 0; i < bytes.length; i++) {
14
- bytes[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16);
15
- }
16
-
17
- return bytes;
18
- }
19
-
20
- function base64UrlToBytes(value) {
21
- let base64 = value.replace(/-/g, '+').replace(/_/g, '/');
22
-
23
- const padding = base64.length % 4;
24
-
25
- if (padding === 2) {
26
- base64 += '==';
27
- } else if (padding === 3) {
28
- base64 += '=';
29
- } else if (padding === 1) {
30
- throw new Error('Invalid base64url');
31
- }
32
-
33
- return new Uint8Array(Buffer.from(base64, 'base64'));
34
- }
35
-
36
- async function getKey() {
37
- if (cryptoKey) return cryptoKey;
38
-
39
- const keyBytes = hexToBytes(GCM_HEX_KEY);
40
-
41
- cryptoKey = await webcrypto.subtle.importKey(
42
- 'raw',
43
- keyBytes,
44
- 'AES-GCM',
45
- false,
46
- ['decrypt']
47
- );
48
-
49
- return cryptoKey;
50
- }
51
-
52
- async function decryptStreamUrl(value) {
53
- try {
54
- const data = base64UrlToBytes(value);
55
-
56
- if (data.length < 28) {
57
- throw new Error('Ciphertext too short');
58
- }
59
-
60
- const iv = data.slice(0, 12);
61
- const ciphertext = data.slice(12);
62
-
63
- const key = await getKey();
64
-
65
- const decrypted = await webcrypto.subtle.decrypt(
66
- {
67
- name: 'AES-GCM',
68
- iv
69
- },
70
- key,
71
- ciphertext
72
- );
73
-
74
- return new TextDecoder().decode(decrypted);
75
- } catch (error) {
76
- return null;
77
- }
78
- }
79
-
80
- export async function getStream({ id, s, e }) {
81
- try {
82
- const path = s
83
- ? `tv/${id}/${s}/${e || 1}`
84
- : `movie/${id}`;
85
-
86
- const apiData = await fetchJson(`${BASE_URL}api/${path}`, {
87
- headers: {
88
- 'User-Agent': USER_AGENT,
89
- Referer: BASE_URL,
90
- Origin: BASE_URL
91
- }
92
- });
93
-
94
- if (!apiData || typeof apiData !== 'object') {
95
- return null;
96
- }
97
-
98
- const streams = [];
99
-
100
- for (const [provider, info] of Object.entries(apiData)) {
101
- if (!info?.url) {
102
- continue;
103
- }
104
-
105
- const decryptedUrl = await decryptStreamUrl(info.url);
106
-
107
- if (!decryptedUrl) {
108
- continue;
109
- }
110
-
111
- let url = decryptedUrl;
112
-
113
- if (url.startsWith(PROXY_PREFIX)) {
114
- url = decodeURIComponent(
115
- url.slice(PROXY_PREFIX.length).replace(/^\/+/, '')
116
- );
117
- }
118
-
119
- const isXpass = url.includes('xpass.top');
120
-
121
- streams.push({
122
- name: provider,
123
- url,
124
- file: url,
125
- stream: url,
126
- src: url,
127
- quality: info.type || 'auto',
128
- type: info.type || 'hls',
129
- headers: {
130
- 'User-Agent': USER_AGENT,
131
- Referer: isXpass
132
- ? 'https://play.xpass.top/'
133
- : BASE_URL,
134
- Origin: isXpass
135
- ? 'https://play.xpass.top'
136
- : 'https://vidrock.ru'
137
- }
138
- });
139
- }
140
-
141
- return streams.length ? { streams } : null;
142
- } catch (error) {
143
- return null;
144
- }
145
- }