react-native-consumet 1.0.3 → 1.2.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 (160) hide show
  1. package/README.md +19 -0
  2. package/lib/commonjs/extension-registry.json +38 -4
  3. package/lib/commonjs/extractors/filemoon.js.map +1 -1
  4. package/lib/commonjs/extractors/index.js +2 -2
  5. package/lib/commonjs/extractors/index.js.map +1 -1
  6. package/lib/commonjs/extractors/megacloud.js +54 -11
  7. package/lib/commonjs/extractors/megacloud.js.map +1 -1
  8. package/lib/commonjs/extractors/megaup.js +87 -84
  9. package/lib/commonjs/extractors/megaup.js.map +1 -1
  10. package/lib/commonjs/index.js +1 -0
  11. package/lib/commonjs/index.js.map +1 -1
  12. package/lib/commonjs/models/lightnovel-parser.js.map +1 -1
  13. package/lib/commonjs/models/types.js +0 -1
  14. package/lib/commonjs/models/types.js.map +1 -1
  15. package/lib/commonjs/providers/anime/animekai/animekai.js +118 -0
  16. package/lib/commonjs/providers/anime/animekai/animekai.js.map +1 -0
  17. package/lib/commonjs/providers/anime/animekai/create-animekai.js +507 -0
  18. package/lib/commonjs/providers/anime/animekai/create-animekai.js.map +1 -0
  19. package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +30 -25
  20. package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
  21. package/lib/commonjs/providers/anime/index.js +4 -2
  22. package/lib/commonjs/providers/anime/index.js.map +1 -1
  23. package/lib/commonjs/providers/meta/anilist.js +1 -1
  24. package/lib/commonjs/providers/movies/multistream/utils.js +252 -26
  25. package/lib/commonjs/providers/movies/multistream/utils.js.map +1 -1
  26. package/lib/commonjs/utils/ExtractorManager.js +84 -8
  27. package/lib/commonjs/utils/ExtractorManager.js.map +1 -1
  28. package/lib/commonjs/utils/ProviderManager.js +1 -2
  29. package/lib/commonjs/utils/ProviderManager.js.map +1 -1
  30. package/lib/commonjs/utils/constants.js +3 -3
  31. package/lib/commonjs/utils/extension-utils.js +1 -1
  32. package/lib/commonjs/utils/extension-utils.js.map +1 -1
  33. package/lib/commonjs/utils/provider-maps.js +3 -0
  34. package/lib/commonjs/utils/provider-maps.js.map +1 -1
  35. package/lib/module/extension-registry.json +38 -4
  36. package/lib/module/extractors/filemoon.js.map +1 -1
  37. package/lib/module/extractors/index.js +1 -1
  38. package/lib/module/extractors/index.js.map +1 -1
  39. package/lib/module/extractors/megacloud.js +54 -11
  40. package/lib/module/extractors/megacloud.js.map +1 -1
  41. package/lib/module/extractors/megaup.js +85 -82
  42. package/lib/module/extractors/megaup.js.map +1 -1
  43. package/lib/module/index.js +1 -0
  44. package/lib/module/index.js.map +1 -1
  45. package/lib/module/models/lightnovel-parser.js.map +1 -1
  46. package/lib/module/models/types.js +0 -1
  47. package/lib/module/models/types.js.map +1 -1
  48. package/lib/module/providers/anime/animekai/animekai.js +112 -0
  49. package/lib/module/providers/anime/animekai/animekai.js.map +1 -0
  50. package/lib/module/providers/anime/animekai/create-animekai.js +503 -0
  51. package/lib/module/providers/anime/animekai/create-animekai.js.map +1 -0
  52. package/lib/module/providers/anime/animepahe/create-animepahe.js +30 -25
  53. package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
  54. package/lib/module/providers/anime/index.js +4 -2
  55. package/lib/module/providers/anime/index.js.map +1 -1
  56. package/lib/module/providers/meta/anilist.js +1 -1
  57. package/lib/module/providers/meta/anilist.js.map +1 -1
  58. package/lib/module/providers/movies/multistream/utils.js +249 -26
  59. package/lib/module/providers/movies/multistream/utils.js.map +1 -1
  60. package/lib/module/utils/ExtractorManager.js +84 -8
  61. package/lib/module/utils/ExtractorManager.js.map +1 -1
  62. package/lib/module/utils/ProviderManager.js +1 -2
  63. package/lib/module/utils/ProviderManager.js.map +1 -1
  64. package/lib/module/utils/constants.js +3 -3
  65. package/lib/module/utils/extension-utils.js +1 -1
  66. package/lib/module/utils/extension-utils.js.map +1 -1
  67. package/lib/module/utils/provider-maps.js +3 -0
  68. package/lib/module/utils/provider-maps.js.map +1 -1
  69. package/lib/typescript/commonjs/src/extractors/filemoon.d.ts.map +1 -1
  70. package/lib/typescript/commonjs/src/extractors/index.d.ts +1 -1
  71. package/lib/typescript/commonjs/src/extractors/index.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/src/extractors/megacloud.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/src/extractors/megaup.d.ts +5 -15
  74. package/lib/typescript/commonjs/src/extractors/megaup.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/src/index.d.ts +1 -0
  76. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/src/models/extension-manifest.d.ts +2 -0
  78. package/lib/typescript/commonjs/src/models/extension-manifest.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/src/models/lightnovel-parser.d.ts.map +1 -1
  80. package/lib/typescript/commonjs/src/models/provider-context.d.ts +2 -2
  81. package/lib/typescript/commonjs/src/models/provider-context.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/src/models/types.d.ts +0 -1
  83. package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/src/providers/anime/animekai/animekai.d.ts +83 -0
  85. package/lib/typescript/commonjs/src/providers/anime/animekai/animekai.d.ts.map +1 -0
  86. package/lib/typescript/commonjs/src/providers/anime/animekai/create-animekai.d.ts +28 -0
  87. package/lib/typescript/commonjs/src/providers/anime/animekai/create-animekai.d.ts.map +1 -0
  88. package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
  89. package/lib/typescript/commonjs/src/providers/anime/index.d.ts +3 -1
  90. package/lib/typescript/commonjs/src/providers/anime/index.d.ts.map +1 -1
  91. package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts +9 -0
  92. package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/src/utils/ExtractorManager.d.ts +20 -3
  94. package/lib/typescript/commonjs/src/utils/ExtractorManager.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts +1 -1
  96. package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/src/utils/extension-utils.d.ts +2 -2
  98. package/lib/typescript/commonjs/src/utils/extension-utils.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/src/utils/provider-maps.d.ts +1 -0
  100. package/lib/typescript/commonjs/src/utils/provider-maps.d.ts.map +1 -1
  101. package/lib/typescript/module/src/extractors/filemoon.d.ts.map +1 -1
  102. package/lib/typescript/module/src/extractors/index.d.ts +1 -1
  103. package/lib/typescript/module/src/extractors/index.d.ts.map +1 -1
  104. package/lib/typescript/module/src/extractors/megacloud.d.ts.map +1 -1
  105. package/lib/typescript/module/src/extractors/megaup.d.ts +5 -15
  106. package/lib/typescript/module/src/extractors/megaup.d.ts.map +1 -1
  107. package/lib/typescript/module/src/index.d.ts +1 -0
  108. package/lib/typescript/module/src/index.d.ts.map +1 -1
  109. package/lib/typescript/module/src/models/extension-manifest.d.ts +2 -0
  110. package/lib/typescript/module/src/models/extension-manifest.d.ts.map +1 -1
  111. package/lib/typescript/module/src/models/lightnovel-parser.d.ts.map +1 -1
  112. package/lib/typescript/module/src/models/provider-context.d.ts +2 -2
  113. package/lib/typescript/module/src/models/provider-context.d.ts.map +1 -1
  114. package/lib/typescript/module/src/models/types.d.ts +0 -1
  115. package/lib/typescript/module/src/models/types.d.ts.map +1 -1
  116. package/lib/typescript/module/src/providers/anime/animekai/animekai.d.ts +83 -0
  117. package/lib/typescript/module/src/providers/anime/animekai/animekai.d.ts.map +1 -0
  118. package/lib/typescript/module/src/providers/anime/animekai/create-animekai.d.ts +28 -0
  119. package/lib/typescript/module/src/providers/anime/animekai/create-animekai.d.ts.map +1 -0
  120. package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
  121. package/lib/typescript/module/src/providers/anime/index.d.ts +3 -1
  122. package/lib/typescript/module/src/providers/anime/index.d.ts.map +1 -1
  123. package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts +9 -0
  124. package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts.map +1 -1
  125. package/lib/typescript/module/src/utils/ExtractorManager.d.ts +20 -3
  126. package/lib/typescript/module/src/utils/ExtractorManager.d.ts.map +1 -1
  127. package/lib/typescript/module/src/utils/ProviderManager.d.ts +1 -1
  128. package/lib/typescript/module/src/utils/ProviderManager.d.ts.map +1 -1
  129. package/lib/typescript/module/src/utils/extension-utils.d.ts +2 -2
  130. package/lib/typescript/module/src/utils/extension-utils.d.ts.map +1 -1
  131. package/lib/typescript/module/src/utils/provider-maps.d.ts +1 -0
  132. package/lib/typescript/module/src/utils/provider-maps.d.ts.map +1 -1
  133. package/package.json +4 -5
  134. package/src/extension-registry.json +38 -4
  135. package/src/extractors/index.ts +1 -1
  136. package/src/extractors/megacloud.ts +56 -13
  137. package/src/extractors/megaup.ts +92 -88
  138. package/src/index.tsx +1 -0
  139. package/src/models/extension-manifest.ts +3 -0
  140. package/src/models/provider-context.ts +2 -2
  141. package/src/models/types.ts +0 -1
  142. package/src/providers/anime/animekai/animekai.ts +121 -0
  143. package/src/providers/anime/animekai/create-animekai.ts +579 -0
  144. package/src/providers/anime/animepahe/create-animepahe.ts +32 -21
  145. package/src/providers/anime/index.ts +3 -1
  146. package/src/providers/meta/anilist.ts +1 -1
  147. package/src/providers/movies/multistream/utils.ts +213 -16
  148. package/src/utils/ExtractorManager.ts +92 -9
  149. package/src/utils/ProviderManager.ts +1 -2
  150. package/src/utils/extension-utils.ts +1 -1
  151. package/src/utils/provider-maps.ts +3 -0
  152. package/lib/commonjs/providers/anime/animekai.js +0 -587
  153. package/lib/commonjs/providers/anime/animekai.js.map +0 -1
  154. package/lib/module/providers/anime/animekai.js +0 -583
  155. package/lib/module/providers/anime/animekai.js.map +0 -1
  156. package/lib/typescript/commonjs/src/providers/anime/animekai.d.ts +0 -89
  157. package/lib/typescript/commonjs/src/providers/anime/animekai.d.ts.map +0 -1
  158. package/lib/typescript/module/src/providers/anime/animekai.d.ts +0 -89
  159. package/lib/typescript/module/src/providers/anime/animekai.d.ts.map +0 -1
  160. package/src/providers/anime/animekai.ts +0 -627
