react-native-consumet 0.6.1 → 0.7.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 (114) hide show
  1. package/android/build.gradle +6 -4
  2. package/android/generated/java/com/consumet/NativeConsumetSpec.java +6 -1
  3. package/android/generated/jni/RNConsumetSpec-generated.cpp +8 -2
  4. package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI-generated.cpp +11 -2
  5. package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI.h +14 -5
  6. package/android/src/main/assets/crypto-js.js +1 -0
  7. package/android/src/main/assets/megacloud.decodedpng.js +606 -0
  8. package/android/src/main/assets/megacloud.getsrcs.js +832 -0
  9. package/android/src/main/java/com/consumet/ConsumetModule.kt +42 -68
  10. package/android/src/main/java/com/consumet/DdosGuardModule.kt +176 -33
  11. package/ios/generated/RNConsumetSpec/RNConsumetSpec-generated.mm +9 -2
  12. package/ios/generated/RNConsumetSpec/RNConsumetSpec.h +6 -1
  13. package/ios/generated/RNConsumetSpecJSI-generated.cpp +11 -2
  14. package/ios/generated/RNConsumetSpecJSI.h +14 -5
  15. package/lib/commonjs/NativeConsumet.ts +18 -2
  16. package/lib/commonjs/extractors/megacloud/index.js +2 -3
  17. package/lib/commonjs/extractors/megacloud/index.js.map +1 -1
  18. package/lib/commonjs/extractors/megaup.js +56 -63
  19. package/lib/commonjs/extractors/megaup.js.map +1 -1
  20. package/lib/commonjs/extractors/vidcloud.js +2 -3
  21. package/lib/commonjs/extractors/vidcloud.js.map +1 -1
  22. package/lib/commonjs/index.js +0 -11
  23. package/lib/commonjs/index.js.map +1 -1
  24. package/lib/commonjs/models/types.js +1 -0
  25. package/lib/commonjs/models/types.js.map +1 -1
  26. package/lib/commonjs/providers/anime/animekai.js +3 -2
  27. package/lib/commonjs/providers/anime/animekai.js.map +1 -1
  28. package/lib/commonjs/providers/anime/animepahe.js +3 -4
  29. package/lib/commonjs/providers/anime/animepahe.js.map +1 -1
  30. package/lib/commonjs/providers/meta/anilist.js +26 -16
  31. package/lib/commonjs/providers/meta/anilist.js.map +1 -1
  32. package/lib/commonjs/providers/movies/himovies.js +404 -0
  33. package/lib/commonjs/providers/movies/himovies.js.map +1 -0
  34. package/lib/commonjs/providers/movies/index.js +5 -1
  35. package/lib/commonjs/providers/movies/index.js.map +1 -1
  36. package/lib/commonjs/providers/movies/netflixmirror.js +243 -0
  37. package/lib/commonjs/providers/movies/netflixmirror.js.map +1 -0
  38. package/lib/commonjs/utils/providers-list.js +1 -1
  39. package/lib/commonjs/utils/providers-list.js.map +1 -1
  40. package/lib/module/NativeConsumet.ts +18 -2
  41. package/lib/module/extractors/megacloud/index.js +2 -2
  42. package/lib/module/extractors/megacloud/index.js.map +1 -1
  43. package/lib/module/extractors/megaup.js +56 -63
  44. package/lib/module/extractors/megaup.js.map +1 -1
  45. package/lib/module/extractors/vidcloud.js +2 -2
  46. package/lib/module/extractors/vidcloud.js.map +1 -1
  47. package/lib/module/index.js +0 -6
  48. package/lib/module/index.js.map +1 -1
  49. package/lib/module/models/types.js +1 -0
  50. package/lib/module/models/types.js.map +1 -1
  51. package/lib/module/providers/anime/animekai.js +3 -2
  52. package/lib/module/providers/anime/animekai.js.map +1 -1
  53. package/lib/module/providers/anime/animepahe.js +1 -2
  54. package/lib/module/providers/anime/animepahe.js.map +1 -1
  55. package/lib/module/providers/meta/anilist.js +26 -16
  56. package/lib/module/providers/meta/anilist.js.map +1 -1
  57. package/lib/module/providers/movies/himovies.js +401 -0
  58. package/lib/module/providers/movies/himovies.js.map +1 -0
  59. package/lib/module/providers/movies/index.js +5 -1
  60. package/lib/module/providers/movies/index.js.map +1 -1
  61. package/lib/module/providers/movies/netflixmirror.js +240 -0
  62. package/lib/module/providers/movies/netflixmirror.js.map +1 -0
  63. package/lib/module/utils/providers-list.js +1 -1
  64. package/lib/module/utils/providers-list.js.map +1 -1
  65. package/lib/typescript/commonjs/src/NativeConsumet.d.ts +24 -3
  66. package/lib/typescript/commonjs/src/NativeConsumet.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/src/extractors/megaup.d.ts +7 -5
  68. package/lib/typescript/commonjs/src/extractors/megaup.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/src/index.d.ts +0 -3
  70. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/src/models/types.d.ts +2 -1
  72. package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/src/providers/anime/animepahe.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/src/providers/movies/himovies.d.ts +41 -0
  76. package/lib/typescript/commonjs/src/providers/movies/himovies.d.ts.map +1 -0
  77. package/lib/typescript/commonjs/src/providers/movies/index.d.ts +4 -0
  78. package/lib/typescript/commonjs/src/providers/movies/index.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/src/providers/movies/netflixmirror.d.ts +38 -0
  80. package/lib/typescript/commonjs/src/providers/movies/netflixmirror.d.ts.map +1 -0
  81. package/lib/typescript/commonjs/src/utils/providers-list.d.ts +1 -1
  82. package/lib/typescript/commonjs/src/utils/providers-list.d.ts.map +1 -1
  83. package/lib/typescript/module/src/NativeConsumet.d.ts +24 -3
  84. package/lib/typescript/module/src/NativeConsumet.d.ts.map +1 -1
  85. package/lib/typescript/module/src/extractors/megaup.d.ts +7 -5
  86. package/lib/typescript/module/src/extractors/megaup.d.ts.map +1 -1
  87. package/lib/typescript/module/src/index.d.ts +0 -3
  88. package/lib/typescript/module/src/index.d.ts.map +1 -1
  89. package/lib/typescript/module/src/models/types.d.ts +2 -1
  90. package/lib/typescript/module/src/models/types.d.ts.map +1 -1
  91. package/lib/typescript/module/src/providers/anime/animepahe.d.ts.map +1 -1
  92. package/lib/typescript/module/src/providers/meta/anilist.d.ts.map +1 -1
  93. package/lib/typescript/module/src/providers/movies/himovies.d.ts +41 -0
  94. package/lib/typescript/module/src/providers/movies/himovies.d.ts.map +1 -0
  95. package/lib/typescript/module/src/providers/movies/index.d.ts +4 -0
  96. package/lib/typescript/module/src/providers/movies/index.d.ts.map +1 -1
  97. package/lib/typescript/module/src/providers/movies/netflixmirror.d.ts +38 -0
  98. package/lib/typescript/module/src/providers/movies/netflixmirror.d.ts.map +1 -0
  99. package/lib/typescript/module/src/utils/providers-list.d.ts +1 -1
  100. package/lib/typescript/module/src/utils/providers-list.d.ts.map +1 -1
  101. package/package.json +1 -1
  102. package/src/NativeConsumet.ts +18 -2
  103. package/src/extractors/megacloud/index.ts +2 -2
  104. package/src/extractors/megaup.ts +60 -83
  105. package/src/extractors/vidcloud.ts +2 -2
  106. package/src/index.tsx +135 -138
  107. package/src/models/types.ts +1 -0
  108. package/src/providers/anime/animekai.ts +2 -2
  109. package/src/providers/anime/animepahe.ts +1 -2
  110. package/src/providers/meta/anilist.ts +28 -18
  111. package/src/providers/movies/himovies.ts +495 -0
  112. package/src/providers/movies/index.ts +4 -0
  113. package/src/providers/movies/netflixmirror.ts +287 -0
  114. package/src/utils/providers-list.ts +2 -0
