@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,54 +1,59 @@
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 separator = isTv ? '&' : '?';
6
- const basePath = isTv
7
- ? `https://f.rivo.st/api/source/tv/${id}?s=${s}&e=${e}`
8
- : `https://f.rivo.st/api/source/movie/${id}`;
9
-
10
- const headers = {
11
- 'Accept': '*/*',
12
- 'Referer': 'https://f.rivo.st/',
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 serverIndices = Array.from({ length: 26 }, (_, i) => i + 1);
17
-
18
- const responses = await Promise.allSettled(
19
- serverIndices.map(serverNum =>
20
- fetchJson(`${basePath}&server=${serverNum}`, { headers })
21
- .catch(() => null)
22
- )
23
- );
24
-
25
- const allUrls = [];
26
-
27
- for (const res of responses) {
28
- if (res.status !== 'fulfilled' || !res.value) continue;
29
- const data = res.value;
30
-
31
- if (Array.isArray(data.sources)) {
32
- for (const src of data.sources) {
33
- if (src?.url) {
34
- allUrls.push({
35
- url: src.url,
36
- server: `Rivo - ${data.server || src.subProvider || 'Server'}`,
37
- headers: {
38
- Referer: 'https://f.rivo.st/',
39
- Origin: 'https://f.rivo.st'
40
- }
41
- });
42
- }
43
- }
44
- }
45
- }
46
-
47
- if (!allUrls.length) return null;
48
-
49
- return {
50
- url: allUrls[0].url,
51
- headers: allUrls[0].headers,
52
- allUrls
53
- };
1
+ import { fetchJson } from '../utils/helpers.js';
2
+
3
+ const BASE_URL = 'https://f.rivo.st';
4
+
5
+ export async function getStream(args) {
6
+ const { id, s, e } = args || {};
7
+ const isTv = s != null && e != null;
8
+ const basePath = isTv
9
+ ? `${BASE_URL}/api/source/tv/${id}?s=${s}&e=${e}`
10
+ : `${BASE_URL}/api/source/movie/${id}`;
11
+
12
+ const headers = {
13
+ Accept: '*/*',
14
+ Referer: `${BASE_URL}/`,
15
+ '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',
16
+ };
17
+
18
+ const serverIndices = Array.from({ length: 26 }, (_, i) => i + 1);
19
+ const delimiter = basePath.includes('?') ? '&' : '?';
20
+
21
+ const responses = await Promise.allSettled(
22
+ serverIndices.map(serverNum =>
23
+ fetchJson(`${basePath}${delimiter}server=${serverNum}`, { headers })
24
+ .catch(() => null)
25
+ )
26
+ );
27
+
28
+ const allUrls = [];
29
+
30
+ for (const res of responses) {
31
+ if (res.status !== 'fulfilled' || !res.value) continue;
32
+ const data = res.value;
33
+
34
+ if (Array.isArray(data.sources)) {
35
+ for (const src of data.sources) {
36
+ if (src?.url) {
37
+ allUrls.push({
38
+ url: src.url,
39
+ server: `Rivo - ${data.server || src.subProvider || 'Server'}`,
40
+ quality: src.quality || 'Auto',
41
+ type: src.kind || (src.url.includes('.m3u8') ? 'hls' : 'mp4'),
42
+ headers: {
43
+ Referer: `${BASE_URL}/`,
44
+ Origin: BASE_URL,
45
+ },
46
+ });
47
+ }
48
+ }
49
+ }
50
+ }
51
+
52
+ if (!allUrls.length) return null;
53
+
54
+ return {
55
+ url: allUrls[0].url,
56
+ headers: allUrls[0].headers,
57
+ allUrls,
58
+ };
54
59
  }
@@ -1,129 +1,115 @@
1
- import { getUA } from '../utils/helpers.js';
2
-
3
- const BASE_URL = 'https://streamaggregator.in';
4
-
5
- async function resolveDetails(sdk, id, isTv) {
6
- const apiKey = sdk?.tmdbApiKey || process.env.TMDB_API_KEY;
7
- if (!apiKey) return null;
8
- const type = isTv ? 'tv' : 'movie';
9
- try {
10
- const res = await fetch(`https://api.themoviedb.org/3/${type}/${id}?api_key=${apiKey}`, {
11
- signal: AbortSignal.timeout(6000),
12
- });
13
- if (!res.ok) return null;
14
- const data = await res.json();
15
- const title = isTv ? data.name : data.title;
16
- const releaseDate = isTv ? data.first_air_date : data.release_date;
17
- const year = releaseDate ? releaseDate.split('-')[0] : null;
18
- return { title, year };
19
- } catch {
20
- return null;
21
- }
22
- }
23
-
24
- export async function getStream({ id, s, e, sdk }) {
25
- const isTv = Boolean(s && e);
26
- const mediaType = isTv ? 'tv' : 'movie';
27
- const ua = getUA();
28
-
29
- const details = await resolveDetails(sdk, id, isTv);
30
- const title = details?.title || String(id);
31
- const year = details?.year || '';
32
-
33
- const formattedTitle = encodeURIComponent(title).replaceAll('%20', '+');
34
- const params = new URLSearchParams({
35
- type: mediaType,
36
- stream: 'true',
37
- });
38
-
39
- if (year) params.set('year', String(year));
40
- if (isTv) {
41
- params.set('season', String(s));
42
- params.set('episode', String(e));
43
- }
44
-
45
- const scrapeUrl = `${BASE_URL}/api/scrape?title=${formattedTitle}&${params.toString()}`;
46
-
47
- const res = await fetch(scrapeUrl, {
48
- headers: {
49
- 'User-Agent': ua,
50
- Referer: `${BASE_URL}/`,
51
- Origin: BASE_URL,
52
- Accept: 'text/event-stream, application/x-ndjson, text/plain, */*',
53
- },
54
- signal: AbortSignal.timeout(90000),
55
- });
56
-
57
- if (!res.ok) return null;
58
-
59
- const lines = [];
60
- if (res.body?.getReader) {
61
- const reader = res.body.getReader();
62
- const decoder = new TextDecoder('utf-8');
63
- let buffer = '';
64
-
65
- try {
66
- while (true) {
67
- const { done, value } = await reader.read();
68
- if (done) break;
69
- buffer += decoder.decode(value, { stream: true });
70
- const parts = buffer.split('\n');
71
- buffer = parts.pop() || '';
72
- for (const part of parts) {
73
- const trimmed = part.trim();
74
- if (trimmed) lines.push(trimmed);
75
- }
76
- }
77
- } catch { }
78
- if (buffer.trim()) lines.push(buffer.trim());
79
- } else {
80
- const text = await res.text();
81
- for (const line of text.split('\n')) {
82
- const trimmed = line.trim();
83
- if (trimmed) lines.push(trimmed);
84
- }
85
- }
86
-
87
- const seenUrls = new Set();
88
- const allUrls = [];
89
-
90
- for (const line of lines) {
91
- try {
92
- const raw = line.startsWith('data:') ? line.slice(5).trim() : line;
93
- if (!raw || raw === '[DONE]') continue;
94
- const item = JSON.parse(raw);
95
- const streamUrl = String(item?.url || '').trim();
96
- if (!streamUrl || !streamUrl.startsWith('http') || seenUrls.has(streamUrl)) continue;
97
-
98
- seenUrls.add(streamUrl);
99
-
100
- const serverName = item.server || item.providerKey || 'Stream';
101
- const quality = item.quality ? ` · ${item.quality}` : '';
102
- const size = item.size ? ` (${item.size})` : '';
103
- const label = `${serverName}${quality}${size}`;
104
-
105
- const headers = {
106
- 'User-Agent': ua,
107
- ...(item.headers && typeof item.headers === 'object' ? item.headers : {}),
108
- };
109
-
110
- if (item.referer) {
111
- headers.Referer = item.referer;
112
- }
113
-
114
- allUrls.push({
115
- url: streamUrl,
116
- label,
117
- headers,
118
- });
119
- } catch { }
120
- }
121
-
122
- if (allUrls.length === 0) return null;
123
-
124
- return {
125
- url: allUrls[0].url,
126
- allUrls,
127
- headers: allUrls[0].headers,
128
- };
1
+ import { getTmdbMetadata, getUA, resolveTmdbKey } from '../utils/helpers.js';
2
+
3
+ const BASE_URL = 'https://streamaggregator.in';
4
+
5
+ export async function getStream(args) {
6
+ const { id, s, e, sdk } = args || {};
7
+ const isTv = s != null && e != null;
8
+ const mediaType = isTv ? 'tv' : 'movie';
9
+ const apiKey = resolveTmdbKey(args, sdk);
10
+ const ua = getUA();
11
+
12
+ const meta = await getTmdbMetadata(id, isTv, apiKey);
13
+ const title = meta?.title || String(id);
14
+ const year = meta?.year ? String(meta.year) : '';
15
+
16
+ const formattedTitle = encodeURIComponent(title).replaceAll('%20', '+');
17
+ const params = new URLSearchParams({
18
+ type: mediaType,
19
+ stream: 'true',
20
+ });
21
+
22
+ if (year) params.set('year', String(year));
23
+ if (isTv) {
24
+ params.set('season', String(s));
25
+ params.set('episode', String(e));
26
+ }
27
+
28
+ const scrapeUrl = `${BASE_URL}/api/scrape?title=${formattedTitle}&${params.toString()}`;
29
+
30
+ const res = await fetch(scrapeUrl, {
31
+ headers: {
32
+ 'User-Agent': ua,
33
+ Referer: `${BASE_URL}/`,
34
+ Origin: BASE_URL,
35
+ Accept: 'text/event-stream, application/x-ndjson, text/plain, */*',
36
+ },
37
+ signal: AbortSignal.timeout(90000),
38
+ });
39
+
40
+ if (!res.ok) return null;
41
+
42
+ const lines = [];
43
+ if (res.body?.getReader) {
44
+ const reader = res.body.getReader();
45
+ const decoder = new TextDecoder('utf-8');
46
+ let buffer = '';
47
+
48
+ try {
49
+ while (true) {
50
+ const { done, value } = await reader.read();
51
+ if (done) break;
52
+ buffer += decoder.decode(value, { stream: true });
53
+ const parts = buffer.split('\n');
54
+ buffer = parts.pop() || '';
55
+ for (const part of parts) {
56
+ const trimmed = part.trim();
57
+ if (trimmed) lines.push(trimmed);
58
+ }
59
+ }
60
+ } catch { }
61
+ if (buffer.trim()) lines.push(buffer.trim());
62
+ } else {
63
+ const text = await res.text();
64
+ for (const line of text.split('\n')) {
65
+ const trimmed = line.trim();
66
+ if (trimmed) lines.push(trimmed);
67
+ }
68
+ }
69
+
70
+ const seenUrls = new Set();
71
+ const allUrls = [];
72
+
73
+ for (const line of lines) {
74
+ try {
75
+ const raw = line.startsWith('data:') ? line.slice(5).trim() : line;
76
+ if (!raw || raw === '[DONE]') continue;
77
+ const item = JSON.parse(raw);
78
+ const streamUrl = String(item?.url || '').trim();
79
+ if (!streamUrl || !streamUrl.startsWith('http') || seenUrls.has(streamUrl)) continue;
80
+
81
+ seenUrls.add(streamUrl);
82
+
83
+ const serverName = item.server || item.providerKey || 'Stream';
84
+ const quality = item.quality ? ` · ${item.quality}` : '';
85
+ const size = item.size ? ` (${item.size})` : '';
86
+ const label = `${serverName}${quality}${size}`;
87
+
88
+ const headers = {
89
+ 'User-Agent': ua,
90
+ ...(item.headers && typeof item.headers === 'object' ? item.headers : {}),
91
+ };
92
+
93
+ if (item.referer) {
94
+ headers.Referer = item.referer;
95
+ }
96
+
97
+ allUrls.push({
98
+ url: streamUrl,
99
+ label,
100
+ server: serverName,
101
+ quality: item.quality || 'Auto',
102
+ type: streamUrl.includes('.m3u8') ? 'hls' : 'mp4',
103
+ headers,
104
+ });
105
+ } catch { }
106
+ }
107
+
108
+ if (allUrls.length === 0) return null;
109
+
110
+ return {
111
+ url: allUrls[0].url,
112
+ headers: allUrls[0].headers,
113
+ allUrls,
114
+ };
129
115
  }
@@ -1,63 +1,71 @@
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 path = isTv ? `/stream/tv/${id}/${s}/${e}` : `/stream/movie/${id}`;
6
- const mainUrl = `https://api.thugtv.online/api${path}`;
7
-
8
- const headers = {
9
- 'Accept': 'application/json',
10
- 'Referer': 'https://thugtv.online/',
11
- 'Origin': 'https://thugtv.online',
12
- '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'
13
- };
14
-
15
- const res = await fetchJson(mainUrl, { headers }).catch(() => null);
16
- if (!res || !Array.isArray(res.sources) || !res.sources.length) return null;
17
-
18
- const allUrls = [];
19
-
20
- for (const src of res.sources) {
21
- if (src.type === 'embed') continue;
22
-
23
- if (src.url && src.url.startsWith('http')) {
24
- allUrls.push({
25
- url: src.url,
26
- server: `ThugTV - ${src.name || src.label || 'Direct'} (${src.quality || 'Auto'})`,
27
- headers: {
28
- Referer: 'https://thugtv.online/',
29
- Origin: 'https://thugtv.online'
30
- }
31
- });
32
- continue;
33
- }
34
-
35
- if (src.resolvePath) {
36
- const cleanPath = src.resolvePath.startsWith('/') ? src.resolvePath : `/${src.resolvePath}`;
37
- const resolveUrl = `https://thugtv.online/api${cleanPath}`;
38
-
39
- try {
40
- const resolved = await fetchJson(resolveUrl, { headers });
41
- const directUrl = resolved?.source?.url;
42
- if (directUrl && directUrl.startsWith('http')) {
43
- allUrls.push({
44
- url: directUrl,
45
- server: `ThugTV - ${resolved.source.name || resolved.source.label || src.name || 'Direct'}`,
46
- headers: {
47
- Referer: 'https://thugtv.online/',
48
- Origin: 'https://thugtv.online'
49
- }
50
- });
51
- }
52
- } catch { }
53
- }
54
- }
55
-
56
- if (!allUrls.length) return null;
57
-
58
- return {
59
- url: allUrls[0].url,
60
- headers: allUrls[0].headers,
61
- allUrls
62
- };
1
+ import { fetchJson } from '../utils/helpers.js';
2
+
3
+ const BASE_URL = 'https://thugtv.online';
4
+ const API_BASE = 'https://api.thugtv.online/api';
5
+
6
+ export async function getStream(args) {
7
+ const { id, s, e } = args || {};
8
+ const isTv = s != null && e != null;
9
+ const path = isTv ? `/stream/tv/${id}/${s}/${e}` : `/stream/movie/${id}`;
10
+ const mainUrl = `${API_BASE}${path}`;
11
+
12
+ const headers = {
13
+ Accept: 'application/json',
14
+ Referer: `${BASE_URL}/`,
15
+ Origin: BASE_URL,
16
+ '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',
17
+ };
18
+
19
+ const res = await fetchJson(mainUrl, { headers }).catch(() => null);
20
+ if (!res || !Array.isArray(res.sources) || !res.sources.length) return null;
21
+
22
+ const allUrls = [];
23
+
24
+ for (const src of res.sources) {
25
+ if (src.type === 'embed') continue;
26
+
27
+ if (src.url && src.url.startsWith('http')) {
28
+ allUrls.push({
29
+ url: src.url,
30
+ server: `ThugTV - ${src.name || src.label || 'Direct'} (${src.quality || 'Auto'})`,
31
+ quality: src.quality || 'Auto',
32
+ type: src.url.includes('.m3u8') ? 'hls' : 'mp4',
33
+ headers: {
34
+ Referer: `${BASE_URL}/`,
35
+ Origin: BASE_URL,
36
+ },
37
+ });
38
+ continue;
39
+ }
40
+
41
+ if (src.resolvePath) {
42
+ const cleanPath = src.resolvePath.startsWith('/') ? src.resolvePath : `/${src.resolvePath}`;
43
+ const resolveUrl = `${BASE_URL}/api${cleanPath}`;
44
+
45
+ try {
46
+ const resolved = await fetchJson(resolveUrl, { headers });
47
+ const directUrl = resolved?.source?.url;
48
+ if (directUrl && directUrl.startsWith('http')) {
49
+ allUrls.push({
50
+ url: directUrl,
51
+ server: `ThugTV - ${resolved.source.name || resolved.source.label || src.name || 'Direct'}`,
52
+ quality: resolved.source.quality || src.quality || 'Auto',
53
+ type: directUrl.includes('.m3u8') ? 'hls' : 'mp4',
54
+ headers: {
55
+ Referer: `${BASE_URL}/`,
56
+ Origin: BASE_URL,
57
+ },
58
+ });
59
+ }
60
+ } catch { }
61
+ }
62
+ }
63
+
64
+ if (!allUrls.length) return null;
65
+
66
+ return {
67
+ url: allUrls[0].url,
68
+ headers: allUrls[0].headers,
69
+ allUrls,
70
+ };
63
71
  }