react-native-consumet 1.1.0 → 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 (111) hide show
  1. package/README.md +19 -0
  2. package/lib/commonjs/extension-registry.json +30 -1
  3. package/lib/commonjs/extractors/index.js +2 -2
  4. package/lib/commonjs/extractors/index.js.map +1 -1
  5. package/lib/commonjs/extractors/megacloud.js +11 -5
  6. package/lib/commonjs/extractors/megacloud.js.map +1 -1
  7. package/lib/commonjs/extractors/megaup.js +87 -84
  8. package/lib/commonjs/extractors/megaup.js.map +1 -1
  9. package/lib/commonjs/index.js +1 -0
  10. package/lib/commonjs/index.js.map +1 -1
  11. package/lib/commonjs/providers/anime/animekai/animekai.js +118 -0
  12. package/lib/commonjs/providers/anime/animekai/animekai.js.map +1 -0
  13. package/lib/commonjs/providers/anime/animekai/create-animekai.js +507 -0
  14. package/lib/commonjs/providers/anime/animekai/create-animekai.js.map +1 -0
  15. package/lib/commonjs/providers/anime/index.js +4 -2
  16. package/lib/commonjs/providers/anime/index.js.map +1 -1
  17. package/lib/commonjs/providers/meta/anilist.js +1 -1
  18. package/lib/commonjs/providers/movies/multistream/utils.js +252 -26
  19. package/lib/commonjs/providers/movies/multistream/utils.js.map +1 -1
  20. package/lib/commonjs/utils/extension-utils.js +1 -1
  21. package/lib/commonjs/utils/extension-utils.js.map +1 -1
  22. package/lib/commonjs/utils/provider-maps.js +3 -0
  23. package/lib/commonjs/utils/provider-maps.js.map +1 -1
  24. package/lib/module/extension-registry.json +30 -1
  25. package/lib/module/extractors/index.js +1 -1
  26. package/lib/module/extractors/index.js.map +1 -1
  27. package/lib/module/extractors/megacloud.js +11 -5
  28. package/lib/module/extractors/megacloud.js.map +1 -1
  29. package/lib/module/extractors/megaup.js +85 -82
  30. package/lib/module/extractors/megaup.js.map +1 -1
  31. package/lib/module/index.js +1 -0
  32. package/lib/module/index.js.map +1 -1
  33. package/lib/module/providers/anime/animekai/animekai.js +112 -0
  34. package/lib/module/providers/anime/animekai/animekai.js.map +1 -0
  35. package/lib/module/providers/anime/animekai/create-animekai.js +503 -0
  36. package/lib/module/providers/anime/animekai/create-animekai.js.map +1 -0
  37. package/lib/module/providers/anime/index.js +4 -2
  38. package/lib/module/providers/anime/index.js.map +1 -1
  39. package/lib/module/providers/meta/anilist.js +1 -1
  40. package/lib/module/providers/meta/anilist.js.map +1 -1
  41. package/lib/module/providers/movies/multistream/utils.js +249 -26
  42. package/lib/module/providers/movies/multistream/utils.js.map +1 -1
  43. package/lib/module/utils/extension-utils.js +1 -1
  44. package/lib/module/utils/extension-utils.js.map +1 -1
  45. package/lib/module/utils/provider-maps.js +3 -0
  46. package/lib/module/utils/provider-maps.js.map +1 -1
  47. package/lib/typescript/commonjs/src/extractors/index.d.ts +1 -1
  48. package/lib/typescript/commonjs/src/extractors/index.d.ts.map +1 -1
  49. package/lib/typescript/commonjs/src/extractors/megacloud.d.ts.map +1 -1
  50. package/lib/typescript/commonjs/src/extractors/megaup.d.ts +5 -15
  51. package/lib/typescript/commonjs/src/extractors/megaup.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/src/index.d.ts +1 -0
  53. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/src/models/provider-context.d.ts +2 -2
  55. package/lib/typescript/commonjs/src/models/provider-context.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/src/providers/anime/animekai/animekai.d.ts +83 -0
  57. package/lib/typescript/commonjs/src/providers/anime/animekai/animekai.d.ts.map +1 -0
  58. package/lib/typescript/commonjs/src/providers/anime/animekai/create-animekai.d.ts +28 -0
  59. package/lib/typescript/commonjs/src/providers/anime/animekai/create-animekai.d.ts.map +1 -0
  60. package/lib/typescript/commonjs/src/providers/anime/index.d.ts +3 -1
  61. package/lib/typescript/commonjs/src/providers/anime/index.d.ts.map +1 -1
  62. package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts +9 -0
  63. package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts.map +1 -1
  64. package/lib/typescript/commonjs/src/utils/extension-utils.d.ts +2 -2
  65. package/lib/typescript/commonjs/src/utils/extension-utils.d.ts.map +1 -1
  66. package/lib/typescript/commonjs/src/utils/provider-maps.d.ts +1 -0
  67. package/lib/typescript/commonjs/src/utils/provider-maps.d.ts.map +1 -1
  68. package/lib/typescript/module/src/extractors/index.d.ts +1 -1
  69. package/lib/typescript/module/src/extractors/index.d.ts.map +1 -1
  70. package/lib/typescript/module/src/extractors/megacloud.d.ts.map +1 -1
  71. package/lib/typescript/module/src/extractors/megaup.d.ts +5 -15
  72. package/lib/typescript/module/src/extractors/megaup.d.ts.map +1 -1
  73. package/lib/typescript/module/src/index.d.ts +1 -0
  74. package/lib/typescript/module/src/index.d.ts.map +1 -1
  75. package/lib/typescript/module/src/models/provider-context.d.ts +2 -2
  76. package/lib/typescript/module/src/models/provider-context.d.ts.map +1 -1
  77. package/lib/typescript/module/src/providers/anime/animekai/animekai.d.ts +83 -0
  78. package/lib/typescript/module/src/providers/anime/animekai/animekai.d.ts.map +1 -0
  79. package/lib/typescript/module/src/providers/anime/animekai/create-animekai.d.ts +28 -0
  80. package/lib/typescript/module/src/providers/anime/animekai/create-animekai.d.ts.map +1 -0
  81. package/lib/typescript/module/src/providers/anime/index.d.ts +3 -1
  82. package/lib/typescript/module/src/providers/anime/index.d.ts.map +1 -1
  83. package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts +9 -0
  84. package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts.map +1 -1
  85. package/lib/typescript/module/src/utils/extension-utils.d.ts +2 -2
  86. package/lib/typescript/module/src/utils/extension-utils.d.ts.map +1 -1
  87. package/lib/typescript/module/src/utils/provider-maps.d.ts +1 -0
  88. package/lib/typescript/module/src/utils/provider-maps.d.ts.map +1 -1
  89. package/package.json +4 -5
  90. package/src/extension-registry.json +30 -1
  91. package/src/extractors/index.ts +1 -1
  92. package/src/extractors/megacloud.ts +11 -5
  93. package/src/extractors/megaup.ts +92 -88
  94. package/src/index.tsx +1 -0
  95. package/src/models/provider-context.ts +2 -2
  96. package/src/providers/anime/animekai/animekai.ts +121 -0
  97. package/src/providers/anime/animekai/create-animekai.ts +579 -0
  98. package/src/providers/anime/index.ts +3 -1
  99. package/src/providers/meta/anilist.ts +1 -1
  100. package/src/providers/movies/multistream/utils.ts +213 -16
  101. package/src/utils/extension-utils.ts +1 -1
  102. package/src/utils/provider-maps.ts +3 -0
  103. package/lib/commonjs/providers/anime/animekai.js +0 -587
  104. package/lib/commonjs/providers/anime/animekai.js.map +0 -1
  105. package/lib/module/providers/anime/animekai.js +0 -583
  106. package/lib/module/providers/anime/animekai.js.map +0 -1
  107. package/lib/typescript/commonjs/src/providers/anime/animekai.d.ts +0 -89
  108. package/lib/typescript/commonjs/src/providers/anime/animekai.d.ts.map +0 -1
  109. package/lib/typescript/module/src/providers/anime/animekai.d.ts +0 -89
  110. package/lib/typescript/module/src/providers/anime/animekai.d.ts.map +0 -1
  111. package/src/providers/anime/animekai.ts +0 -627
