@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.
Files changed (40) hide show
  1. package/.github/workflows/publish.yml +38 -38
  2. package/.gitlab-ci.yml +16 -0
  3. package/README.md +9 -13
  4. package/package.json +33 -32
  5. package/src/config.js +86 -118
  6. package/src/health.js +2 -2
  7. package/src/sdk.d.ts +122 -122
  8. package/src/sdk.js +7 -4
  9. package/src/sources/anineko.js +3 -1
  10. package/src/sources/cinejoy.js +194 -209
  11. package/src/sources/flaxmovies.js +113 -21
  12. package/src/sources/frame.js +88 -0
  13. package/src/sources/fsonic.js +3 -1
  14. package/src/sources/fsonline.js +3 -1
  15. package/src/sources/lmscript.js +42 -42
  16. package/src/sources/lookmovie.js +3 -1
  17. package/src/sources/luna.js +125 -0
  18. package/src/sources/mapple.js +40 -4
  19. package/src/sources/megasource.js +47 -0
  20. package/src/sources/meowtv.js +0 -1
  21. package/src/sources/nova.js +46 -0
  22. package/src/sources/peestream.js +122 -0
  23. package/src/sources/pengu.js +8 -3
  24. package/src/sources/rivestream.js +179 -0
  25. package/src/sources/videasy.js +3 -1
  26. package/src/sources/vidgod.js +147 -0
  27. package/src/sources/vidnest.js +3 -1
  28. package/src/sources/vidvault.js +113 -113
  29. package/src/sources/vidzee.js +154 -199
  30. package/src/subtitles.js +18 -0
  31. package/src/utils/helpers.js +2 -2
  32. package/src/sources/1embed.js +0 -115
  33. package/src/sources/anikoto.js +0 -198
  34. package/src/sources/anizone.js +0 -109
  35. package/src/sources/cinesu.js +0 -94
  36. package/src/sources/kickassanime.js +0 -107
  37. package/src/sources/nekowatch.js +0 -57
  38. package/src/sources/opstream.js +0 -123
  39. package/src/sources/peachify.js +0 -78
  40. package/src/sources/reanime.js +0 -324