package/src/index.tsx CHANGED
@@ -1,138 +1,135 @@
1
- import 'react-native-url-polyfill/auto';
2
- import Consumet from './NativeConsumet';
3
-
4
- export const { getSources, bypassDdosGuard, getDdosGuardCookiesWithWebView } = Consumet;
5
-
6
- import { ANIME, COMICS, LIGHT_NOVELS, MANGA, MOVIES, META, NEWS } from './providers';
7
- import { PROVIDERS_LIST } from './utils/providers-list';
8
- import {
9
- AsianLoad,
10
- BilibiliExtractor,
11
- Filemoon,
12
- GogoCDN,
13
- Kwik,
14
- MixDrop,
15
- Mp4Upload,
16
- RapidCloud,
17
- SmashyStream,
18
- StreamHub,
19
- StreamLare,
20
- StreamSB,
21
- StreamTape,
22
- StreamWish,
23
- VidCloud,
24
- VidMoly,
25
- VizCloud,
26
- Mp4Player,
27
- MegaCloud,
28
- VidHide,
29
- Voe,
30
- MegaUp,
31
- } from './extractors';
32
- import {
33
- type IProviderStats,
34
- type ISearch,
35
- type IAnimeEpisode,
36
- type IAnimeInfo,
37
- type IAnimeResult,
38
- type IEpisodeServer,
39
- type IVideo,
40
- type LibgenBook,
41
- StreamingServers,
42
- MediaStatus,
43
- SubOrSub,
44
- type IMangaResult,
45
- type IMangaChapter,
46
- type IMangaInfo,
47
- type ILightNovelResult,
48
- type ILightNovelInfo,
49
- type ILightNovelChapter,
50
- type ILightNovelChapterContent,
51
- type GetComicsComics,
52
- type ComicRes,
53
- type IMangaChapterPage,
54
- TvType,
55
- type IMovieEpisode,
56
- type IMovieInfo,
57
- type ISource,
58
- type ISubtitle,
59
- type IMovieResult,
60
- type Intro,
61
- Genres,
62
- type INewsFeed,
63
- Topics,
64
- type INewsInfo,
65
- type FuzzyDate,
66
- type ITitle,
67
- MediaFormat,
68
- type ProxyConfig,
69
- type AniZipEpisode,
70
- type IMovieSeason,
71
- } from './models';
72
-
73
- export { ANIME, COMICS, MANGA, LIGHT_NOVELS, MOVIES, META, NEWS };
74
- export { PROVIDERS_LIST };
75
- export {
76
- Topics,
77
- Genres,
78
- SubOrSub,
79
- StreamingServers,
80
- MediaStatus,
81
- TvType,
82
- MediaFormat,
83
- GogoCDN,
84
- StreamSB,
85
- VidCloud,
86
- MixDrop,
87
- Kwik,
88
- RapidCloud,
89
- StreamTape,
90
- StreamLare,
91
- StreamHub,
92
- SmashyStream,
93
- VizCloud,
94
- AsianLoad,
95
- BilibiliExtractor,
96
- Filemoon,
97
- Mp4Upload,
98
- StreamWish,
99
- VidMoly,
100
- MegaUp,
101
- Mp4Player,
102
- MegaCloud,
103
- VidHide,
104
- Voe,
105
- };
106
- export type {
107
- IProviderStats,
108
- IAnimeEpisode,
109
- IAnimeInfo,
110
- IAnimeResult,
111
- IEpisodeServer,
112
- IVideo,
113
- LibgenBook,
114
- IMangaResult,
115
- IMangaChapter,
116
- IMangaInfo,
117
- ILightNovelResult,
118
- ILightNovelInfo,
119
- ILightNovelChapter,
120
- ILightNovelChapterContent,
121
- GetComicsComics,
122
- ComicRes,
123
- ISearch,
124
- IMangaChapterPage,
125
- IMovieEpisode,
126
- IMovieInfo,
127
- ISource,
128
- ISubtitle,
129
- IMovieResult,
130
- Intro,
131
- INewsFeed,
132
- INewsInfo,
133
- FuzzyDate,
134
- ITitle,
135
- ProxyConfig,
136
- AniZipEpisode,
137
- IMovieSeason,
138
- };
1
+ import 'react-native-url-polyfill/auto';
2
+
3
+ import { ANIME, COMICS, LIGHT_NOVELS, MANGA, MOVIES, META, NEWS } from './providers';
4
+ import { PROVIDERS_LIST } from './utils/providers-list';
5
+ import {
6
+ AsianLoad,
7
+ BilibiliExtractor,
8
+ Filemoon,
9
+ GogoCDN,
10
+ Kwik,
11
+ MixDrop,
12
+ Mp4Upload,
13
+ RapidCloud,
14
+ SmashyStream,
15
+ StreamHub,
16
+ StreamLare,
17
+ StreamSB,
18
+ StreamTape,
19
+ StreamWish,
20
+ VidCloud,
21
+ VidMoly,
22
+ VizCloud,
23
+ Mp4Player,
24
+ MegaCloud,
25
+ VidHide,
26
+ Voe,
27
+ MegaUp,
28
+ } from './extractors';
29
+ import {
30
+ type IProviderStats,
31
+ type ISearch,
32
+ type IAnimeEpisode,
33
+ type IAnimeInfo,
34
+ type IAnimeResult,
35
+ type IEpisodeServer,
36
+ type IVideo,
37
+ type LibgenBook,
38
+ StreamingServers,
39
+ MediaStatus,
40
+ SubOrSub,
41
+ type IMangaResult,
42
+ type IMangaChapter,
43
+ type IMangaInfo,
44
+ type ILightNovelResult,
45
+ type ILightNovelInfo,
46
+ type ILightNovelChapter,
47
+ type ILightNovelChapterContent,
48
+ type GetComicsComics,
49
+ type ComicRes,
50
+ type IMangaChapterPage,
51
+ TvType,
52
+ type IMovieEpisode,
53
+ type IMovieInfo,
54
+ type ISource,
55
+ type ISubtitle,
56
+ type IMovieResult,
57
+ type Intro,
58
+ Genres,
59
+ type INewsFeed,
60
+ Topics,
61
+ type INewsInfo,
62
+ type FuzzyDate,
63
+ type ITitle,
64
+ MediaFormat,
65
+ type ProxyConfig,
66
+ type AniZipEpisode,
67
+ type IMovieSeason,
68
+ } from './models';
69
+
70
+ export { ANIME, COMICS, MANGA, LIGHT_NOVELS, MOVIES, META, NEWS };
71
+ export { PROVIDERS_LIST };
72
+ export {
73
+ Topics,
74
+ Genres,
75
+ SubOrSub,
76
+ StreamingServers,
77
+ MediaStatus,
78
+ TvType,
79
+ MediaFormat,
80
+ GogoCDN,
81
+ StreamSB,
82
+ VidCloud,
83
+ MixDrop,
84
+ Kwik,
85
+ RapidCloud,
86
+ StreamTape,
87
+ StreamLare,
88
+ StreamHub,
89
+ SmashyStream,
90
+ VizCloud,
91
+ AsianLoad,
92
+ BilibiliExtractor,
93
+ Filemoon,
94
+ Mp4Upload,
95
+ StreamWish,
96
+ VidMoly,
97
+ MegaUp,
98
+ Mp4Player,
99
+ MegaCloud,
100
+ VidHide,
101
+ Voe,
102
+ };
103
+ export type {
104
+ IProviderStats,
105
+ IAnimeEpisode,
106
+ IAnimeInfo,
107
+ IAnimeResult,
108
+ IEpisodeServer,
109
+ IVideo,
110
+ LibgenBook,
111
+ IMangaResult,
112
+ IMangaChapter,
113
+ IMangaInfo,
114
+ ILightNovelResult,
115
+ ILightNovelInfo,
116
+ ILightNovelChapter,
117
+ ILightNovelChapterContent,
118
+ GetComicsComics,
119
+ ComicRes,
120
+ ISearch,
121
+ IMangaChapterPage,
122
+ IMovieEpisode,
123
+ IMovieInfo,
124
+ ISource,
125
+ ISubtitle,
126
+ IMovieResult,
127
+ Intro,
128
+ INewsFeed,
129
+ INewsInfo,
130
+ FuzzyDate,
131
+ ITitle,
132
+ ProxyConfig,
133
+ AniZipEpisode,
134
+ IMovieSeason,
135
+ };
@@ -212,6 +212,7 @@ export enum StreamingServers {
212
212
  VidMoly = 'vidmoly',
213
213
  Voe = 'voe',
214
214
  MegaUp = 'megaup',
215
+ MegaCloud = 'megacloud',
215
216
  }