@@ -4,14 +4,36 @@ import { load } from 'cheerio';
4
4
  import { URL } from '../../../utils/url-polyfill';
5
5
  import CryptoJS from 'crypto-js';
6
6
 
7
- export async function getVidsrcSourcesAndServers(id: string): Promise<ISource & { servers: IEpisodeServer[] }> {
7
+ export async function getDummySourcesAndServers(id: string): Promise<ISource & { servers: IEpisodeServer[] }> {
8
+ // Simulate some async work
9
+ await new Promise((resolve) => setTimeout(resolve, 100));
10
+
11
+ return {
12
+ servers: [
13
+ { name: 'DummyServer1', url: 'https://dummy.com/server1/stream.m3u8' },
14
+ { name: 'DummyServer2', url: 'https://dummy.com/server2/stream.m3u8' },
15
+ ],
16
+ sources: [
17
+ { url: 'https://dummy.com/server1/stream.m3u8', isM3U8: true, quality: 'default', name: 'DummyServer1' },
18
+ { url: 'https://dummy.com/server2/stream.m3u8', isM3U8: true, quality: 'default', name: 'DummyServer2' },
19
+ ],
20
+ subtitles: [{ url: 'https://dummy.com/subs/en.vtt', lang: 'English' }],
21
+ };
22
+ }
23
+
24
+ function getParts(id: string) {
8
25
  const parts = id.split('$');
9
26
  const [tmdbId, type, episode, season] = parts;
10
- const baseURL = 'https://vidsrc.xyz/embed/';
27
+ return [tmdbId, type, episode, season];
28
+ }
29
+
30
+ export async function getVidsrcSourcesAndServers(id: string): Promise<ISource & { servers: IEpisodeServer[] }> {
31
+ const [tmdbId, type, episode, season] = getParts(id);
32
+ const baseURL = 'https://vidsrc-embed.ru/embed/';
11
33
  const headers = {
12
34
  'User-Agent':
13
35
  'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36',
14
- 'Referer': 'https://vidsrc.xyz/',
36
+ 'Referer': 'https://vidsrc-embed.ru/',
15
37
  };
16
38
  const servers: IEpisodeServer[] = [];
17
39
  const sources: IVideo[] = [];
@@ -89,8 +111,7 @@ export async function getVidsrcSourcesAndServers(id: string): Promise<ISource &
89
111
  }
90
112
 
91
113
  export async function get111MoviesSourcesAndServers(id: string): Promise<ISource & { servers: IEpisodeServer[] }> {
92
- const parts = id.split('$');
93
- const [tmdbId, type, episode, season] = parts;
114
+ const [tmdbId, type, episode, season] = getParts(id);
94
115
  const baseUrl = 'https://111movies.com';
95
116
  const userAgent =
96
117
  'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Mobile Safari/537.36';
@@ -225,14 +246,177 @@ export async function get111MoviesSourcesAndServers(id: string): Promise<ISource
225
246
  };
226
247
  }