@@ -122,21 +122,64 @@ export function MegaCloud(ctx: ExtractorContext): IVideoExtractor {
122
122
  if (!resp) return extractedData;
123
123
 
124
124
  if (Array.isArray(resp.sources)) {
125
- extractedData.sources = resp.sources.map((s: { file: any; type: string }) => ({
126
- url: s.file,
127
- isM3U8: s.type === 'hls',
128
- type: s.type,
129
- }));
125
+ // Process each source to extract quality information
126
+ for (const s of resp.sources) {
127
+ const isM3U8 = s.type === 'hls';
128
+
129
+ // Add the main source with "auto" quality
130
+ extractedData.sources.push({
131
+ url: s.file,
132
+ isM3U8,
133
+ quality: 'auto',
134
+ });
135
+
136
+ // If it's an M3U8 file, fetch and parse quality variants
137
+ if (isM3U8) {
138
+ try {
139
+ const m3u8Response = await fetch(s.file, {
140
+ headers: {
141
+ 'Referer': referer,
142
+ 'User-Agent': USER_AGENT || 'Mozilla/5.0',
143
+ },
144
+ });
145
+ const m3u8Content = await m3u8Response.text();
146
+ if (m3u8Content.includes('EXTM3U')) {
147
+ const pathWithoutMaster = s.file.split('/master.m3u8')[0] || s.file.split('/index.m3u8')[0];
148
+ const videoList = m3u8Content.split('#EXT-X-STREAM-INF:');
149
+ for (const video of videoList ?? []) {
150
+ if (!video.includes('m3u8')) continue;
151
+
152
+ const url = video.split('\n')[1]!.trim();
153
+ // Extract quality from RESOLUTION=WIDTHxHEIGHT
154
+ const resolutionMatch = video.match(/RESOLUTION=(\d+)x(\d+)/);
155
+ const quality = resolutionMatch ? resolutionMatch[2] : null;
156
+
157
+ // Check if URL is absolute or relative
158
+ const isAbsoluteUrl = url.startsWith('http://') || url.startsWith('https://');
159
+ const finalUrl = isAbsoluteUrl ? url : `${pathWithoutMaster}/${url}`;
160
+
161
+ extractedData.sources.push({
162
+ url: finalUrl,
163
+ quality: quality ? `${quality}p` : 'auto',
164
+ isM3U8: url.includes('.m3u8'),
165
+ });
166
+ }
167
+ }
168
+ } catch (error) {
169
+ // If fetching M3U8 fails, just use the auto quality
170
+ console.warn('[MegaCloud] Failed to fetch M3U8 variants:', error);
171
+ }
172
+ } else {
173
+ // For non-M3U8 sources, keep as is
174
+ extractedData.sources[extractedData.sources.length - 1] = {
175
+ url: s.file,
176
+ isM3U8: false,
177
+ quality: 'default',
178
+ };
179
+ }
180
+ }
130
181
  }
131
182
 
132
- extractedData.intro = resp.intro ? resp.intro : extractedData.intro;
133
- extractedData.outro = resp.outro ? resp.outro : extractedData.outro;
134
-
135
- extractedData.subtitles = resp.tracks.map((track: { file: any; label: any; kind: any }) => ({
136
- url: track.file,
137
- lang: track.label ? track.label : track.kind,
138
- }));
139
-
140
183
  extractedData.intro = resp.intro ?? extractedData.intro;
141
184
  extractedData.outro = resp.outro ?? extractedData.outro;
142
185
 
@@ -1,108 +1,112 @@
1
1
  import axios from 'axios';
2
- //extractor for https://animekai.to
3
2
 
4
- // Keys required for the decryption to work are loaded dynamically from
5
- // https://raw.githubusercontent.com/amarullz/kaicodex/main/generated/keys.json
3
+ import { type ExtractorContext, type ISource, type IVideo, type IVideoExtractor } from '../models';
4
+ import type { PolyURL } from '../utils/url-polyfill';
6
5
 
7
- import { type ISource, type IVideo, VideoExtractor } from '../models';
6
+ /**
7
+ * MegaUp extractor factory that relies on the shared extractor context
8
+ */
9
+ export function MegaUp(ctx: ExtractorContext): IVideoExtractor {
10
+ const serverName = 'MegaUp';
11
+ const sources: IVideo[] = [];
12
+ const apiBase = 'https://enc-dec.app/api';
13
+ const client = ctx.axios ?? axios;
14
+ const userAgent =
15
+ ctx.USER_AGENT ||
16
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36';
8
17
 
9
- export class MegaUp extends VideoExtractor {
10
- protected serverName: string = 'MegaUp';
11
- protected sources: IVideo[] = [];
12
- private homeKeys: string[] = [];
13
- private megaKeys: string[] = [];
14
- private kaiKeysReady: Promise<void>;
15
-
16
- constructor() {
17
- super();
18
- this.kaiKeysReady = this.loadKAIKEYS();
19
- }
20
-
21
- private async loadKAIKEYS(): Promise<void> {
22
- const extraction_keys = 'https://raw.githubusercontent.com/amarullz/kaicodex/main/generated/keys.json';
23
-
24
- const response = await axios.get(extraction_keys);
25
- const keys = await response.data;
26
-
27
- for (var i = 0; i < keys.kai.length; i++) {
28
- this.homeKeys.push(atob(keys.kai[i]));
29
- }
30
- for (var i = 0; i < keys.mega.length; i++) {
31
- this.megaKeys.push(atob(keys.mega[i]));
18
+ const decodeSources = async (
19
+ payload: string
20
+ ): Promise<{
21
+ sources: { file: string }[];
22
+ tracks: { kind: string; file: string; label?: string }[];
23
+ download: string;
24
+ }> => {
25
+ try {
26
+ const { data } = await client.post(
27
+ `${apiBase}/dec-mega`,
28
+ {
29
+ text: payload,
30
+ agent: userAgent,
31
+ },
32
+ { headers: { 'Content-Type': 'application/json' } }
33
+ );
34
+ return data.result;
35
+ } catch (error) {
36
+ throw new Error((error as Error).message);
32
37
  }
33
- }
38
+ };
34
39
 
35
- private keysChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-~!*()'.".split('');
40
+ const extract = async (videoUrl: PolyURL): Promise<ISource> => {
41
+ try {
42
+ const mediaUrl = videoUrl.href.replace('/e/', '/media/');
43
+ const { data } = await client.get(mediaUrl, {
44
+ headers: {
45
+ 'Connection': 'keep-alive',
46
+ 'User-Agent': userAgent,
47
+ },
48
+ });
36
49
 
37
- GenerateToken = (n: string) => {
38
- n = encodeURIComponent(n);
39
- const l = n.length;
40
- let o = [];
41
- for (var i = 0; i < l; i++) {
42
- const kc = this.homeKeys[this.keysChar.indexOf(n.charAt(i))];
43
- const c = kc?.charAt(i % kc.length!);
44
- o.push(c);
45
- }
46
- return btoa(o.join('')).replace(/\//g, '_').replace(/\+/g, '-').replace(/\=/g, '');
47
- };
50
+ const decrypted = await decodeSources(data.result);
48
51
 
49
- DecodeIframeData = (n: string) => {
50
- n = atob(n.replace(/_/g, '/').replace(/-/g, '+'));
51
- const l = n.length;
52
- let o = [];
53
- for (var i = 0; i < l; i++) {
54
- const c = n.charCodeAt(i);
55
- const k = this.megaKeys[c];
56
- o.push(k?.charCodeAt(i % k.length!));
57
- }
58
- return decodeURIComponent(String.fromCharCode.apply(null, o.filter((val) => val !== undefined) as number[]));
59
- };
52
+ const defaultSource: IVideo = {
53
+ url: decrypted.sources[0]?.file!,
54
+ isM3U8: decrypted.sources[0]?.file.includes('.m3u8'),
55
+ quality: 'auto',
56
+ };
60
57
 
61
- Decode = (n: string) => {
62
- n = atob(n.replace(/_/g, '/').replace(/-/g, '+'));
63
- const l = n.length;
64
- let o = [];
65
- for (var i = 0; i < l; i++) {
66
- const c = n.charCodeAt(i);
67
- let cp = '';
68
- for (var j = 0; j < this.homeKeys.length; j++) {
69
- var ck = this.homeKeys[j]?.charCodeAt(i % this.homeKeys[j]?.length!);
70
- if (ck === c) {
71
- cp = this.keysChar[j]!;
72
- break;
58
+ //split sources into multiple qualities if available
59
+ const { data: sourceRes } = await client.get(decrypted.sources[0]?.file!, {
60
+ headers: {
61
+ 'Connection': 'keep-alive',
62
+ 'User-Agent': userAgent,
63
+ },
64
+ });
65
+
66
+ if (sourceRes.includes('#EXT-X-STREAM-INF')) {
67
+ const lines = sourceRes.split('\n');
68
+ const qualitySources: ISource['sources'] = [];
69
+ for (let i = 0; i < lines.length; i++) {
70
+ if (lines[i].startsWith('#EXT-X-STREAM-INF')) {
71
+ const resolutionMatch = lines[i].match(/RESOLUTION=\d+x(\d+)/);
72
+ const quality = resolutionMatch ? `${resolutionMatch[1]}p` : `quality${qualitySources.length + 1}`;
73
+ const url = decrypted.sources[0]?.file!.split('/list')[0] + '/' + lines[i + 1];
74
+ qualitySources.push({
75
+ url,
76
+ isM3U8: true,
77
+ quality,
78
+ });
79
+ }
73
80
  }
81
+ return {
82
+ sources: [qualitySources, defaultSource].flat(),
83
+ subtitles: decrypted.tracks.map((track) => ({
84
+ kind: track.kind,
85
+ url: track.file,
86
+ lang: track.label || 'English',
87
+ })),
88
+ download: decrypted.download,
89
+ };
74
90
  }
75
- if (cp) {
76
- o.push(cp);
77
- } else {
78
- o.push('%');
79
- }
80
- }
81
- return decodeURIComponent(o.join(''));
82
- };
83
-
84
- override extract = async (videoUrl: URL): Promise<ISource> => {
85
- try {
86
- await this.kaiKeysReady;
87
-
88
- const url = videoUrl.href.replace(/\/(e|e2)\//, '/media/');
89
- const res = await axios.get(url);
90
- const decrypted = JSON.parse(this.DecodeIframeData(res.data.result).replace(/\\/g, ''));
91
- const data: ISource = {
92
- sources: decrypted.sources.map((s: { file: string }) => ({
93
- url: s.file,
94
- isM3U8: s.file.includes('.m3u8') || s.file.endsWith('m3u8'),
95
- })),
96
- subtitles: decrypted.tracks.map((t: { kind: any; file: any }) => ({
97
- kind: t.kind,
98
- url: t.file,
91
+ return {
92
+ sources: [defaultSource],
93
+ subtitles: decrypted.tracks.map((track) => ({
94
+ kind: track.kind,
95
+ url: track.file,
96
+ lang: track.label || 'English',
99
97
  })),
100
98
  download: decrypted.download,
101
99
  };
102
- return data;
103
100
  } catch (error) {
104
101
  throw new Error((error as Error).message);
105
102
  }
106
103
  };
104
+
105
+ return {
106
+ serverName,
107
+ sources,
108
+ extract,
109
+ };
107
110
  }
111
+
108
112
  export default MegaUp;
package/src/index.tsx CHANGED
@@ -1,3 +1,4 @@
1
+ import 'react-native-get-random-values';
1
2
  import { URL as PolyURL, URLSearchParams as PolyURLSearchParams } from './utils/url-polyfill';
2
3
 
3
4
  // Polyfill global scope if they don't exist
@@ -74,4 +74,7 @@ export interface ExtensionManifest {
74
74
 
75
75
  /** isSourceDirect (boolean value to represent if a provider has direct sources)*/
76
76
  isSourceDirect?: boolean;
77
+
78
+ /** does the provider have multiple servers/extractors to choose from */
79
+ haveMultiServers?: boolean;
77
80
  }
@@ -120,8 +120,8 @@ export interface ExtractorRegistry {
120
120
  ) => {
121
121
  extract: (url: URL) => Promise<any>;
122
122
  };
123
- MegaUp: new (ctx: ExtractorContext) => {
124
- extract: (url: URL) => Promise<any>;
123
+ MegaUp: (ctx?: ExtractorContext) => {
124
+ extract: (url: PolyURL) => Promise<any>;
125
125
  };
126
126
  }
127
127
 
@@ -195,7 +195,6 @@ export enum StreamingServers {
195
195
  MixDrop = 'mixdrop',
196
196
  Mp4Upload = 'mp4upload',
197
197
  UpCloud = 'upcloud',
198
- VidCloud = 'vidcloud',
199
198
  StreamTape = 'streamtape',
200
199
  VizCloud = 'vizcloud',
201
200
  // same as vizcloud
@@ -0,0 +1,121 @@
1
+ import { AnimeParser } from '../../../models';
2
+ import { createProviderContext } from '../../../utils/create-provider-context';
3
+ import createAnimeKai, { type AnimeKaiProviderInstance } from './create-animekai';
4
+
5
+ export class AnimeKai extends AnimeParser {
6
+ private instance: AnimeKaiProviderInstance;
7
+ public logo: string;
8
+
9
+ constructor(customBaseURL?: string) {
10
+ super();
11
+
12
+ const defaultContext = createProviderContext();
13
+ this.instance = createAnimeKai(defaultContext, customBaseURL);
14
+ this.logo = this.instance.logo;
15
+
16
+ this.search = this.instance.search;
17
+ this.fetchLatestCompleted = this.instance.fetchLatestCompleted;
18
+ this.fetchRecentlyAdded = this.instance.fetchRecentlyAdded;
19
+ this.fetchRecentlyUpdated = this.instance.fetchRecentlyUpdated;
20
+ this.fetchNewReleases = this.instance.fetchNewReleases;
21
+ this.fetchMovie = this.instance.fetchMovie;
22
+ this.fetchTV = this.instance.fetchTV;
23
+ this.fetchOVA = this.instance.fetchOVA;
24
+ this.fetchONA = this.instance.fetchONA;
25
+ this.fetchSpecial = this.instance.fetchSpecial;
26
+ this.fetchGenres = this.instance.fetchGenres;
27
+ this.genreSearch = this.instance.genreSearch;
28
+ this.fetchSchedule = this.instance.fetchSchedule;
29
+ this.fetchSpotlight = this.instance.fetchSpotlight;
30
+ this.fetchSearchSuggestions = this.instance.fetchSearchSuggestions;
31
+ this.fetchAnimeInfo = this.instance.fetchAnimeInfo;
32
+ this.fetchEpisodeSources = this.instance.fetchEpisodeSources;
33
+ this.fetchEpisodeServers = this.instance.fetchEpisodeServers;
34
+ }
35
+
36
+ get name() {
37
+ return this.instance.name;
38
+ }
39
+ get baseUrl() {
40
+ return this.instance.baseUrl;
41
+ }
42
+ set baseUrl(value: string) {
43
+ this.instance.baseUrl = value;
44
+ }
45
+ get classPath() {
46
+ return this.instance.classPath;
47
+ }
48
+
49
+ /**
50
+ * @param query Search query
51
+ * @param page Page number (optional)
52
+ */
53
+ search!: AnimeKaiProviderInstance['search'];
54
+ /**
55
+ * @param page number
56
+ */
57
+ fetchLatestCompleted!: AnimeKaiProviderInstance['fetchLatestCompleted'];
58
+ /**
59
+ * @param page number
60
+ */
61
+ fetchRecentlyAdded!: AnimeKaiProviderInstance['fetchRecentlyAdded'];
62
+ /**
63
+ * @param page number
64
+ */
65
+ fetchRecentlyUpdated!: AnimeKaiProviderInstance['fetchRecentlyUpdated'];
66
+ /**
67
+ * @param page number
68
+ */
69
+ fetchNewReleases!: AnimeKaiProviderInstance['fetchNewReleases'];
70
+ /**
71
+ * @param page number
72
+ */
73
+ fetchMovie!: AnimeKaiProviderInstance['fetchMovie'];
74
+ /**
75
+ * @param page number
76
+ */
77
+ fetchTV!: AnimeKaiProviderInstance['fetchTV'];
78
+ /**
79
+ * @param page number
80
+ */
81
+ fetchOVA!: AnimeKaiProviderInstance['fetchOVA'];
82
+ /**
83
+ * @param page number
84
+ */
85
+ fetchONA!: AnimeKaiProviderInstance['fetchONA'];
86
+ /**
87
+ * @param page number
88
+ */
89
+ fetchSpecial!: AnimeKaiProviderInstance['fetchSpecial'];
90
+ fetchGenres!: AnimeKaiProviderInstance['fetchGenres'];
91
+ /**
92
+ * @param page number
93
+ */
94
+ genreSearch!: AnimeKaiProviderInstance['genreSearch'];
95
+ /**
96
+ * Fetches the schedule for a given date.
97
+ * @param date The date in format 'YYYY-MM-DD'. Defaults to the current date.
98
+ * @returns A promise that resolves to an object containing the search results.
99
+ */
100
+ fetchSchedule!: AnimeKaiProviderInstance['fetchSchedule'];
101
+ fetchSpotlight!: AnimeKaiProviderInstance['fetchSpotlight'];
102
+ fetchSearchSuggestions!: AnimeKaiProviderInstance['fetchSearchSuggestions'];
103
+ /**
104
+ * @param id Anime id
105
+ */
106
+ fetchAnimeInfo!: AnimeKaiProviderInstance['fetchAnimeInfo'];
107
+ /**
108
+ *
109
+ * @param episodeId Episode id
110
+ * @param server server type (default `MegaUp`) (optional)
111
+ * @param subOrDub sub or dub (default `SubOrDub.SUB`) (optional)
112
+ */
113
+ fetchEpisodeSources!: AnimeKaiProviderInstance['fetchEpisodeSources'];
114
+ /**
115
+ * @param episodeId Episode id
116
+ * @param subOrDub sub or dub (default `sub`) (optional)
117
+ */
118
+ fetchEpisodeServers!: AnimeKaiProviderInstance['fetchEpisodeServers'];
119
+ }
120
+
121
+ export default AnimeKai;