@vyla-entertainment/sdk 1.8.0 → 1.10.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/.github/workflows/publish.yml +38 -38
- package/.gitlab-ci.yml +16 -0
- package/README.md +1 -1
- package/package.json +33 -32
- package/src/config.js +91 -34
- package/src/health.js +2 -2
- package/src/sdk.d.ts +122 -122
- package/src/sdk.js +7 -4
- package/src/sources/anineko.js +3 -1
- package/src/sources/cinejoy.js +194 -209
- package/src/sources/flaxmovies.js +113 -21
- package/src/sources/frame.js +88 -0
- package/src/sources/fsonic.js +3 -1
- package/src/sources/fsonline.js +3 -1
- package/src/sources/lmscript.js +42 -42
- package/src/sources/lookmovie.js +3 -1
- package/src/sources/luna.js +125 -0
- package/src/sources/mapple.js +40 -4
- package/src/sources/megasource.js +47 -0
- package/src/sources/meowtv.js +1 -9
- package/src/sources/nova.js +46 -0
- package/src/sources/peestream.js +122 -0
- package/src/sources/pengu.js +8 -3
- package/src/sources/rivestream.js +179 -0
- package/src/sources/videasy.js +3 -1
- package/src/sources/vidgod.js +147 -0
- package/src/sources/vidnest.js +3 -1
- package/src/sources/vidvault.js +113 -113
- package/src/sources/vidzee.js +163 -85
- package/src/utils/helpers.js +2 -2
- package/src/sources/1embed.js +0 -115
- package/src/sources/nekowatch.js +0 -57
- package/src/sources/opstream.js +0 -123
- package/src/sources/peachify.js +0 -78
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
name: Publish npm package
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
|
|
6
|
-
permissions:
|
|
7
|
-
contents: write
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
publish:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v4
|
|
15
|
-
with:
|
|
16
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
|
17
|
-
|
|
18
|
-
- uses: actions/setup-node@v4
|
|
19
|
-
with:
|
|
20
|
-
node-version: 22
|
|
21
|
-
registry-url: https://registry.npmjs.org/
|
|
22
|
-
|
|
23
|
-
- name: Configure git
|
|
24
|
-
run: |
|
|
25
|
-
git config user.name "github-actions[bot]"
|
|
26
|
-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
27
|
-
|
|
28
|
-
- run: npm ci
|
|
29
|
-
|
|
30
|
-
- name: Bump version
|
|
31
|
-
run: |
|
|
32
|
-
npm version minor
|
|
33
|
-
git push --follow-tags
|
|
34
|
-
|
|
35
|
-
- name: Publish
|
|
36
|
-
run: npm publish
|
|
37
|
-
env:
|
|
38
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_KEY }}
|
|
1
|
+
name: Publish npm package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
permissions:
|
|
7
|
+
contents: write
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
with:
|
|
16
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
17
|
+
|
|
18
|
+
- uses: actions/setup-node@v4
|
|
19
|
+
with:
|
|
20
|
+
node-version: 22
|
|
21
|
+
registry-url: https://registry.npmjs.org/
|
|
22
|
+
|
|
23
|
+
- name: Configure git
|
|
24
|
+
run: |
|
|
25
|
+
git config user.name "github-actions[bot]"
|
|
26
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
27
|
+
|
|
28
|
+
- run: npm ci
|
|
29
|
+
|
|
30
|
+
- name: Bump version
|
|
31
|
+
run: |
|
|
32
|
+
npm version minor
|
|
33
|
+
git push --follow-tags
|
|
34
|
+
|
|
35
|
+
- name: Publish
|
|
36
|
+
run: npm publish
|
|
37
|
+
env:
|
|
38
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_KEY }}
|
package/.gitlab-ci.yml
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
stages:
|
|
2
|
+
- build
|
|
3
|
+
- test
|
|
4
|
+
- deploy
|
|
5
|
+
- publish
|
|
6
|
+
|
|
7
|
+
publish:
|
|
8
|
+
stage: publish
|
|
9
|
+
image: node:22
|
|
10
|
+
rules:
|
|
11
|
+
- if: '$CI_COMMIT_TAG'
|
|
12
|
+
when: manual
|
|
13
|
+
script:
|
|
14
|
+
- npm ci
|
|
15
|
+
- echo "//registry.npmjs.org/:_authToken=${NPM_KEY}" > .npmrc
|
|
16
|
+
- npm publish
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ This project is developed and maintained by [Vyla Entertainment](https://github.
|
|
|
23
23
|
|
|
24
24
|
Original work and core authorship:
|
|
25
25
|
|
|
26
|
-
[@
|
|
26
|
+
[@alwaysmesmerizingyou](https://gitlab.com/alwaysmesmerizingyou)
|
|
27
27
|
|
|
28
28
|
[@GavinGoGaming](https://github.com/GavinGoGaming)
|
|
29
29
|
|
package/package.json
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@vyla-entertainment/sdk",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"scripts": {
|
|
5
|
-
"test": "node test/index.js"
|
|
6
|
-
},
|
|
7
|
-
"author": "vyla-entertainment",
|
|
8
|
-
"contributors": [
|
|
9
|
-
{
|
|
10
|
-
"name": "GavinGoGaming",
|
|
11
|
-
"email": "gavin@klash.dev"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"name": "
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@vyla-entertainment/sdk",
|
|
3
|
+
"version": "1.10.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"test": "node test/index.js"
|
|
6
|
+
},
|
|
7
|
+
"author": "vyla-entertainment",
|
|
8
|
+
"contributors": [
|
|
9
|
+
{
|
|
10
|
+
"name": "GavinGoGaming",
|
|
11
|
+
"email": "gavin@klash.dev"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "alwaysmesmerizingyou",
|
|
15
|
+
"email": "alwaysmesmerizingyou@gmail.com"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"license": "CC-BY-NC-4.0",
|
|
19
|
+
"type": "module",
|
|
20
|
+
"description": "Vyla's multi-provider stream scraper SDK",
|
|
21
|
+
"main": "src/sdk.js",
|
|
22
|
+
"types": "src/sdk.d.ts",
|
|
23
|
+
"directories": {
|
|
24
|
+
"test": "test"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [],
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"dotenv": "^17.4.2"
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
}
|
|
33
|
+
}
|
package/src/config.js
CHANGED
|
@@ -6,17 +6,6 @@
|
|
|
6
6
|
// Fshare/Fsonic Tested: 155 ( they don't have Michael )
|
|
7
7
|
|
|
8
8
|
export const SOURCES = [
|
|
9
|
-
{
|
|
10
|
-
key: '1embed',
|
|
11
|
-
label: '1Embed',
|
|
12
|
-
sourceFile: '1embed',
|
|
13
|
-
proxyParam: '1e',
|
|
14
|
-
timeout: 20000,
|
|
15
|
-
jitter: 500,
|
|
16
|
-
retries: 2,
|
|
17
|
-
multiUrl: true,
|
|
18
|
-
},
|
|
19
|
-
|
|
20
9
|
{
|
|
21
10
|
key: '123anime',
|
|
22
11
|
label: '123Anime',
|
|
@@ -145,6 +134,18 @@ export const SOURCES = [
|
|
|
145
134
|
},],
|
|
146
135
|
},
|
|
147
136
|
|
|
137
|
+
{
|
|
138
|
+
key: 'frame',
|
|
139
|
+
label: 'Frame',
|
|
140
|
+
sourceFile: 'frame',
|
|
141
|
+
proxyParam: 'fr',
|
|
142
|
+
timeout: 25000,
|
|
143
|
+
jitter: 500,
|
|
144
|
+
retries: 2,
|
|
145
|
+
multiUrl: true,
|
|
146
|
+
skipProxy: true,
|
|
147
|
+
},
|
|
148
|
+
|
|
148
149
|
{
|
|
149
150
|
key: 'fsharetv',
|
|
150
151
|
label: 'FShareTV',
|
|
@@ -229,6 +230,32 @@ export const SOURCES = [
|
|
|
229
230
|
},
|
|
230
231
|
},
|
|
231
232
|
|
|
233
|
+
{
|
|
234
|
+
key: 'luna-sub',
|
|
235
|
+
label: 'Luna (Sub)',
|
|
236
|
+
sourceFile: 'luna',
|
|
237
|
+
proxyParam: 'lusub',
|
|
238
|
+
subtype: 'sub',
|
|
239
|
+
timeout: 25000,
|
|
240
|
+
jitter: 500,
|
|
241
|
+
retries: 2,
|
|
242
|
+
multiUrl: true,
|
|
243
|
+
skipProxy: true,
|
|
244
|
+
},
|
|
245
|
+
|
|
246
|
+
{
|
|
247
|
+
key: 'luna-dub',
|
|
248
|
+
label: 'Luna (Dub)',
|
|
249
|
+
sourceFile: 'luna',
|
|
250
|
+
proxyParam: 'ludub',
|
|
251
|
+
subtype: 'dub',
|
|
252
|
+
timeout: 25000,
|
|
253
|
+
jitter: 500,
|
|
254
|
+
retries: 2,
|
|
255
|
+
multiUrl: true,
|
|
256
|
+
skipProxy: true,
|
|
257
|
+
},
|
|
258
|
+
|
|
232
259
|
{
|
|
233
260
|
key: 'mapple',
|
|
234
261
|
label: 'Mapple',
|
|
@@ -252,30 +279,15 @@ export const SOURCES = [
|
|
|
252
279
|
},
|
|
253
280
|
|
|
254
281
|
{
|
|
255
|
-
key: '
|
|
256
|
-
label: '
|
|
257
|
-
sourceFile: '
|
|
258
|
-
proxyParam: '
|
|
259
|
-
timeout:
|
|
282
|
+
key: 'peestream',
|
|
283
|
+
label: 'PeeStream',
|
|
284
|
+
sourceFile: 'peestream',
|
|
285
|
+
proxyParam: 'pee',
|
|
286
|
+
timeout: 25000,
|
|
260
287
|
jitter: 500,
|
|
261
288
|
retries: 2,
|
|
262
289
|
multiUrl: true,
|
|
263
290
|
skipProxy: true,
|
|
264
|
-
verifyHeaders: {
|
|
265
|
-
Referer: 'https://opstream.fun/',
|
|
266
|
-
Origin: 'https://opstream.fun',
|
|
267
|
-
},
|
|
268
|
-
},
|
|
269
|
-
|
|
270
|
-
{
|
|
271
|
-
key: 'peachify',
|
|
272
|
-
label: 'Peachify',
|
|
273
|
-
sourceFile: 'peachify',
|
|
274
|
-
proxyParam: 'pf',
|
|
275
|
-
timeout: 30000,
|
|
276
|
-
jitter: 500,
|
|
277
|
-
retries: 1,
|
|
278
|
-
multiUrl: true
|
|
279
291
|
},
|
|
280
292
|
|
|
281
293
|
{
|
|
@@ -288,7 +300,29 @@ export const SOURCES = [
|
|
|
288
300
|
retries: 1,
|
|
289
301
|
multiUrl: true,
|
|
290
302
|
skipProxy: true,
|
|
291
|
-
disabled:
|
|
303
|
+
disabled: false, // Enabled, but only returns streams when a manifest is provided
|
|
304
|
+
},
|
|
305
|
+
|
|
306
|
+
{
|
|
307
|
+
key: 'nova',
|
|
308
|
+
label: 'Nova',
|
|
309
|
+
sourceFile: 'nova',
|
|
310
|
+
proxyParam: 'nv',
|
|
311
|
+
timeout: 25000,
|
|
312
|
+
jitter: 500,
|
|
313
|
+
retries: 1,
|
|
314
|
+
multiUrl: true,
|
|
315
|
+
},
|
|
316
|
+
|
|
317
|
+
{
|
|
318
|
+
key: 'megasource',
|
|
319
|
+
label: 'MegaSource',
|
|
320
|
+
sourceFile: 'megasource',
|
|
321
|
+
proxyParam: 'mg',
|
|
322
|
+
timeout: 25000,
|
|
323
|
+
jitter: 500,
|
|
324
|
+
retries: 1,
|
|
325
|
+
multiUrl: true,
|
|
292
326
|
},
|
|
293
327
|
|
|
294
328
|
{
|
|
@@ -302,6 +336,17 @@ export const SOURCES = [
|
|
|
302
336
|
skipProxy: true
|
|
303
337
|
},
|
|
304
338
|
|
|
339
|
+
{
|
|
340
|
+
key: 'rivestream',
|
|
341
|
+
label: 'RiveStream',
|
|
342
|
+
sourceFile: 'rivestream',
|
|
343
|
+
proxyParam: 'rs',
|
|
344
|
+
timeout: 30000,
|
|
345
|
+
jitter: 500,
|
|
346
|
+
retries: 2,
|
|
347
|
+
multiUrl: true,
|
|
348
|
+
},
|
|
349
|
+
|
|
305
350
|
{
|
|
306
351
|
key: 'vidapi',
|
|
307
352
|
label: 'VidAPI',
|
|
@@ -351,6 +396,18 @@ export const SOURCES = [
|
|
|
351
396
|
retries: 1,
|
|
352
397
|
},
|
|
353
398
|
|
|
399
|
+
{
|
|
400
|
+
key: 'vidgod',
|
|
401
|
+
label: 'VidGod',
|
|
402
|
+
sourceFile: 'vidgod',
|
|
403
|
+
proxyParam: 'vg',
|
|
404
|
+
timeout: 25000,
|
|
405
|
+
jitter: 500,
|
|
406
|
+
retries: 2,
|
|
407
|
+
multiUrl: true,
|
|
408
|
+
skipProxy: true,
|
|
409
|
+
},
|
|
410
|
+
|
|
354
411
|
{
|
|
355
412
|
key: 'vidlink',
|
|
356
413
|
label: 'Vidlink',
|
|
@@ -408,7 +465,8 @@ export const SOURCES = [
|
|
|
408
465
|
jitter: 500,
|
|
409
466
|
retries: 2,
|
|
410
467
|
multiUrl: true,
|
|
411
|
-
skipProxy: true
|
|
468
|
+
skipProxy: true,
|
|
469
|
+
disabled: true, // Temporarily disabled because their site is down, embed website does not load
|
|
412
470
|
},
|
|
413
471
|
|
|
414
472
|
{
|
|
@@ -479,7 +537,6 @@ export const SOURCES = [
|
|
|
479
537
|
Referer: 'https://player.vidzee.wtf',
|
|
480
538
|
Origin: 'https://player.vidzee.wtf',
|
|
481
539
|
},
|
|
482
|
-
disabled: true // Disabled temporarily due to decryption issues
|
|
483
540
|
},
|
|
484
541
|
|
|
485
542
|
{
|
package/src/health.js
CHANGED
|
@@ -14,7 +14,7 @@ async function withRetry(fn, attempts = 2, delay = 300) {
|
|
|
14
14
|
return null;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export async function probeSource(
|
|
17
|
+
export async function probeSource(sdk, cfg, mod) {
|
|
18
18
|
const audio = /dub$/.test(cfg.key) ? 'dub' : 'sub';
|
|
19
19
|
const streamArgs = {
|
|
20
20
|
id: HEALTH_PROBE_ID,
|
|
@@ -23,7 +23,7 @@ export async function probeSource(tmdbApiKey, cfg, mod) {
|
|
|
23
23
|
clientIP: null,
|
|
24
24
|
absoluteBase: null,
|
|
25
25
|
audio,
|
|
26
|
-
|
|
26
|
+
sdk,
|
|
27
27
|
config: cfg,
|
|
28
28
|
};
|
|
29
29
|
|
package/src/sdk.d.ts
CHANGED
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
export interface SourceConfig {
|
|
2
|
-
key: string;
|
|
3
|
-
label: string;
|
|
4
|
-
sourceFile: string;
|
|
5
|
-
proxyParam: string;
|
|
6
|
-
timeout: number;
|
|
7
|
-
jitter: number;
|
|
8
|
-
retries: number;
|
|
9
|
-
multiUrl: boolean;
|
|
10
|
-
skipProxy?: boolean;
|
|
11
|
-
cdnHeaders?: {
|
|
12
|
-
pattern: RegExp;
|
|
13
|
-
headers: {
|
|
14
|
-
Referer: string;
|
|
15
|
-
Origin: string;
|
|
16
|
-
};
|
|
17
|
-
}[];
|
|
18
|
-
skipVerify?: boolean;
|
|
19
|
-
verifyHeaders?: boolean;
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
sourcesTimeout?: number;
|
|
22
|
-
}
|
|
23
|
-
export interface ProbeResult {
|
|
24
|
-
ok: boolean;
|
|
25
|
-
ms: number | null;
|
|
26
|
-
}
|
|
27
|
-
export interface StreamResult {
|
|
28
|
-
url: string;
|
|
29
|
-
headers: {
|
|
30
|
-
"User-Agent": string;
|
|
31
|
-
Referer: string;
|
|
32
|
-
Origin: string;
|
|
33
|
-
[key: string]: string;
|
|
34
|
-
};
|
|
35
|
-
server: string;
|
|
36
|
-
quality: string;
|
|
37
|
-
type: "mp4" | "hls";
|
|
38
|
-
skipVerify?: boolean;
|
|
39
|
-
skipProxy?: boolean;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface DownloadResult {
|
|
43
|
-
url: string;
|
|
44
|
-
quality: string;
|
|
45
|
-
size: number | null;
|
|
46
|
-
type: "mkv";
|
|
47
|
-
active: boolean;
|
|
48
|
-
}
|
|
49
|
-
export interface SubtitleResult {
|
|
50
|
-
label: string;
|
|
51
|
-
file: string;
|
|
52
|
-
type: "vtt" | "srt";
|
|
53
|
-
source: string;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export type ProbeAllResult = Record<string, ProbeResult>;
|
|
57
|
-
|
|
58
|
-
export interface VylaSDKOptions {
|
|
59
|
-
tmdbApiKey?: string;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Descriptions written with Claude.
|
|
63
|
-
export default class VylaSDK {
|
|
64
|
-
tmdbApiKey?: string;
|
|
65
|
-
|
|
66
|
-
constructor(options?: VylaSDKOptions);
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Get the list of configured sources.
|
|
70
|
-
* @param excludeDisabled If true, filters out disabled sources.
|
|
71
|
-
*/
|
|
72
|
-
getSources(excludeDisabled?: boolean): SourceConfig[];
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Probe all active (non-disabled) sources for availability.
|
|
76
|
-
*/
|
|
77
|
-
probeAllSources(): Promise<ProbeAllResult>;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Probe a single source by key.
|
|
81
|
-
*/
|
|
82
|
-
probeSource(key: string): Promise<ProbeResult>;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Get a playable stream for a given source/media id.
|
|
86
|
-
* @param key Source key
|
|
87
|
-
* @param id Media id (e.g. TMDB id)
|
|
88
|
-
* @param s Season number (for TV), or null for movies
|
|
89
|
-
* @param e Episode number (for TV), or null for movies
|
|
90
|
-
* @param clientIP Optional client IP for source-specific logic
|
|
91
|
-
*/
|
|
92
|
-
getStream(
|
|
93
|
-
key: string,
|
|
94
|
-
id: string | number,
|
|
95
|
-
s?: number | null,
|
|
96
|
-
e?: number | null,
|
|
97
|
-
clientIP?: string | null
|
|
98
|
-
): Promise<StreamResult | { allUrls: StreamResult[] }>;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Get subtitles for a movie or TV episode.
|
|
102
|
-
* @param id Media id
|
|
103
|
-
* @param s Season number (for TV), or null for movies
|
|
104
|
-
* @param e Episode number (for TV), or null for movies
|
|
105
|
-
*/
|
|
106
|
-
getSubtitles(
|
|
107
|
-
id: string | number,
|
|
108
|
-
s?: number | null,
|
|
109
|
-
e?: number | null
|
|
110
|
-
): Promise<SubtitleResult[]>;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Get download links for a movie or TV episode.
|
|
114
|
-
* @param id Media id
|
|
115
|
-
* @param s Season number (for TV), or null for movies
|
|
116
|
-
* @param e Episode number (for TV), or null for movies
|
|
117
|
-
*/
|
|
118
|
-
getDownloads(
|
|
119
|
-
id: string | number,
|
|
120
|
-
s?: number | null,
|
|
121
|
-
e?: number | null
|
|
122
|
-
): Promise<DownloadResult[]>;
|
|
1
|
+
export interface SourceConfig {
|
|
2
|
+
key: string;
|
|
3
|
+
label: string;
|
|
4
|
+
sourceFile: string;
|
|
5
|
+
proxyParam: string;
|
|
6
|
+
timeout: number;
|
|
7
|
+
jitter: number;
|
|
8
|
+
retries: number;
|
|
9
|
+
multiUrl: boolean;
|
|
10
|
+
skipProxy?: boolean;
|
|
11
|
+
cdnHeaders?: {
|
|
12
|
+
pattern: RegExp;
|
|
13
|
+
headers: {
|
|
14
|
+
Referer: string;
|
|
15
|
+
Origin: string;
|
|
16
|
+
};
|
|
17
|
+
}[];
|
|
18
|
+
skipVerify?: boolean;
|
|
19
|
+
verifyHeaders?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
sourcesTimeout?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ProbeResult {
|
|
24
|
+
ok: boolean;
|
|
25
|
+
ms: number | null;
|
|
26
|
+
}
|
|
27
|
+
export interface StreamResult {
|
|
28
|
+
url: string;
|
|
29
|
+
headers: {
|
|
30
|
+
"User-Agent": string;
|
|
31
|
+
Referer: string;
|
|
32
|
+
Origin: string;
|
|
33
|
+
[key: string]: string;
|
|
34
|
+
};
|
|
35
|
+
server: string;
|
|
36
|
+
quality: string;
|
|
37
|
+
type: "mp4" | "hls";
|
|
38
|
+
skipVerify?: boolean;
|
|
39
|
+
skipProxy?: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface DownloadResult {
|
|
43
|
+
url: string;
|
|
44
|
+
quality: string;
|
|
45
|
+
size: number | null;
|
|
46
|
+
type: "mkv";
|
|
47
|
+
active: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface SubtitleResult {
|
|
50
|
+
label: string;
|
|
51
|
+
file: string;
|
|
52
|
+
type: "vtt" | "srt";
|
|
53
|
+
source: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type ProbeAllResult = Record<string, ProbeResult>;
|
|
57
|
+
|
|
58
|
+
export interface VylaSDKOptions {
|
|
59
|
+
tmdbApiKey?: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Descriptions written with Claude.
|
|
63
|
+
export default class VylaSDK {
|
|
64
|
+
tmdbApiKey?: string;
|
|
65
|
+
|
|
66
|
+
constructor(options?: VylaSDKOptions);
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Get the list of configured sources.
|
|
70
|
+
* @param excludeDisabled If true, filters out disabled sources.
|
|
71
|
+
*/
|
|
72
|
+
getSources(excludeDisabled?: boolean): SourceConfig[];
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Probe all active (non-disabled) sources for availability.
|
|
76
|
+
*/
|
|
77
|
+
probeAllSources(): Promise<ProbeAllResult>;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Probe a single source by key.
|
|
81
|
+
*/
|
|
82
|
+
probeSource(key: string): Promise<ProbeResult>;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Get a playable stream for a given source/media id.
|
|
86
|
+
* @param key Source key
|
|
87
|
+
* @param id Media id (e.g. TMDB id)
|
|
88
|
+
* @param s Season number (for TV), or null for movies
|
|
89
|
+
* @param e Episode number (for TV), or null for movies
|
|
90
|
+
* @param clientIP Optional client IP for source-specific logic
|
|
91
|
+
*/
|
|
92
|
+
getStream(
|
|
93
|
+
key: string,
|
|
94
|
+
id: string | number,
|
|
95
|
+
s?: number | null,
|
|
96
|
+
e?: number | null,
|
|
97
|
+
clientIP?: string | null
|
|
98
|
+
): Promise<StreamResult | { allUrls: StreamResult[] }>;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Get subtitles for a movie or TV episode.
|
|
102
|
+
* @param id Media id
|
|
103
|
+
* @param s Season number (for TV), or null for movies
|
|
104
|
+
* @param e Episode number (for TV), or null for movies
|
|
105
|
+
*/
|
|
106
|
+
getSubtitles(
|
|
107
|
+
id: string | number,
|
|
108
|
+
s?: number | null,
|
|
109
|
+
e?: number | null
|
|
110
|
+
): Promise<SubtitleResult[]>;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Get download links for a movie or TV episode.
|
|
114
|
+
* @param id Media id
|
|
115
|
+
* @param s Season number (for TV), or null for movies
|
|
116
|
+
* @param e Episode number (for TV), or null for movies
|
|
117
|
+
*/
|
|
118
|
+
getDownloads(
|
|
119
|
+
id: string | number,
|
|
120
|
+
s?: number | null,
|
|
121
|
+
e?: number | null
|
|
122
|
+
): Promise<DownloadResult[]>;
|
|
123
123
|
}
|
package/src/sdk.js
CHANGED
|
@@ -13,8 +13,11 @@ const SOURCE_MODULES = Object.fromEntries(
|
|
|
13
13
|
);
|
|
14
14
|
|
|
15
15
|
export default class VylaSDK {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
tmdbApiKey = null;
|
|
17
|
+
penguManifest = null;
|
|
18
|
+
constructor({ tmdbApiKey, penguManifest } = {}) {
|
|
19
|
+
this.tmdbApiKey = tmdbApiKey || null;
|
|
20
|
+
this.penguManifest = penguManifest || null;
|
|
18
21
|
}
|
|
19
22
|
getSources(excludeDisabled = false) {
|
|
20
23
|
if (excludeDisabled) {
|
|
@@ -43,14 +46,14 @@ export default class VylaSDK {
|
|
|
43
46
|
if (!cfg) throw new Error(`Source with key "${key}" not found`);
|
|
44
47
|
const mod = SOURCE_MODULES[key];
|
|
45
48
|
if (!mod) throw new Error(`Source module for key "${key}" not found`);
|
|
46
|
-
return await probeSource(this
|
|
49
|
+
return await probeSource(this, cfg, mod);
|
|
47
50
|
}
|
|
48
51
|
async getStream(key, id, s = null, e = null, clientIP = null) {
|
|
49
52
|
const cfg = SOURCES.find(cfg => cfg.key === key);
|
|
50
53
|
if (!cfg) throw new Error(`Source with key "${key}" not found`);
|
|
51
54
|
const mod = SOURCE_MODULES[key];
|
|
52
55
|
if (!mod) throw new Error(`Source module for key "${key}" not found`);
|
|
53
|
-
const streamArgs = await createStreamArgs(cfg, this
|
|
56
|
+
const streamArgs = await createStreamArgs(cfg, this, id, s, e, clientIP);
|
|
54
57
|
return await mod.getStream(streamArgs);
|
|
55
58
|
}
|
|
56
59
|
async getSubtitles(id, s = null, e = null) {
|
package/src/sources/anineko.js
CHANGED
|
@@ -69,7 +69,9 @@ async function extractHls(embedUrl) {
|
|
|
69
69
|
return null;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
export async function getStream({ id, s, e, audio,
|
|
72
|
+
export async function getStream({ id, s, e, audio, sdk }) {
|
|
73
|
+
const tmdbApiKey = sdk?.tmdbApiKey || null;
|
|
74
|
+
if (!tmdbApiKey) return null;
|
|
73
75
|
try {
|
|
74
76
|
const info = await getTmdbInfo(tmdbApiKey, id, s ? 'tv' : 'movie', s);
|
|
75
77
|
if (!info || !info.isAnime) return null;
|