227
248
 
249
+ export async function getVideasySourcesAndServers(id: string): Promise<ISource & { servers: IEpisodeServer[] }> {
250
+ const servers: IEpisodeServer[] = [
251
+ { name: 'neon-org', url: 'https://api.videasy.net/myflixerzupcloud/sources-with-title' },
252
+ { name: 'sage-org', url: 'https://api.videasy.net/1movies/sources-with-title' },
253
+ { name: 'cypher-org', url: 'https://api.videasy.net/moviebox/sources-with-title' },
254
+ { name: 'yoru-org', url: 'https://api.videasy.net/cdn/sources-with-title' },
255
+ { name: 'reyna-org', url: 'https://api.videasy.net/primewire/sources-with-title' },
256
+ { name: 'omen-org', url: 'https://api.videasy.net/onionplay/sources-with-title' },
257
+ { name: 'breach-org', url: 'https://api.videasy.net/m4uhd/sources-with-title' },
258
+ { name: 'vyse-org', url: 'https://api.videasy.net/hdmovie/sources-with-title' },
259
+ { name: 'killjoy-ger', url: 'https://api.videasy.net/meine/sources-with-title?language=german' },
260
+ { name: 'harbor-ita', url: 'https://api.videasy.net/meine/sources-with-title?language=italian' },
261
+ { name: 'chamber-fr', url: 'https://api.videasy.net/meine/sources-with-title?language=french' },
262
+ { name: 'fade-hin', url: 'https://api.videasy.net/hdmovie/sources-with-title' },
263
+ { name: 'gekko-lat', url: 'https://api.videasy.net/cuevana-latino/sources-with-title' },
264
+ { name: 'kayo-spa', url: 'https://api.videasy.net/cuevana-spanish/sources-with-title' },
265
+ { name: 'raze-por', url: 'https://api.videasy.net/superflix/sources-with-title' },
266
+ { name: 'phoenix-por', url: 'https://api.videasy.net/overflix/sources-with-title' },
267
+ { name: 'astra-por', url: 'https://api.videasy.net/visioncine/sources-with-title' },
268
+ ];
269
+
270
+ const sources: IVideo[] = [];
271
+ const subtitles: ISubtitle[] = [];
272
+
273
+ const [tmdbId, type, episode, season] = getParts(id);
274
+
275
+ await Promise.all(
276
+ servers.map(async (server) => {
277
+ try {
278
+ console.log('step 1');
279
+ const url =
280
+ type === 'tv'
281
+ ? `${server.url}?mediaType=tv&tmdbId=${tmdbId}&seasonId=${season}&episodeId=${episode}`
282
+ : `${server.url}?mediaType=movie&tmdbId=${tmdbId}`;
283
+
284
+ console.log('step 2');
285
+ const { data: encData } = await axios.get(url);
286
+ console.log('step 3');
287
+ const { data: decData } = await axios.post('https://enc-dec.app/api/dec-videasy', {
288
+ text: encData,
289
+ id: tmdbId,
290
+ });
291
+ console.log('step 3');
292
+ const result = decData.result;
293
+ console.log(result);
294
+ if (result && typeof result === 'object') {
295
+ // Add sources from the decrypted data
296
+ if (result.sources && Array.isArray(result.sources)) {
297
+ result.sources.forEach((source: any) => {
298
+ sources.push({
299
+ url: source.url,
300
+ isM3U8: source.url?.includes('.m3u8') || false,
301
+ quality: source.quality || 'default',
302
+ name: server.name,
303
+ });
304
+ });
305
+ }
306
+
307
+ // Add subtitles if available
308
+ if (result.subtitles && Array.isArray(result.subtitles)) {
309
+ result.subtitles.forEach((subtitle: any) => {
310
+ subtitles.push({
311
+ url: subtitle.url,
312
+ lang: subtitle.lang || subtitle.language || 'Unknown',
313
+ });
314
+ });
315
+ }
316
+ }
317
+ } catch (err) {
318
+ // ignore bad ones
319
+ console.log(server.name, 'this failed');
320
+ }
321
+ })
322
+ );
323
+
324
+ return {
325
+ servers,
326
+ sources,
327
+ subtitles,
328
+ };
329
+ }
330
+
331
+ export async function getHexaSourcesAndServers(id: string): Promise<ISource & { servers: IEpisodeServer[] }> {
332
+ const sources: IVideo[] = [];
333
+ const subtitles: ISubtitle[] = [];
334
+ const servers: IEpisodeServer[] = [];
335
+ const [tmdbId, type, episode, season] = getParts(id);
336
+
337
+ try {
338
+ // Generate 32-byte hex key (64 hex characters)
339
+ const key = CryptoJS.lib.WordArray.random(32).toString(CryptoJS.enc.Hex);
340
+
341
+ const url =
342
+ type === 'tv'
343
+ ? `https://themoviedb.hexa.watch/api/tmdb/tv/${tmdbId}/season/${season}/episode/${episode}/images`
344
+ : `https://themoviedb.hexa.watch/api/tmdb/movie/${tmdbId}/images`;
345
+
346
+ // Get encrypted text with API key in header
347
+ const { data: encData } = await axios.get(url, {
348
+ headers: {
349
+ 'User-Agent':
350
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36',
351
+ 'Accept': 'plain/text',
352
+ 'X-Api-Key': key,
353
+ },
354
+ });
355
+ // Decrypt using the API
356
+ const { data: decData } = await axios.post('https://enc-dec.app/api/dec-hexa', {
357
+ text: encData,
358
+ key: key,
359
+ });
360
+
361
+ const result = decData.result;
362
+ if (result && typeof result === 'object') {
363
+ // Add sources from the decrypted data
364
+ if (result.sources && Array.isArray(result.sources)) {
365
+ result.sources.forEach((source: any) => {
366
+ sources.push({
367
+ url: source.url,
368
+ isM3U8: source.url?.includes('.m3u8') || false,
369
+ quality: source.quality || 'default',
370
+ name: `hexa-${source.server}`,
371
+ });
372
+ servers.push({
373
+ name: `hexa-${source.server}`,
374
+ url: source.url,
375
+ });
376
+ });
377
+ }
378
+
379
+ // Add subtitles if available
380
+ if (result.subtitles && Array.isArray(result.subtitles)) {
381
+ result.subtitles.forEach((subtitle: any) => {
382
+ subtitles.push({
383
+ url: subtitle.url,
384
+ lang: subtitle.lang || subtitle.language || 'Unknown',
385
+ });
386
+ });
387
+ }
388
+ }
389
+ } catch (err) {
390
+ // ignore errors
391
+ console.log(err);
392
+ }
393
+
394
+ return {
395
+ servers,
396
+ sources,
397
+ subtitles,
398
+ };
399
+ }
400
+
228
401
  export async function getMultiServers(id: string): Promise<IEpisodeServer[]> {
229
402
  try {
230
403
  const servers: IEpisodeServer[] = [];
231
- const [{ servers: oneoneoneServers }, { servers: vidsrcServers }] = await Promise.all([
404
+
405
+ // Fetch from all sources, handle errors individually
406
+ const results = await Promise.allSettled([
407
+ // getDummySourcesAndServers(id),
232
408
  get111MoviesSourcesAndServers(id),
233
409
  getVidsrcSourcesAndServers(id),
410
+ getVideasySourcesAndServers(id),
411
+ getHexaSourcesAndServers(id),
234
412
  ]);
235
- servers.push(...oneoneoneServers, ...vidsrcServers);
413
+
414
+ // Add servers from successful results only
415
+ results.forEach((result) => {
416
+ if (result.status === 'fulfilled') {
417
+ servers.push(...result.value.servers);
418
+ }
419
+ });
236
420
 
237
421
  return servers;
238
422
  } catch (error) {
@@ -242,19 +426,32 @@ export async function getMultiServers(id: string): Promise<IEpisodeServer[]> {
242
426
 
243
427
  export async function getMultiSources(id: string, server: string): Promise<ISource> {
244
428
  try {
245
- const [{ servers: _, ...oneoneoneSources }, { servers: __, ...vidsrcSources }] = await Promise.all([
429
+ // Fetch from all sources, handle errors individually
430
+ const results = await Promise.allSettled([
431
+ // getDummySourcesAndServers(id),
246
432
  get111MoviesSourcesAndServers(id),
247
433
  getVidsrcSourcesAndServers(id),
434
+ getVideasySourcesAndServers(id),
435
+ getHexaSourcesAndServers(id),
248
436
  ]);
249
437
 
250
- const allSources = {
251
- ...oneoneoneSources,
252
- ...vidsrcSources,
253
- sources: [...(oneoneoneSources.sources || []), ...(vidsrcSources.sources || [])],
254
- subtitles: [...(oneoneoneSources.subtitles || []), ...(vidsrcSources.subtitles || [])],
255
- };
438
+ const allSources: IVideo[] = [];
439
+ const allSubtitles: ISubtitle[] = [];
256
440
 
257
- const matchedSources = allSources.sources?.filter((source: IVideo) => source.name === server) || [];
441
+ // Collect sources and subtitles from successful results only
442
+ results.forEach((result) => {
443
+ if (result.status === 'fulfilled') {
444
+ const { servers: _, ...sourceData } = result.value;
445
+ if (sourceData.sources) {
446
+ allSources.push(...sourceData.sources);
447
+ }
448
+ if (sourceData.subtitles) {
449
+ allSubtitles.push(...sourceData.subtitles);
450
+ }
451
+ }
452
+ });
453
+ console.log({ allSources, allSubtitles });
454
+ const matchedSources = allSources.filter((source: IVideo) => source.name === server);
258
455
 
259
456
  if (matchedSources.length === 0) {
260
457
  throw new Error(`No sources found for server: ${server}`);
@@ -262,7 +459,7 @@ export async function getMultiSources(id: string, server: string): Promise<ISour
262
459
 
263
460
  return {
264
461
  sources: matchedSources,
265
- subtitles: allSources.subtitles || [],
462
+ subtitles: allSubtitles,
266
463
  };
267
464
  } catch (error) {
268
465
  throw new Error(`Failed to fetch MultiSources: ${(error as Error).message}`);
@@ -82,7 +82,7 @@ export const defaultExtractors = {
82
82
  VizCloud: VizCloud,
83
83
  VidHide: VidHide,
84
84
  Voe: Voe,
85
- MegaUp: MegaUp,
85
+ MegaUp: (ctx?: ExtractorContext) => MegaUp(ctx || defaultExtractorContext),
86
86
  };
87
87
 
88
88
  export const extractors = {
@@ -17,6 +17,9 @@ export const animeProviders = {
17
17
  get AnimePahe() {
18
18
  return require('../providers/anime/animepahe/animepahe').default;
19
19
  },
20
+ get AnimeKai() {
21
+ return require('../providers/anime/animekai/animekai').default;
22
+ },
20
23
  };
21
24
 
22
25
  export const movieProviders = {