@vyla-entertainment/sdk 1.9.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 +9 -13
- package/package.json +33 -32
- package/src/config.js +86 -118
- 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 +0 -1
- 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 +154 -199
- package/src/subtitles.js +18 -0
- package/src/utils/helpers.js +2 -2
- package/src/sources/1embed.js +0 -115
- package/src/sources/anikoto.js +0 -198
- package/src/sources/anizone.js +0 -109
- package/src/sources/cinesu.js +0 -94
- package/src/sources/kickassanime.js +0 -107
- package/src/sources/nekowatch.js +0 -57
- package/src/sources/opstream.js +0 -123
- package/src/sources/peachify.js +0 -78
- package/src/sources/reanime.js +0 -324
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;
|