@vyla-entertainment/sdk 1.20.0 → 1.22.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 (58) hide show
  1. package/package.json +3 -2
  2. package/src/config.js +99 -67
  3. package/src/health.js +60 -20
  4. package/src/sdk.d.ts +94 -121
  5. package/src/sdk.js +82 -78
  6. package/src/sources/111477.js +88 -100
  7. package/src/sources/123anime.js +120 -56
  8. package/src/sources/3eyedraven.js +82 -135
  9. package/src/sources/4movies.js +77 -0
  10. package/src/sources/aether.js +99 -0
  11. package/src/sources/castle.js +415 -0
  12. package/src/sources/cinecat.js +37 -18
  13. package/src/sources/cinemaarmy.js +179 -180
  14. package/src/sources/cinesrc.js +401 -397
  15. package/src/sources/cno.js +101 -94
  16. package/src/sources/dulo.js +134 -149
  17. package/src/sources/flaxmovies.js +114 -105
  18. package/src/sources/framextv.js +126 -0
  19. package/src/sources/frost.js +38 -29
  20. package/src/sources/fsonline.js +95 -47
  21. package/src/sources/hdhub.js +43 -36
  22. package/src/sources/hexa.js +60 -53
  23. package/src/sources/hyper.js +42 -35
  24. package/src/sources/kickassanime.js +117 -124
  25. package/src/sources/kisskh.js +114 -59
  26. package/src/sources/lmscript.js +72 -70
  27. package/src/sources/lookmovie.js +80 -79
  28. package/src/sources/meowtv.js +140 -0
  29. package/src/sources/movenerds.js +74 -124
  30. package/src/sources/movy.js +197 -209
  31. package/src/sources/net79.js +59 -55
  32. package/src/sources/peestream.js +126 -138
  33. package/src/sources/pengu.js +46 -49
  34. package/src/sources/pstream.js +73 -67
  35. package/src/sources/purstream.js +96 -104
  36. package/src/sources/rivestream.js +182 -176
  37. package/src/sources/rivo.js +58 -53
  38. package/src/sources/streamaggregator.js +114 -128
  39. package/src/sources/thugtv.js +70 -62
  40. package/src/sources/vidapi.js +122 -114
  41. package/src/sources/vidcore.js +14 -122
  42. package/src/sources/vidfast.js +14 -122
  43. package/src/sources/vidlink.js +78 -27
  44. package/src/sources/vidora.js +74 -42
  45. package/src/sources/vidup.js +14 -122
  46. package/src/sources/vidvault.js +133 -187
  47. package/src/sources/vidy.js +192 -187
  48. package/src/sources/vidzee.js +189 -183
  49. package/src/sources/vixsrc.js +123 -113
  50. package/src/sources/watchout.js +60 -46
  51. package/src/sources/xdownloader.js +127 -128
  52. package/src/sources/yapgrid.js +68 -62
  53. package/src/sources/yastream.js +35 -29
  54. package/src/subtitles.js +105 -122
  55. package/src/utils/helpers.js +586 -247
  56. package/src/sources/bcine.js +0 -202
  57. package/src/sources/cinezo.js +0 -55
  58. package/src/sources/vidrock.js +0 -145
