@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.
- package/package.json +3 -2
- package/src/config.js +10 -85
- package/src/sdk.d.ts +94 -121
- package/src/sdk.js +82 -78
- package/src/sources/111477.js +88 -100
- package/src/sources/123anime.js +120 -56
- package/src/sources/3eyedraven.js +82 -135
- package/src/sources/cinecat.js +37 -18
- package/src/sources/cinemaarmy.js +179 -180
- package/src/sources/cinesrc.js +401 -397
- package/src/sources/cno.js +101 -94
- package/src/sources/dulo.js +134 -149
- package/src/sources/flaxmovies.js +114 -105
- package/src/sources/frost.js +38 -29
- package/src/sources/fsonline.js +95 -47
- package/src/sources/hdhub.js +43 -36
- package/src/sources/hexa.js +60 -53
- package/src/sources/hyper.js +42 -35
- package/src/sources/kickassanime.js +117 -124
- package/src/sources/kisskh.js +114 -59
- package/src/sources/lmscript.js +72 -70
- package/src/sources/lookmovie.js +80 -79
- package/src/sources/movenerds.js +74 -124
- package/src/sources/movy.js +197 -209
- package/src/sources/net79.js +59 -55
- package/src/sources/peestream.js +126 -138
- package/src/sources/pengu.js +46 -49
- package/src/sources/pstream.js +73 -67
- package/src/sources/purstream.js +96 -104
- package/src/sources/rivestream.js +182 -176
- package/src/sources/rivo.js +58 -53
- package/src/sources/streamaggregator.js +114 -128
- package/src/sources/thugtv.js +70 -62
- package/src/sources/vidapi.js +122 -114
- package/src/sources/vidcore.js +14 -122
- package/src/sources/vidfast.js +14 -122
- package/src/sources/vidlink.js +78 -27
- package/src/sources/vidup.js +14 -122
- package/src/sources/vidvault.js +133 -187
- package/src/sources/vidy.js +192 -187
- package/src/sources/vidzee.js +189 -183
- package/src/sources/vixsrc.js +123 -113
- package/src/sources/watchout.js +60 -46
- package/src/sources/xdownloader.js +127 -128
- package/src/sources/yapgrid.js +68 -62
- package/src/sources/yastream.js +35 -29
- package/src/subtitles.js +105 -122
- package/src/utils/helpers.js +586 -247
- package/src/sources/bcine.js +0 -202
- package/src/sources/cinezo.js +0 -55
- package/src/sources/vidora.js +0 -62
- package/src/sources/vidrock.js +0 -145
|
@@ -1,181 +1,180 @@
|
|
|
1
|
-
import crypto from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const BASE_URL =
|
|
5
|
-
const API_BASE =
|
|
6
|
-
|
|
7
|
-
const XOR_KEY =
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
{ key:
|
|
14
|
-
{ key:
|
|
15
|
-
{ key:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
.
|
|
67
|
-
.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
let
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return {
|
|
136
|
-
url: streamUrl,
|
|
137
|
-
headers: {
|
|
138
|
-
|
|
139
|
-
Referer: `${BASE_URL}/`,
|
|
140
|
-
Origin: BASE_URL,
|
|
141
|
-
},
|
|
142
|
-
server: `CinemaArmy (${server.label})`,
|
|
143
|
-
quality:
|
|
144
|
-
type: streamUrl.includes(
|
|
145
|
-
};
|
|
146
|
-
} catch (err) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import { ClientIdentifier, destroyTLS, initTLS, Session } from 'node-tls-client';
|
|
3
|
+
|
|
4
|
+
const BASE_URL = 'https://cinema.army';
|
|
5
|
+
const API_BASE = `${BASE_URL}/api`;
|
|
6
|
+
const HMAC_KEY = 'a2cfc9eaa2a3690b5d4f6b5f958dbdeae52a097283d375bd253ee7c7062524f5';
|
|
7
|
+
const XOR_KEY = 'f16a6b92fcd6eed3e9476297f893f2505c32f79bc6efef9b6c95496aa5914548';
|
|
8
|
+
const UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36';
|
|
9
|
+
|
|
10
|
+
const SERVERS = [
|
|
11
|
+
{ key: 'cookiebakers', label: 'CookieBakers', method: 'POST' },
|
|
12
|
+
{ key: 'tcloud', label: 'TCloud', method: 'POST' },
|
|
13
|
+
{ key: 'ipcloud', label: 'IPCloud', method: 'POST' },
|
|
14
|
+
{ key: 'dcloud', label: 'DCloud', method: 'POST' },
|
|
15
|
+
{ key: 'tidb', label: 'TIDB', method: 'POST' },
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
let tlsInitialized = false;
|
|
19
|
+
let session = null;
|
|
20
|
+
|
|
21
|
+
async function ensureSession() {
|
|
22
|
+
if (!tlsInitialized) {
|
|
23
|
+
await initTLS();
|
|
24
|
+
tlsInitialized = true;
|
|
25
|
+
}
|
|
26
|
+
if (!session) {
|
|
27
|
+
session = new Session({
|
|
28
|
+
clientIdentifier: ClientIdentifier.chrome_131,
|
|
29
|
+
timeout: 15000,
|
|
30
|
+
insecureSkipVerify: false,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return session;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function getHeaders(token, id, isTv, s, e) {
|
|
37
|
+
const referer = isTv
|
|
38
|
+
? `${BASE_URL}/watch?id=${id}&type=tv&season=${s}&episode=${e}`
|
|
39
|
+
: `${BASE_URL}/watch?id=${id}&type=movie`;
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
'User-Agent': UA,
|
|
43
|
+
Accept: 'application/json',
|
|
44
|
+
'Accept-Language': 'en-US,en;q=0.9',
|
|
45
|
+
'Accept-Encoding': 'gzip, deflate, br',
|
|
46
|
+
'Cache-Control': 'no-cache',
|
|
47
|
+
Pragma: 'no-cache',
|
|
48
|
+
Referer: referer,
|
|
49
|
+
Origin: BASE_URL,
|
|
50
|
+
'Sec-Ch-Ua': '"Chromium";v="131", "Not_A Brand";v="24"',
|
|
51
|
+
'Sec-Ch-Ua-Mobile': '?0',
|
|
52
|
+
'Sec-Ch-Ua-Platform': '"Windows"',
|
|
53
|
+
'Sec-Fetch-Dest': 'empty',
|
|
54
|
+
'Sec-Fetch-Mode': 'cors',
|
|
55
|
+
'Sec-Fetch-Site': 'same-origin',
|
|
56
|
+
Priority: 'u=1, i',
|
|
57
|
+
'X-Stream-Token': token,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function generateToken(id) {
|
|
62
|
+
try {
|
|
63
|
+
const minute = Math.floor(Date.now() / 1000 / 60);
|
|
64
|
+
return crypto
|
|
65
|
+
.createHmac('sha256', HMAC_KEY)
|
|
66
|
+
.update(`${id}:${minute}`)
|
|
67
|
+
.digest('hex');
|
|
68
|
+
} catch {
|
|
69
|
+
return '';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function decryptStreamUrl(encoded) {
|
|
74
|
+
if (!encoded) return '';
|
|
75
|
+
if (encoded.startsWith('http://') || encoded.startsWith('https://')) return encoded;
|
|
76
|
+
try {
|
|
77
|
+
const decoded = Buffer.from(encoded, 'base64').toString('binary');
|
|
78
|
+
let out = '';
|
|
79
|
+
for (let i = 0; i < decoded.length; i++) {
|
|
80
|
+
out += String.fromCharCode(
|
|
81
|
+
decoded.charCodeAt(i) ^ XOR_KEY.charCodeAt(i % XOR_KEY.length)
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
return out;
|
|
85
|
+
} catch {
|
|
86
|
+
return encoded;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export async function getStream(args) {
|
|
91
|
+
const { id, s, e } = args || {};
|
|
92
|
+
const isTv = s != null && e != null;
|
|
93
|
+
|
|
94
|
+
const token = generateToken(id);
|
|
95
|
+
const headers = getHeaders(token, id, isTv, s, e);
|
|
96
|
+
|
|
97
|
+
const sess = await ensureSession();
|
|
98
|
+
|
|
99
|
+
const requests = SERVERS.map(server => {
|
|
100
|
+
const path = isTv
|
|
101
|
+
? `/${server.key}/tv/${id}/${s}/${e}`
|
|
102
|
+
: `/${server.key}/movie/${id}`;
|
|
103
|
+
return { url: `${API_BASE}${path}`, server };
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
const results = await Promise.allSettled(
|
|
107
|
+
requests.map(async ({ url, server }) => {
|
|
108
|
+
try {
|
|
109
|
+
const res = server.method === 'POST'
|
|
110
|
+
? await sess.post(url, { headers, body: '' })
|
|
111
|
+
: await sess.get(url, { headers });
|
|
112
|
+
|
|
113
|
+
if (res?.status !== 200) return null;
|
|
114
|
+
|
|
115
|
+
const rawBody = typeof res.text === 'function' ? await res.text() : res.body;
|
|
116
|
+
|
|
117
|
+
let data;
|
|
118
|
+
try {
|
|
119
|
+
data = typeof rawBody === 'object' && rawBody !== null ? rawBody : JSON.parse(rawBody);
|
|
120
|
+
} catch (err) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const encrypted = data?.stream?.url;
|
|
125
|
+
if (!encrypted) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const streamUrl = decryptStreamUrl(encrypted);
|
|
130
|
+
|
|
131
|
+
if (!streamUrl || !/^https?:\/\//.test(streamUrl)) {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return {
|
|
136
|
+
url: streamUrl,
|
|
137
|
+
headers: {
|
|
138
|
+
'User-Agent': UA,
|
|
139
|
+
Referer: `${BASE_URL}/`,
|
|
140
|
+
Origin: BASE_URL,
|
|
141
|
+
},
|
|
142
|
+
server: `CinemaArmy (${server.label})`,
|
|
143
|
+
quality: '1080p',
|
|
144
|
+
type: streamUrl.includes('.m3u8') ? 'hls' : 'mp4',
|
|
145
|
+
};
|
|
146
|
+
} catch (err) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
})
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
const allUrls = results
|
|
153
|
+
.filter(r => r.status === 'fulfilled' && r.value)
|
|
154
|
+
.map(r => r.value);
|
|
155
|
+
|
|
156
|
+
if (!allUrls.length) {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return {
|
|
161
|
+
url: allUrls[0].url,
|
|
162
|
+
headers: allUrls[0].headers,
|
|
163
|
+
allUrls,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export async function cleanup() {
|
|
168
|
+
if (session) {
|
|
169
|
+
try {
|
|
170
|
+
await session.close();
|
|
171
|
+
} catch { }
|
|
172
|
+
session = null;
|
|
173
|
+
}
|
|
174
|
+
if (tlsInitialized) {
|
|
175
|
+
try {
|
|
176
|
+
await destroyTLS();
|
|
177
|
+
} catch { }
|
|
178
|
+
tlsInitialized = false;
|
|
179
|
+
}
|
|
181
180
|
}
|