@@ -1,114 +1,114 @@
1
- import { USER_AGENT } from '../utils/helpers.js';
2
-
3
- const BASE_URL = "https://vidvault.ru";
4
- const HEADERS = {
5
- "Referer": `${BASE_URL}/`,
6
- "Origin": BASE_URL,
7
- "User-Agent": USER_AGENT,
8
- };
9
-
10
- async function getToken() {
11
- const res = await fetch(`${BASE_URL}/api/get-token`, {
12
- method: "GET",
13
- headers: HEADERS
14
- });
15
- const data = await res.json();
16
- return data.t;
17
- }
18
-
19
- function getCaptionType(url) {
20
- return url.toLowerCase().includes(".vtt") ? "vtt" : "srt";
21
- }
22
-
23
- export async function getStream(args) {
24
- const { id, s, e } = args;
25
- const type = (s != null && e != null) ? "tv" : "movie";
26
-
27
- try {
28
- const token = await getToken();
29
-
30
- const payload = { type, tmdbId: String(id) };
31
- if (type === "tv") {
32
- payload.season = String(s);
33
- payload.episode = String(e);
34
- }
35
-
36
- const res = await fetch(`${BASE_URL}/api/download-proxy`, {
37
- method: "POST",
38
- headers: {
39
- ...HEADERS,
40
- "Content-Type": "application/json",
41
- "x-request-token": token
42
- },
43
- body: JSON.stringify(payload)
44
- });
45
- const data = await res.json();
46
-
47
- const allUrls = [];
48
- const subtitles = [];
49
-
50
- const mp4 = data?.mp4Data;
51
- if (mp4) {
52
- const country = mp4.country || "";
53
- const lanName = mp4.lanName || "";
54
- const detailPath = mp4.detailPath || "";
55
-
56
- const downloads = mp4.downloadInfo?.data?.downloads || [];
57
- for (const d of downloads) {
58
- if (!d?.url) continue;
59
- allUrls.push({
60
- quality: `${d.resolution}p ${detailPath} ${country} ${lanName}`.trim(),
61
- url: d.url,
62
- type: "mp4",
63
- headers: HEADERS
64
- });
65
- }
66
-
67
- const srtCaptions = mp4.downloadInfo?.data?.captions || [];
68
- for (const c of srtCaptions) {
69
- if (!c?.url) continue;
70
- subtitles.push({
71
- label: c.lanName || c.lan || "Unknown",
72
- type: getCaptionType(c.url),
73
- language: c.lan || "",
74
- url: c.url
75
- });
76
- }
77
- }
78
-
79
- const mkvFiles = data?.mkvData?.files || [];
80
- for (const f of mkvFiles) {
81
- if (!f?.url) continue;
82
- allUrls.push({
83
- quality: `MKV ${f.size || ""}`.trim(),
84
- url: f.url,
85
- type: "mp4",
86
- headers: HEADERS
87
- });
88
- }
89
-
90
- const mkvV2 = data?.mkvV2Data;
91
- if (mkvV2?.url) {
92
- allUrls.push({
93
- quality: `${mkvV2.quality || ""} ${mkvV2.language || ""} ${mkvV2.country || ""} (${mkvV2.size || ""})`.trim(),
94
- url: mkvV2.url,
95
- type: "mp4",
96
- headers: HEADERS
97
- });
98
- }
99
-
100
- const mkvV3 = data?.mkvV3Data;
101
- if (mkvV3?.url) {
102
- allUrls.push({
103
- quality: `${mkvV3.quality || ""} ${mkvV3.language || ""} ${mkvV3.country || ""} (${mkvV3.size || ""})`.trim(),
104
- url: mkvV3.url,
105
- type: "mp4",
106
- headers: HEADERS
107
- });
108
- }
109
-
110
- return allUrls.length ? { allUrls, subtitles } : null;
111
- } catch (err) {
112
- return null;
113
- }
1
+ import { USER_AGENT } from '../utils/helpers.js';
2
+
3
+ const BASE_URL = "https://vidvault.ru";
4
+ const HEADERS = {
5
+ "Referer": `${BASE_URL}/`,
6
+ "Origin": BASE_URL,
7
+ "User-Agent": USER_AGENT,
8
+ };
9
+
10
+ async function getToken() {
11
+ const res = await fetch(`${BASE_URL}/api/get-token`, {
12
+ method: "GET",
13
+ headers: HEADERS
14
+ });
15
+ const data = await res.json();
16
+ return data.t;
17
+ }
18
+
19
+ function getCaptionType(url) {
20
+ return url.toLowerCase().includes(".vtt") ? "vtt" : "srt";
21
+ }
22
+
23
+ export async function getStream(args) {
24
+ const { id, s, e } = args;
25
+ const type = (s != null && e != null) ? "tv" : "movie";
26
+
27
+ try {
28
+ const token = await getToken();
29
+
30
+ const payload = { type, tmdbId: String(id) };
31
+ if (type === "tv") {
32
+ payload.season = String(s);
33
+ payload.episode = String(e);
34
+ }
35
+
36
+ const res = await fetch(`${BASE_URL}/api/download-proxy`, {
37
+ method: "POST",
38
+ headers: {
39
+ ...HEADERS,
40
+ "Content-Type": "application/json",
41
+ "x-request-token": token
42
+ },
43
+ body: JSON.stringify(payload)
44
+ });
45
+ const data = await res.json();
46
+
47
+ const allUrls = [];
48
+ const subtitles = [];
49
+
50
+ const mp4 = data?.mp4Data;
51
+ if (mp4) {
52
+ const country = mp4.country || "";
53
+ const lanName = mp4.lanName || "";
54
+ const detailPath = mp4.detailPath || "";
55
+
56
+ const downloads = mp4.downloadInfo?.data?.downloads || [];
57
+ for (const d of downloads) {
58
+ if (!d?.url) continue;
59
+ allUrls.push({
60
+ quality: `${d.resolution}p ${detailPath} ${country} ${lanName}`.trim(),
61
+ url: d.url,
62
+ type: "mp4",
63
+ headers: HEADERS
64
+ });
65
+ }
66
+
67
+ const srtCaptions = mp4.downloadInfo?.data?.captions || [];
68
+ for (const c of srtCaptions) {
69
+ if (!c?.url) continue;
70
+ subtitles.push({
71
+ label: c.lanName || c.lan || "Unknown",
72
+ type: getCaptionType(c.url),
73
+ language: c.lan || "",
74
+ url: c.url
75
+ });
76
+ }
77
+ }
78
+
79
+ const mkvFiles = data?.mkvData?.files || [];
80
+ for (const f of mkvFiles) {
81
+ if (!f?.url) continue;
82
+ allUrls.push({
83
+ quality: `MKV ${f.size || ""}`.trim(),
84
+ url: f.url,
85
+ type: "mp4",
86
+ headers: HEADERS
87
+ });
88
+ }
89
+
90
+ const mkvV2 = data?.mkvV2Data;
91
+ if (mkvV2?.url) {
92
+ allUrls.push({
93
+ quality: `${mkvV2.quality || ""} ${mkvV2.language || ""} ${mkvV2.country || ""} (${mkvV2.size || ""})`.trim(),
94
+ url: mkvV2.url,
95
+ type: "mp4",
96
+ headers: HEADERS
97
+ });
98
+ }
99
+
100
+ const mkvV3 = data?.mkvV3Data;
101
+ if (mkvV3?.url) {
102
+ allUrls.push({
103
+ quality: `${mkvV3.quality || ""} ${mkvV3.language || ""} ${mkvV3.country || ""} (${mkvV3.size || ""})`.trim(),
104
+ url: mkvV3.url,
105
+ type: "mp4",
106
+ headers: HEADERS
107
+ });
108
+ }
109
+
110
+ return allUrls.length ? { allUrls, subtitles } : null;
111
+ } catch (err) {
112
+ return null;
113
+ }
114
114
  }