@@ -1,95 +1,102 @@
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 serverIndices = Array.from({ length: 50 }, (_, i) => i + 1);
6
-
7
- const headers = {
8
- 'Accept': 'application/json, text/plain, */*',
9
- 'Referer': 'https://cno.to/',
10
- 'Origin': 'https://cno.to',
11
- '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'
12
- };
13
-
14
- const promises = serverIndices.map(async (serverNum) => {
15
- const url = isTv
16
- ? `https://cno.to/api/s/${serverNum}/tv/${id}/${s}/${e}`
17
- : `https://cno.to/api/s/${serverNum}/movie/${id}?v=3`;
18
-
19
- try {
20
- const raw = await fetchText(url, { headers });
21
- if (!raw || raw.includes('"error":')) return null;
22
-
23
- if (raw.includes('#EXTM3U')) {
24
- const lines = raw.split('\n');
25
- let streamUrl = null;
26
- let quality = 'Auto';
27
-
28
- for (let i = 0; i < lines.length; i++) {
29
- const line = lines[i].trim();
30
- if (line.startsWith('#EXT-X-STREAM-INF:')) {
31
- const resMatch = line.match(/RESOLUTION=(\d+x\d+)/);
32
- if (resMatch) quality = resMatch[1];
33
- const nextLine = lines[i + 1]?.trim();
34
- if (nextLine && !nextLine.startsWith('#')) {
35
- streamUrl = nextLine;
36
- break;
37
- }
38
- }
39
- }
40
-
41
- if (!streamUrl) {
42
- for (const line of lines) {
43
- const trimmed = line.trim();
44
- if (trimmed && !trimmed.startsWith('#')) {
45
- streamUrl = trimmed;
46
- break;
47
- }
48
- }
49
- }
50
-
51
- if (streamUrl) {
52
- if (streamUrl.startsWith('/')) {
53
- streamUrl = `https://cno.to${streamUrl}`;
54
- }
55
-
56
- return {
57
- url: streamUrl,
58
- server: `Cno - Server ${serverNum} (${quality})`,
59
- headers: {
60
- Referer: 'https://cno.to/',
61
- Origin: 'https://cno.to'
62
- }
63
- };
64
- }
65
- }
66
-
67
- try {
68
- const json = JSON.parse(raw);
69
- const jsonUrl = json.url || json.file || json.stream;
70
- if (jsonUrl && typeof jsonUrl === 'string' && jsonUrl.startsWith('http')) {
71
- return {
72
- url: jsonUrl,
73
- server: `Cno - Server ${serverNum} (${json.quality || 'Auto'})`,
74
- headers: {
75
- Referer: 'https://cno.to/',
76
- Origin: 'https://cno.to'
77
- }
78
- };
79
- }
80
- } catch { }
81
- } catch { }
82
- return null;
83
- });
84
-
85
- const results = await Promise.all(promises);
86
- const allUrls = results.filter(Boolean);
87
-
88
- if (!allUrls.length) return null;
89
-
90
- return {
91
- url: allUrls[0].url,
92
- headers: allUrls[0].headers,
93
- allUrls
94
- };
1
+ import { fetchText } from '../utils/helpers.js';
2
+
3
+ const BASE_URL = 'https://cno.to';
4
+
5
+ export async function getStream(args) {
6
+ const { id, s, e } = args || {};
7
+ const isTv = s != null && e != null;
8
+ const serverIndices = Array.from({ length: 50 }, (_, i) => i + 1);
9
+
10
+ const headers = {
11
+ Accept: 'application/json, text/plain, */*',
12
+ Referer: `${BASE_URL}/`,
13
+ Origin: BASE_URL,
14
+ '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',
15
+ };
16
+
17
+ const promises = serverIndices.map(async (serverNum) => {
18
+ const url = isTv
19
+ ? `${BASE_URL}/api/s/${serverNum}/tv/${id}/${s}/${e}`
20
+ : `${BASE_URL}/api/s/${serverNum}/movie/${id}?v=3`;
21
+
22
+ try {
23
+ const raw = await fetchText(url, { headers });
24
+ if (!raw || raw.includes('"error":')) return null;
25
+
26
+ if (raw.includes('#EXTM3U')) {
27
+ const lines = raw.split('\n');
28
+ let streamUrl = null;
29
+ let quality = 'Auto';
30
+
31
+ for (let i = 0; i < lines.length; i++) {
32
+ const line = lines[i].trim();
33
+ if (line.startsWith('#EXT-X-STREAM-INF:')) {
34
+ const resMatch = line.match(/RESOLUTION=(\d+x\d+)/);
35
+ if (resMatch) quality = resMatch[1];
36
+ const nextLine = lines[i + 1]?.trim();
37
+ if (nextLine && !nextLine.startsWith('#')) {
38
+ streamUrl = nextLine;
39
+ break;
40
+ }
41
+ }
42
+ }
43
+
44
+ if (!streamUrl) {
45
+ for (const line of lines) {
46
+ const trimmed = line.trim();
47
+ if (trimmed && !trimmed.startsWith('#')) {
48
+ streamUrl = trimmed;
49
+ break;
50
+ }
51
+ }
52
+ }
53
+
54
+ if (streamUrl) {
55
+ if (streamUrl.startsWith('/')) {
56
+ streamUrl = `${BASE_URL}${streamUrl}`;
57
+ }
58
+
59
+ return {
60
+ url: streamUrl,
61
+ server: `Cno - Server ${serverNum} (${quality})`,
62
+ quality,
63
+ type: 'hls',
64
+ headers: {
65
+ Referer: `${BASE_URL}/`,
66
+ Origin: BASE_URL,
67
+ },
68
+ };
69
+ }
70
+ }
71
+
72
+ try {
73
+ const json = JSON.parse(raw);
74
+ const jsonUrl = json.url || json.file || json.stream;
75
+ if (jsonUrl && typeof jsonUrl === 'string' && jsonUrl.startsWith('http')) {
76
+ return {
77
+ url: jsonUrl,
78
+ server: `Cno - Server ${serverNum} (${json.quality || 'Auto'})`,
79
+ quality: json.quality || 'Auto',
80
+ type: jsonUrl.includes('.m3u8') ? 'hls' : 'mp4',
81
+ headers: {
82
+ Referer: `${BASE_URL}/`,
83
+ Origin: BASE_URL,
84
+ },
85
+ };
86
+ }
87
+ } catch { }
88
+ } catch { }
89
+ return null;
90
+ });
91
+
92
+ const results = await Promise.all(promises);
93
+ const allUrls = results.filter(Boolean);
94
+
95
+ if (!allUrls.length) return null;
96
+
97
+ return {
98
+ url: allUrls[0].url,
99
+ headers: allUrls[0].headers,
100
+ allUrls,
101
+ };
95
102
  }