216
217
 
217
218
  export enum MediaStatus {
@@ -17,7 +17,7 @@ import {
17
17
  import { MegaUp } from '../../utils';
18
18
  import axios from 'axios';
19
19
 
20
- const { GenerateToken, DecodeIframeData } = new MegaUp();
20
+ const { GenerateToken, DecodeIframeData, Decode } = new MegaUp();
21
21
 
22
22
  class AnimeKai extends AnimeParser {
23
23
  override readonly name = 'AnimeKai';
@@ -576,7 +576,7 @@ class AnimeKai extends AnimeParser {
576
576
  const { data } = await this.client.get(`${this.baseUrl}/ajax/links/view?id=${id}&_=${GenerateToken(id!)}`, {
577
577
  headers: this.Headers(),
578
578
  });
579
- const decodedData = JSON.parse(DecodeIframeData(data.result));
579
+ const decodedData = JSON.parse(Decode(data.result));
580
580
  servers.push({
581
581
  name: `MegaUp ${$(server).text().trim()}`!, //megaup is the only server for now
582
582
  url: decodedData.url,
@@ -13,7 +13,7 @@ import {
13
13
  SubOrSub,
14
14
  } from '../../models';
15
15
  import { Kwik } from '../../extractors';
16
- import { bypassDdosGuard, getDdosGuardCookiesWithWebView } from 'react-native-consumet';
16
+ import { bypassDdosGuard, getDdosGuardCookiesWithWebView } from '../../NativeConsumet';
17
17
 
18
18
  class AnimePahe extends AnimeParser {
19
19
  override readonly name = 'AnimePahe';
@@ -29,7 +29,6 @@ class AnimePahe extends AnimeParser {
29
29
 
30
30
  constructor() {
31
31
  super();
32
- // Initialize the DDoS-Guard cookie when the instance is created
33
32
  this.initDdgCookie();
34
33
  }
35
34
 
@@ -1166,26 +1166,35 @@ class Anilist extends AnimeParser {
1166
1166
  releaseDate: item.airDate ?? item.airdate ?? item.airDateUtc,
1167
1167
  }));
1168
1168
 
1169
- function isDateClose(date1: string, date2: string, maxDaysDiff = 1) {
1170
- const d1 = new Date(date1);
1171
- const d2 = new Date(date2);
1172
- const diffTime = Math.abs(d1.getTime() - d2.getTime());
1173
- const diffDays = diffTime / (1000 * 60 * 60 * 24);
1174
- return diffDays <= maxDaysDiff;
1175
- }
1176
-
1177
1169
  function mergeEpisodes(normalizedEpisodes: any[], providerEpisodes: IAnimeEpisode[]): IAnimeEpisode[] {
1170
+ const numberMap = new Map<number, any>();
1171
+ const dateMap = new Map<number, any>();
1172
+
1173
+ normalizedEpisodes.forEach((ep) => {
1174
+ if (ep.number) numberMap.set(ep.number, ep);
1175
+ if (ep.releaseDate) {
1176
+ const ts = new Date(ep.releaseDate).getTime();
1177
+ dateMap.set(ts, ep);
1178
+ }
1179
+ });
1180
+
1178
1181
  return providerEpisodes.map((providerEp, index) => {
1179
1182
  let normalizedEp: any = null;
1180
1183
 
1181
1184
  if (providerEp.releaseDate) {
1182
- normalizedEp = normalizedEpisodes.find(
1183
- (normEp) => normEp.releaseDate && isDateClose(normEp.releaseDate, providerEp.releaseDate!)
1184
- );
1185
+ const ts = new Date(providerEp.releaseDate).getTime();
1186
+ // Find dates within 1 day range
1187
+ for (let [normTs, normEp] of dateMap) {
1188
+ if (Math.abs(ts - normTs) <= 86400000) {
1189
+ // 1 day in ms
1190
+ normalizedEp = normEp;
1191
+ break;
1192
+ }
1193
+ }
1185
1194
  }
1186
1195
 
1187
- if (!normalizedEp) {
1188
- normalizedEp = normalizedEpisodes.find((normEp) => normEp.number === providerEp.number);
1196
+ if (!normalizedEp && providerEp.number != null) {
1197
+ normalizedEp = numberMap.get(providerEp.number);
1189
1198
  }
1190
1199
 
1191
1200
  if (!normalizedEp && providerEp.title) {
@@ -1202,6 +1211,7 @@ class Anilist extends AnimeParser {
1202
1211
 
1203
1212
  return {
1204
1213
  ...providerEp,
1214
+ number: normalizedEp.number || providerEp.number,
1205
1215
  uniqueId: normalizedEp.uniqueId || providerEp.uniqueId,
1206
1216
  title: normalizedEp.title || providerEp.title,
1207
1217
  description: normalizedEp.description || providerEp.description,
@@ -1212,11 +1222,11 @@ class Anilist extends AnimeParser {
1212
1222
  });
1213
1223
  }
1214
1224
 
1215
- // console.log({
1216
- // normalizedEpisodes,
1217
- // providerEpisodes,
1218
- // merged: mergeEpisodes(normalizedEpisodes, providerEpisodes),
1219
- // });
1225
+ console.log({
1226
+ normalizedEpisodes,
1227
+ providerEpisodes,
1228
+ merged: mergeEpisodes(normalizedEpisodes, providerEpisodes),
1229
+ });
1220
1230
  possibleAnimeEpisodes = mergeEpisodes(normalizedEpisodes, providerEpisodes);
1221
1231
  if (!possibleAnimeEpisodes.length) {
1222
1232
  possibleAnimeEpisodes = await this.fetchDefaultEpisodeList(Media);