@@ -1,150 +1,135 @@
1
- import { getUA } from '../utils/helpers.js';
2
-
3
- const BASE_URL = 'https://dulo.mov';
4
-
5
- const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
6
-
7
- async function resolveDetails(sdk, id, isTv) {
8
- const apiKey = sdk?.tmdbApiKey || process.env.TMDB_API_KEY;
9
- if (!apiKey) return null;
10
- const type = isTv ? 'tv' : 'movie';
11
- try {
12
- const res = await fetch(`https://api.themoviedb.org/3/${type}/${id}?api_key=${apiKey}`, {
13
- signal: AbortSignal.timeout(6000),
14
- });
15
- if (!res.ok) return null;
16
- const data = await res.json();
17
- const title = isTv ? data.name : data.title;
18
- const releaseDate = isTv ? data.first_air_date : data.release_date;
19
- const year = releaseDate ? releaseDate.split('-')[0] : '';
20
- const runtime = isTv ? (data.episode_run_time?.[0] || 24) : (data.runtime || 90);
21
- return { title, year, runtime };
22
- } catch {
23
- return null;
24
- }
25
- }
26
-
27
- async function fetchSource(url, headers) {
28
- try {
29
- const res = await fetch(url, {
30
- headers,
31
- signal: AbortSignal.timeout(8000),
32
- });
33
- if (!res.ok) return null;
34
- return await res.json();
35
- } catch {
36
- return null;
37
- }
38
- }
39
-
40
- export async function getStream({ id, s, e, sdk }) {
41
- const isTv = Boolean(s && e);
42
- const mediaType = isTv ? 'tv' : 'movie';
43
- const ua = getUA();
44
-
45
- const details = await resolveDetails(sdk, id, isTv);
46
- const title = details?.title || '';
47
- const year = details?.year || '';
48
- const runtime = details?.runtime || '';
49
-
50
- const referer = isTv
51
- ? `${BASE_URL}/watch/tv/${id}/${s}/${e}`
52
- : `${BASE_URL}/watch/movie/${id}`;
53
-
54
- const defaultHeaders = {
55
- 'User-Agent': ua,
56
- Referer: referer,
57
- Origin: BASE_URL,
58
- Accept: '*/*',
59
- 'Sec-Fetch-Dest': 'empty',
60
- 'Sec-Fetch-Mode': 'cors',
61
- 'Sec-Fetch-Site': 'same-origin',
62
- };
63
-
64
- const baseParams = new URLSearchParams({
65
- tmdbId: String(id),
66
- type: mediaType,
67
- });
68
-
69
- const additionalParams = new URLSearchParams({
70
- tmdbId: String(id),
71
- type: mediaType,
72
- progressive: 'true',
73
- });
74
-
75
- if (title) additionalParams.set('title', title);
76
- if (year) additionalParams.set('year', String(year));
77
- if (runtime) additionalParams.set('runtime', String(runtime));
78
-
79
- if (isTv) {
80
- baseParams.set('season', String(s));
81
- baseParams.set('episode', String(e));
82
- additionalParams.set('season', String(s));
83
- additionalParams.set('episode', String(e));
84
- }
85
-
86
- const endpoints = [
87
- `${BASE_URL}/api/sources?${baseParams.toString()}`,
88
- `${BASE_URL}/api/sources/willow?${baseParams.toString()}`,
89
- `${BASE_URL}/api/sources/additional?${additionalParams.toString()}`,
90
- ];
91
-
92
- const seenUrls = new Set();
93
- const allUrls = [];
94
-
95
- let pendingUrls = [...endpoints];
96
- const maxPollTime = Date.now() + 16000;
97
-
98
- while (pendingUrls.length > 0 && Date.now() < maxPollTime) {
99
- const results = await Promise.all(
100
- pendingUrls.map((url) => fetchSource(url, defaultHeaders))
101
- );
102
-
103
- const nextPending = [];
104
-
105
- results.forEach((data, index) => {
106
- if (!data) return;
107
-
108
- if (Array.isArray(data.sources) && data.sources.length > 0) {
109
- for (const src of data.sources) {
110
- let streamUrl = String(src?.url || '').trim();
111
- if (!streamUrl) continue;
112
-
113
- if (streamUrl.startsWith('/')) {
114
- streamUrl = `${BASE_URL}${streamUrl}`;
115
- }
116
-
117
- if (!streamUrl.startsWith('http') || seenUrls.has(streamUrl)) continue;
118
- seenUrls.add(streamUrl);
119
-
120
- allUrls.push({
121
- url: streamUrl,
122
- label: src.label || 'Dulo',
123
- headers: {
124
- 'User-Agent': ua,
125
- Referer: referer,
126
- },
127
- captions: Array.isArray(src.captions) ? src.captions : [],
128
- });
129
- }
130
- }
131
-
132
- if (data.pending) {
133
- nextPending.push(pendingUrls[index]);
134
- }
135
- });
136
-
137
- pendingUrls = nextPending;
138
- if (pendingUrls.length > 0) {
139
- await sleep(1500);
140
- }
141
- }
142
-
143
- if (allUrls.length === 0) return null;
144
-
145
- return {
146
- url: allUrls[0].url,
147
- allUrls,
148
- headers: allUrls[0].headers,
149
- };
1
+ import { getTmdbMetadata, getUA, resolveTmdbKey } from '../utils/helpers.js';
2
+
3
+ const BASE_URL = 'https://dulo.mov';
4
+
5
+ const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
6
+
7
+ async function fetchSource(url, headers) {
8
+ try {
9
+ const res = await fetch(url, {
10
+ headers,
11
+ signal: AbortSignal.timeout(8000),
12
+ });
13
+ if (!res.ok) return null;
14
+ return await res.json();
15
+ } catch {
16
+ return null;
17
+ }
18
+ }
19
+
20
+ export async function getStream(args) {
21
+ const { id, s, e, sdk } = args || {};
22
+ const isTv = s != null && e != null;
23
+ const mediaType = isTv ? 'tv' : 'movie';
24
+ const apiKey = resolveTmdbKey(args, sdk);
25
+ const ua = getUA();
26
+
27
+ const meta = await getTmdbMetadata(id, isTv, apiKey);
28
+ const title = meta?.title || '';
29
+ const year = meta?.year || '';
30
+ const runtime = meta?.runtime || '';
31
+
32
+ const referer = isTv
33
+ ? `${BASE_URL}/watch/tv/${id}/${s}/${e}`
34
+ : `${BASE_URL}/watch/movie/${id}`;
35
+
36
+ const defaultHeaders = {
37
+ 'User-Agent': ua,
38
+ Referer: referer,
39
+ Origin: BASE_URL,
40
+ Accept: '*/*',
41
+ 'Sec-Fetch-Dest': 'empty',
42
+ 'Sec-Fetch-Mode': 'cors',
43
+ 'Sec-Fetch-Site': 'same-origin',
44
+ };
45
+
46
+ const baseParams = new URLSearchParams({
47
+ tmdbId: String(id),
48
+ type: mediaType,
49
+ });
50
+
51
+ const additionalParams = new URLSearchParams({
52
+ tmdbId: String(id),
53
+ type: mediaType,
54
+ progressive: 'true',
55
+ });
56
+
57
+ if (title) additionalParams.set('title', title);
58
+ if (year) additionalParams.set('year', String(year));
59
+ if (runtime) additionalParams.set('runtime', String(runtime));
60
+
61
+ if (isTv) {
62
+ baseParams.set('season', String(s));
63
+ baseParams.set('episode', String(e));
64
+ additionalParams.set('season', String(s));
65
+ additionalParams.set('episode', String(e));
66
+ }
67
+
68
+ const endpoints = [
69
+ `${BASE_URL}/api/sources?${baseParams.toString()}`,
70
+ `${BASE_URL}/api/sources/willow?${baseParams.toString()}`,
71
+ `${BASE_URL}/api/sources/additional?${additionalParams.toString()}`,
72
+ ];
73
+
74
+ const seenUrls = new Set();
75
+ const allUrls = [];
76
+
77
+ let pendingUrls = [...endpoints];
78
+ const maxPollTime = Date.now() + 16000;
79
+
80
+ while (pendingUrls.length > 0 && Date.now() < maxPollTime) {
81
+ const results = await Promise.all(
82
+ pendingUrls.map(url => fetchSource(url, defaultHeaders))
83
+ );
84
+
85
+ const nextPending = [];
86
+
87
+ results.forEach((data, index) => {
88
+ if (!data) return;
89
+
90
+ if (Array.isArray(data.sources) && data.sources.length > 0) {
91
+ for (const src of data.sources) {
92
+ let streamUrl = String(src?.url || '').trim();
93
+ if (!streamUrl) continue;
94
+
95
+ if (streamUrl.startsWith('/')) {
96
+ streamUrl = `${BASE_URL}${streamUrl}`;
97
+ }
98
+
99
+ if (!streamUrl.startsWith('http') || seenUrls.has(streamUrl)) continue;
100
+ seenUrls.add(streamUrl);
101
+
102
+ allUrls.push({
103
+ url: streamUrl,
104
+ server: src.label || 'Dulo',
105
+ label: src.label || 'Dulo',
106
+ quality: 'Auto',
107
+ type: streamUrl.includes('.m3u8') ? 'hls' : 'mp4',
108
+ headers: {
109
+ 'User-Agent': ua,
110
+ Referer: referer,
111
+ },
112
+ captions: Array.isArray(src.captions) ? src.captions : [],
113
+ });
114
+ }
115
+ }
116
+
117
+ if (data.pending) {
118
+ nextPending.push(pendingUrls[index]);
119
+ }
120
+ });
121
+
122
+ pendingUrls = nextPending;
123
+ if (pendingUrls.length > 0) {
124
+ await sleep(1500);
125
+ }
126
+ }
127
+
128
+ if (allUrls.length === 0) return null;
129
+
130
+ return {
131
+ url: allUrls[0].url,
132
+ headers: allUrls[0].headers,
133
+ allUrls,
134
+ };
150
135
  }