react-native-consumet 0.6.2 → 0.7.1

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 (124) hide show
  1. package/android/generated/java/com/consumet/NativeConsumetSpec.java +1 -1
  2. package/android/generated/jni/RNConsumetSpec-generated.cpp +2 -2
  3. package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI-generated.cpp +3 -2
  4. package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI.h +5 -5
  5. package/android/src/main/assets/crypto-js.js +1 -0
  6. package/android/src/main/assets/megacloud.decodedpng.js +606 -0
  7. package/android/src/main/assets/megacloud.getsrcs.js +832 -0
  8. package/android/src/main/java/com/consumet/ConsumetModule.kt +38 -69
  9. package/ios/generated/RNConsumetSpec/RNConsumetSpec-generated.mm +2 -2
  10. package/ios/generated/RNConsumetSpec/RNConsumetSpec.h +2 -1
  11. package/ios/generated/RNConsumetSpecJSI-generated.cpp +3 -2
  12. package/ios/generated/RNConsumetSpecJSI.h +5 -5
  13. package/lib/commonjs/NativeConsumet.ts +9 -2
  14. package/lib/commonjs/extractors/megacloud/index.js +2 -3
  15. package/lib/commonjs/extractors/megacloud/index.js.map +1 -1
  16. package/lib/commonjs/extractors/megaup.js +56 -63
  17. package/lib/commonjs/extractors/megaup.js.map +1 -1
  18. package/lib/commonjs/extractors/streamwish.js +2 -3
  19. package/lib/commonjs/extractors/streamwish.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 -13
  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 +4 -3
  29. package/lib/commonjs/providers/anime/animepahe.js.map +1 -1
  30. package/lib/commonjs/providers/meta/tmdb.js +2 -2
  31. package/lib/commonjs/providers/meta/tmdb.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 +3 -1
  35. package/lib/commonjs/providers/movies/index.js.map +1 -1
  36. package/lib/commonjs/providers/movies/multimovies.js +24 -25
  37. package/lib/commonjs/providers/movies/multimovies.js.map +1 -1
  38. package/lib/commonjs/providers/movies/netflixmirror.js +2 -2
  39. package/lib/commonjs/providers/movies/netflixmirror.js.map +1 -1
  40. package/lib/commonjs/utils/providers-list.js +1 -1
  41. package/lib/commonjs/utils/providers-list.js.map +1 -1
  42. package/lib/module/NativeConsumet.ts +9 -2
  43. package/lib/module/extractors/megacloud/index.js +2 -2
  44. package/lib/module/extractors/megacloud/index.js.map +1 -1
  45. package/lib/module/extractors/megaup.js +56 -63
  46. package/lib/module/extractors/megaup.js.map +1 -1
  47. package/lib/module/extractors/streamwish.js +2 -3
  48. package/lib/module/extractors/streamwish.js.map +1 -1
  49. package/lib/module/extractors/vidcloud.js +2 -2
  50. package/lib/module/extractors/vidcloud.js.map +1 -1
  51. package/lib/module/index.js +0 -7
  52. package/lib/module/index.js.map +1 -1
  53. package/lib/module/models/types.js +1 -0
  54. package/lib/module/models/types.js.map +1 -1
  55. package/lib/module/providers/anime/animekai.js +3 -2
  56. package/lib/module/providers/anime/animekai.js.map +1 -1
  57. package/lib/module/providers/anime/animepahe.js +2 -1
  58. package/lib/module/providers/anime/animepahe.js.map +1 -1
  59. package/lib/module/providers/meta/tmdb.js +2 -2
  60. package/lib/module/providers/meta/tmdb.js.map +1 -1
  61. package/lib/module/providers/movies/himovies.js +401 -0
  62. package/lib/module/providers/movies/himovies.js.map +1 -0
  63. package/lib/module/providers/movies/index.js +3 -1
  64. package/lib/module/providers/movies/index.js.map +1 -1
  65. package/lib/module/providers/movies/multimovies.js +24 -25
  66. package/lib/module/providers/movies/multimovies.js.map +1 -1
  67. package/lib/module/providers/movies/netflixmirror.js +1 -1
  68. package/lib/module/providers/movies/netflixmirror.js.map +1 -1
  69. package/lib/module/utils/providers-list.js +1 -1
  70. package/lib/module/utils/providers-list.js.map +1 -1
  71. package/lib/typescript/commonjs/src/NativeConsumet.d.ts +16 -3
  72. package/lib/typescript/commonjs/src/NativeConsumet.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/src/extractors/megaup.d.ts +7 -5
  74. package/lib/typescript/commonjs/src/extractors/megaup.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/src/extractors/streamwish.d.ts +1 -1
  76. package/lib/typescript/commonjs/src/extractors/streamwish.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/src/index.d.ts +0 -10
  78. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/src/models/types.d.ts +2 -1
  80. package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/src/providers/anime/animepahe.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/src/providers/meta/tmdb.d.ts.map +1 -1
  83. package/lib/typescript/commonjs/src/providers/movies/himovies.d.ts +41 -0
  84. package/lib/typescript/commonjs/src/providers/movies/himovies.d.ts.map +1 -0
  85. package/lib/typescript/commonjs/src/providers/movies/index.d.ts +2 -0
  86. package/lib/typescript/commonjs/src/providers/movies/index.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/src/providers/movies/multimovies.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/src/utils/providers-list.d.ts +1 -1
  89. package/lib/typescript/commonjs/src/utils/providers-list.d.ts.map +1 -1
  90. package/lib/typescript/module/src/NativeConsumet.d.ts +16 -3
  91. package/lib/typescript/module/src/NativeConsumet.d.ts.map +1 -1
  92. package/lib/typescript/module/src/extractors/megaup.d.ts +7 -5
  93. package/lib/typescript/module/src/extractors/megaup.d.ts.map +1 -1
  94. package/lib/typescript/module/src/extractors/streamwish.d.ts +1 -1
  95. package/lib/typescript/module/src/extractors/streamwish.d.ts.map +1 -1
  96. package/lib/typescript/module/src/index.d.ts +0 -10
  97. package/lib/typescript/module/src/index.d.ts.map +1 -1
  98. package/lib/typescript/module/src/models/types.d.ts +2 -1
  99. package/lib/typescript/module/src/models/types.d.ts.map +1 -1
  100. package/lib/typescript/module/src/providers/anime/animepahe.d.ts.map +1 -1
  101. package/lib/typescript/module/src/providers/meta/tmdb.d.ts.map +1 -1
  102. package/lib/typescript/module/src/providers/movies/himovies.d.ts +41 -0
  103. package/lib/typescript/module/src/providers/movies/himovies.d.ts.map +1 -0
  104. package/lib/typescript/module/src/providers/movies/index.d.ts +2 -0
  105. package/lib/typescript/module/src/providers/movies/index.d.ts.map +1 -1
  106. package/lib/typescript/module/src/providers/movies/multimovies.d.ts.map +1 -1
  107. package/lib/typescript/module/src/utils/providers-list.d.ts +1 -1
  108. package/lib/typescript/module/src/utils/providers-list.d.ts.map +1 -1
  109. package/package.json +1 -1
  110. package/src/NativeConsumet.ts +9 -2
  111. package/src/extractors/megacloud/index.ts +2 -2
  112. package/src/extractors/megaup.ts +60 -83
  113. package/src/extractors/streamwish.ts +5 -3
  114. package/src/extractors/vidcloud.ts +2 -2
  115. package/src/index.tsx +135 -138
  116. package/src/models/types.ts +1 -0
  117. package/src/providers/anime/animekai.ts +2 -2
  118. package/src/providers/anime/animepahe.ts +2 -1
  119. package/src/providers/meta/tmdb.ts +2 -1
  120. package/src/providers/movies/himovies.ts +495 -0
  121. package/src/providers/movies/index.ts +2 -0
  122. package/src/providers/movies/multimovies.ts +23 -24
  123. package/src/providers/movies/netflixmirror.ts +1 -1
  124. package/src/utils/providers-list.ts +1 -0
@@ -0,0 +1,495 @@
1
+ import { load } from 'cheerio';
2
+
3
+ import {
4
+ MovieParser,
5
+ TvType,
6
+ type IMovieInfo,
7
+ type IEpisodeServer,
8
+ StreamingServers,
9
+ type ISource,
10
+ type IMovieResult,
11
+ type ISearch,
12
+ } from '../../models';
13
+ import { MegaCloud, VidCloud } from '../../extractors';
14
+
15
+ class HiMovies extends MovieParser {
16
+ override readonly name = 'HiMovies';
17
+ protected override baseUrl = 'https://himovies.sx';
18
+ protected override logo = 'https://himovies.sx/images/group_1/theme_1/favicon.png';
19
+ protected override classPath = 'MOVIES.HiMovies';
20
+ override supportedTypes = new Set([TvType.MOVIE, TvType.TVSERIES]);
21
+ constructor(customBaseURL?: string) {
22
+ super(...arguments);
23
+ if (customBaseURL) {
24
+ if (customBaseURL.startsWith('http://') || customBaseURL.startsWith('https://')) {
25
+ this.baseUrl = customBaseURL;
26
+ } else {
27
+ this.baseUrl = `http://${customBaseURL}`;
28
+ }
29
+ } else {
30
+ this.baseUrl = this.baseUrl;
31
+ }
32
+ }
33
+
34
+ /**
35
+ *
36
+ * @param query search query string
37
+ * @param page page number (default 1) (optional)
38
+ */
39
+ override search = async (query: string, page: number = 1): Promise<ISearch<IMovieResult>> => {
40
+ const searchResult: ISearch<IMovieResult> = {
41
+ currentPage: page,
42
+ hasNextPage: false,
43
+ results: [],
44
+ };
45
+ try {
46
+ const { data } = await this.client.get(`${this.baseUrl}/search/${query.replace(/[\W_]+/g, '-')}?page=${page}`);
47
+
48
+ const $ = load(data);
49
+
50
+ const navSelector = 'div.pre-pagination > nav:nth-child(1) > ul:nth-child(1)';
51
+ searchResult.hasNextPage =
52
+ $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('active') : false;
53
+
54
+ $('.film_list-wrap > div.flw-item').each((i, el) => {
55
+ const releaseDate = $(el).find('div.film-detail > div.fd-infor > span:nth-child(1)').text();
56
+ searchResult.results.push({
57
+ id: $(el).find('div.film-poster > a').attr('href')?.slice(1)!,
58
+ title: $(el).find('div.film-detail > h2 > a').attr('title')!,
59
+ url: `${this.baseUrl}${$(el).find('div.film-poster > a').attr('href')}`,
60
+ image: $(el).find('div.film-poster > img').attr('data-src'),
61
+ releaseDate: isNaN(parseInt(releaseDate)) ? undefined : releaseDate,
62
+ seasons: releaseDate.includes('SS') ? parseInt(releaseDate.split('SS')[1]!) : undefined,
63
+ type:
64
+ $(el).find('div.film-detail > div.fd-infor > span.float-right').text() === 'Movie'
65
+ ? TvType.MOVIE
66
+ : TvType.TVSERIES,
67
+ });
68
+ });
69
+
70
+ return searchResult;
71
+ } catch (err) {
72
+ throw new Error((err as Error).message);
73
+ }
74
+ };
75
+
76
+ /**
77
+ *
78
+ * @param mediaId media link or id
79
+ */
80
+ override fetchMediaInfo = async (mediaId: string): Promise<IMovieInfo> => {
81
+ if (!mediaId.startsWith(this.baseUrl)) {
82
+ mediaId = `${this.baseUrl}/${mediaId}`;
83
+ }
84
+
85
+ const movieInfo: IMovieInfo = {
86
+ id: mediaId.split('sx/').pop()!,
87
+ title: '',
88
+ url: mediaId,
89
+ };
90
+ try {
91
+ const { data } = await this.client.get(mediaId);
92
+ const $ = load(data);
93
+ const recommendationsArray: IMovieResult[] = [];
94
+
95
+ $('section.block_area > div.block_area-content > div.film_list-wrap > div.flw-item').each((i, el) => {
96
+ recommendationsArray.push({
97
+ id: $(el).find('div.film-poster > a').attr('href')?.slice(1)!,
98
+ title: $(el).find('div.film-detail > h3.film-name > a').text(),
99
+ image: $(el).find('div.film-poster > img').attr('data-src'),
100
+ duration: $(el).find('div.film-detail > div.fd-infor > span.fdi-duration').text().replace('m', '') ?? null,
101
+ type:
102
+ $(el).find('div.film-detail > div.fd-infor > span.fdi-type').text() === 'TV'
103
+ ? TvType.TVSERIES
104
+ : (TvType.MOVIE ?? null),
105
+ });
106
+ });
107
+
108
+ const uid = $('.detail_page-watch').attr('data-id')!;
109
+ movieInfo.cover = $('div.cover_follow').attr('style')?.slice(22).replace(')', '').replace(';', '');
110
+ movieInfo.title = $('.heading-name > a:nth-child(1)').text();
111
+ movieInfo.image = $('.film-poster > img:nth-child(1)').attr('src');
112
+ movieInfo.description = $('.description').text().trim();
113
+ movieInfo.type = movieInfo.id.includes('tv/') ? TvType.TVSERIES : TvType.MOVIE;
114
+ movieInfo.releaseDate = $('div.row-line:contains(Released:)').text().replace('Released:', '').trim();
115
+ movieInfo.genres = $('div.row-line:contains(Genre:) a')
116
+ .map((i, el) => $(el).text().split('&'))
117
+ .get()
118
+ .map((v) => v.trim());
119
+ movieInfo.casts = $('.row-line:contains(Casts:) a')
120
+ .map((i, el) => $(el).text())
121
+ .get();
122
+ movieInfo.production = $('.row-line:contains(Production:) a').text().trim();
123
+ movieInfo.country = $('.row-line:contains(Country:) a').text().trim();
124
+ movieInfo.duration = $('.row-line:contains(Duration:)')
125
+ .text()
126
+ .replace('Duration:', '')
127
+ .replace(/\s+/g, ' ')
128
+ .trim();
129
+ movieInfo.rating = parseFloat($('.dp-i-stats > span.item:nth-child(3)').text().replace('IMDB:', '').trim());
130
+ movieInfo.recommendations = recommendationsArray as any;
131
+ const ajaxReqUrl = (id: string, type: string, isSeasons: boolean = false) =>
132
+ `${this.baseUrl}/ajax/${type === 'movie' ? type : ``}${isSeasons ? 'season/list' : 'season/episodes'}/${id}`;
133
+
134
+ if (movieInfo.type === TvType.TVSERIES) {
135
+ const { data } = await this.client.get(ajaxReqUrl(uid, 'tv', true));
136
+ const $$ = load(data);
137
+ const seasonsIds = $$('.dropdown-menu > a')
138
+ .map((i, el) => $(el).attr('data-id'))
139
+ .get();
140
+
141
+ movieInfo.episodes = [];
142
+ let season = 1;
143
+ for (const id of seasonsIds) {
144
+ const { data } = await this.client.get(ajaxReqUrl(id, 'season'));
145
+ const $$$ = load(data);
146
+
147
+ $$$('.nav > li')
148
+ .map((i, el) => {
149
+ const episode = {
150
+ id: $$$(el).find('a').attr('id')!.split('-')[1]!,
151
+ title: $$$(el).find('a').attr('title')!,
152
+ number: parseInt($$$(el).find('a').attr('title')!.split(':')[0]!.slice(3).trim()),
153
+ season: season,
154
+ url: `${this.baseUrl}/ajax/episode/servers/${$$$(el).find('a').attr('id')!.split('-')[1]}`,
155
+ };
156
+ movieInfo.episodes?.push(episode);
157
+ })
158
+ .get();
159
+ season++;
160
+ }
161
+ } else {
162
+ movieInfo.episodes = [
163
+ {
164
+ id: uid,
165
+ title: movieInfo.title,
166
+ url: `${this.baseUrl}/ajax/episode/list/${uid}`,
167
+ },
168
+ ];
169
+ }
170
+
171
+ return movieInfo;
172
+ } catch (err) {
173
+ console.log(err);
174
+ throw new Error((err as Error).message);
175
+ }
176
+ };
177
+
178
+ /**
179
+ *
180
+ * @param episodeId episode id
181
+ * @param mediaId media id
182
+ * @param server server type (default `MegaCloud`) (optional)
183
+ */
184
+ override fetchEpisodeSources = async (
185
+ episodeId: string,
186
+ mediaId: string,
187
+ server: StreamingServers = StreamingServers.MegaCloud
188
+ ): Promise<ISource> => {
189
+ if (episodeId.startsWith('http')) {
190
+ const serverUrl = new URL(episodeId);
191
+ switch (server) {
192
+ case StreamingServers.MegaCloud:
193
+ return {
194
+ headers: { Referer: serverUrl.href },
195
+ ...(await new MegaCloud(this.proxyConfig, this.adapter).extract(serverUrl, this.baseUrl)),
196
+ };
197
+ case StreamingServers.UpCloud:
198
+ return {
199
+ headers: { Referer: serverUrl.href },
200
+ ...(await new VidCloud(this.proxyConfig, this.adapter).extract(serverUrl, undefined, this.baseUrl)),
201
+ };
202
+ default:
203
+ return {
204
+ headers: { Referer: serverUrl.href },
205
+ ...(await new MegaCloud(this.proxyConfig, this.adapter).extract(serverUrl, this.baseUrl)),
206
+ };
207
+ }
208
+ }
209
+
210
+ try {
211
+ const servers = await this.fetchEpisodeServers(episodeId, mediaId);
212
+
213
+ const i = servers.findIndex((s) => s.name === server);
214
+
215
+ if (i === -1) {
216
+ throw new Error(`Server ${server} not found`);
217
+ }
218
+
219
+ const { data } = await this.client.get(
220
+ `${this.baseUrl}/ajax/episode/sources/${servers[i]!.url.split('.').slice(-1).shift()}`
221
+ );
222
+
223
+ const serverUrl: URL = new URL(data.link);
224
+
225
+ return await this.fetchEpisodeSources(serverUrl.href, mediaId, server);
226
+ } catch (err) {
227
+ console.log(err, 'err');
228
+ throw new Error((err as Error).message);
229
+ }
230
+ };
231
+
232
+ /**
233
+ *
234
+ * @param episodeId takes episode link or movie id
235
+ * @param mediaId takes movie link or id (found on movie info object)
236
+ */
237
+ override fetchEpisodeServers = async (episodeId: string, mediaId: string): Promise<IEpisodeServer[]> => {
238
+ if (!episodeId.startsWith(this.baseUrl + '/ajax') && !mediaId.includes('movie')) {
239
+ episodeId = `${this.baseUrl}/ajax/episode/servers/${episodeId}`;
240
+ } else {
241
+ episodeId = `${this.baseUrl}/ajax/episode/list/${episodeId}`;
242
+ }
243
+ try {
244
+ const { data } = await this.client.get(episodeId);
245
+ const $ = load(data);
246
+
247
+ const servers = $('ul.nav > li')
248
+ .map((i, el) => {
249
+ const server = {
250
+ name: $(el).find('a').attr('title')!.slice(6).toLowerCase().replace('server', '').trim(),
251
+ url: `${this.baseUrl}/${mediaId}.${$(el).find('a').attr('data-id')}`.replace(
252
+ !mediaId.includes('movie') ? /\/tv\// : /\/movie\//,
253
+ !mediaId.includes('movie') ? '/watch-tv/' : '/watch-movie/'
254
+ ),
255
+ };
256
+ return server;
257
+ })
258
+ .get();
259
+ return servers;
260
+ } catch (err) {
261
+ throw new Error((err as Error).message);
262
+ }
263
+ };
264
+
265
+ fetchRecentMovies = async (): Promise<IMovieResult[]> => {
266
+ try {
267
+ const { data } = await this.client.get(`${this.baseUrl}/home`);
268
+ const $ = load(data);
269
+
270
+ const movies = $(
271
+ 'section.block_area:contains("Latest Movies") > div:nth-child(2) > div:nth-child(1) > div.flw-item'
272
+ )
273
+ .map((i, el) => {
274
+ const releaseDate = $(el).find('div.film-detail > div.fd-infor > span:nth-child(1)').text();
275
+ const movie: any = {
276
+ id: $(el).find('div.film-poster > a').attr('href')?.slice(1)!,
277
+ title: $(el).find('div.film-detail > h3.film-name > a').attr('title')!,
278
+ url: `${this.baseUrl}${$(el).find('div.film-poster > a').attr('href')}`,
279
+ image: $(el).find('div.film-poster > img').attr('data-src'),
280
+ releaseDate: isNaN(parseInt(releaseDate)) ? undefined : releaseDate,
281
+ duration: $(el).find('div.film-detail > div.fd-infor > span.fdi-duration').text() || null,
282
+ type:
283
+ $(el).find('div.film-detail > div.fd-infor > span.float-right').text() === 'Movie'
284
+ ? TvType.MOVIE
285
+ : TvType.TVSERIES,
286
+ };
287
+ return movie;
288
+ })
289
+ .get();
290
+ return movies;
291
+ } catch (err) {
292
+ throw new Error((err as Error).message);
293
+ }
294
+ };
295
+
296
+ fetchRecentTvShows = async (): Promise<IMovieResult[]> => {
297
+ try {
298
+ const { data } = await this.client.get(`${this.baseUrl}/home`);
299
+ const $ = load(data);
300
+
301
+ const tvshows = $(
302
+ 'section.block_area:contains("Latest TV Shows") > div:nth-child(2) > div:nth-child(1) > div.flw-item'
303
+ )
304
+ .map((i, el) => {
305
+ const tvshow = {
306
+ id: $(el).find('div.film-poster > a').attr('href')?.slice(1)!,
307
+ title: $(el).find('div.film-detail > h3.film-name > a').attr('title')!,
308
+ url: `${this.baseUrl}${$(el).find('div.film-poster > a').attr('href')}`,
309
+ image: $(el).find('div.film-poster > img').attr('data-src'),
310
+ season: $(el).find('div.film-detail > div.fd-infor > span:nth-child(1)').text().replace('SS', '').trim(),
311
+ latestEpisode:
312
+ $(el).find('div.film-detail > div.fd-infor > span:nth-child(3)').text().replace('EPS', '').trim() || null,
313
+ type:
314
+ $(el).find('div.film-detail > div.fd-infor > span.float-right').text() === 'Movie'
315
+ ? TvType.MOVIE
316
+ : TvType.TVSERIES,
317
+ };
318
+ return tvshow;
319
+ })
320
+ .get();
321
+ return tvshows;
322
+ } catch (err) {
323
+ throw new Error((err as Error).message);
324
+ }
325
+ };
326
+
327
+ fetchTrendingMovies = async (): Promise<IMovieResult[]> => {
328
+ try {
329
+ const { data } = await this.client.get(`${this.baseUrl}/home`);
330
+ const $ = load(data);
331
+
332
+ const movies = $('div#trending-movies div.film_list-wrap div.flw-item')
333
+ .map((i, el) => {
334
+ const releaseDate = $(el).find('div.film-detail > div.fd-infor > span:nth-child(1)').text();
335
+ const movie: any = {
336
+ id: $(el).find('div.film-poster > a').attr('href')?.slice(1)!,
337
+ title: $(el).find('div.film-detail > h3.film-name > a').attr('title')!,
338
+ url: `${this.baseUrl}${$(el).find('div.film-poster > a').attr('href')}`,
339
+ image: $(el).find('div.film-poster > img').attr('data-src'),
340
+ releaseDate: isNaN(parseInt(releaseDate)) ? undefined : releaseDate,
341
+ duration: $(el).find('div.film-detail > div.fd-infor > span.fdi-duration').text() || null,
342
+ type:
343
+ $(el).find('div.film-detail > div.fd-infor > span.float-right').text() === 'Movie'
344
+ ? TvType.MOVIE
345
+ : TvType.TVSERIES,
346
+ };
347
+ return movie;
348
+ })
349
+ .get();
350
+ return movies;
351
+ } catch (err) {
352
+ throw new Error((err as Error).message);
353
+ }
354
+ };
355
+
356
+ fetchTrendingTvShows = async (): Promise<IMovieResult[]> => {
357
+ try {
358
+ const { data } = await this.client.get(`${this.baseUrl}/home`);
359
+ const $ = load(data);
360
+
361
+ const tvshows = $('div#trending-tv div.film_list-wrap div.flw-item')
362
+ .map((i, el) => {
363
+ const tvshow = {
364
+ id: $(el).find('div.film-poster > a').attr('href')?.slice(1)!,
365
+ title: $(el).find('div.film-detail > h3.film-name > a').attr('title')!,
366
+ url: `${this.baseUrl}${$(el).find('div.film-poster > a').attr('href')}`,
367
+ image: $(el).find('div.film-poster > img').attr('data-src'),
368
+ season: $(el).find('div.film-detail > div.fd-infor > span:nth-child(1)').text().replace('SS', '').trim(),
369
+ latestEpisode:
370
+ $(el).find('div.film-detail > div.fd-infor > span:nth-child(3)').text().replace('EPS', '').trim() || null,
371
+ type:
372
+ $(el).find('div.film-detail > div.fd-infor > span.float-right').text() === 'Movie'
373
+ ? TvType.MOVIE
374
+ : TvType.TVSERIES,
375
+ };
376
+ return tvshow;
377
+ })
378
+ .get();
379
+ return tvshows;
380
+ } catch (err) {
381
+ throw new Error((err as Error).message);
382
+ }
383
+ };
384
+
385
+ fetchByCountry = async (country: string, page: number = 1): Promise<ISearch<IMovieResult>> => {
386
+ const result: ISearch<IMovieResult> = {
387
+ currentPage: page,
388
+ hasNextPage: false,
389
+ results: [],
390
+ };
391
+ const navSelector = 'div.pre-pagination > nav:nth-child(1) > ul:nth-child(1)';
392
+
393
+ try {
394
+ const { data } = await this.client.get(`${this.baseUrl}/country/${country}/?page=${page}`);
395
+ const $ = load(data);
396
+
397
+ result.hasNextPage = $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('active') : false;
398
+
399
+ $('div.container > section.block_area > div.block_area-content > div.film_list-wrap > div.flw-item')
400
+ .each((i, el) => {
401
+ const resultItem: IMovieResult = {
402
+ id: $(el).find('div.film-poster > a').attr('href')?.slice(1) ?? '',
403
+ title: $(el).find('div.film-detail > h2.film-name > a').attr('title') ?? '',
404
+ url: `${this.baseUrl}${$(el).find('div.film-poster > a').attr('href')}`,
405
+ image: $(el).find('div.film-poster > img').attr('data-src'),
406
+ type:
407
+ $(el).find('div.film-detail > div.fd-infor > span.float-right').text() === 'Movie'
408
+ ? TvType.MOVIE
409
+ : TvType.TVSERIES,
410
+ };
411
+ const season = $(el)
412
+ .find('div.film-detail > div.fd-infor > span:nth-child(1)')
413
+ .text()
414
+ .replace('SS', '')
415
+ .trim();
416
+ const latestEpisode =
417
+ $(el).find('div.film-detail > div.fd-infor > span:nth-child(3)').text().replace('EPS', '').trim() ?? null;
418
+ if (resultItem.type === TvType.TVSERIES) {
419
+ resultItem.season = season;
420
+ resultItem.latestEpisode = latestEpisode;
421
+ } else {
422
+ resultItem.releaseDate = season;
423
+ resultItem.duration = latestEpisode;
424
+ }
425
+ result.results.push(resultItem);
426
+ })
427
+ .get();
428
+ return result;
429
+ } catch (err) {
430
+ throw new Error((err as Error).message);
431
+ }
432
+ };
433
+
434
+ fetchByGenre = async (genre: string, page: number = 1): Promise<ISearch<IMovieResult>> => {
435
+ const result: ISearch<IMovieResult> = {
436
+ currentPage: page,
437
+ hasNextPage: false,
438
+ results: [],
439
+ };
440
+ try {
441
+ const { data } = await this.client.get(`${this.baseUrl}/genre/${genre}?page=${page}`);
442
+
443
+ const $ = load(data);
444
+
445
+ const navSelector = 'div.pre-pagination > nav:nth-child(1) > ul:nth-child(1)';
446
+
447
+ result.hasNextPage = $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('active') : false;
448
+
449
+ $('.film_list-wrap > div.flw-item')
450
+ .each((i, el) => {
451
+ const resultItem: IMovieResult = {
452
+ id: $(el).find('div.film-poster > a').attr('href')?.slice(1) ?? '',
453
+ title: $(el).find('div.film-detail > h2 > a').attr('title') ?? '',
454
+ url: `${this.baseUrl}${$(el).find('div.film-poster > a').attr('href')}`,
455
+ image: $(el).find('div.film-poster > img').attr('data-src'),
456
+ type:
457
+ $(el).find('div.film-detail > div.fd-infor > span.float-right').text() === 'Movie'
458
+ ? TvType.MOVIE
459
+ : TvType.TVSERIES,
460
+ };
461
+ const season = $(el)
462
+ .find('div.film-detail > div.fd-infor > span:nth-child(1)')
463
+ .text()
464
+ .replace('SS', '')
465
+ .trim();
466
+ const latestEpisode =
467
+ $(el).find('div.film-detail > div.fd-infor > span:nth-child(3)').text().replace('EPS', '').trim() ?? null;
468
+ if (resultItem.type === TvType.TVSERIES) {
469
+ resultItem.season = season;
470
+ resultItem.latestEpisode = latestEpisode;
471
+ } else {
472
+ resultItem.releaseDate = season;
473
+ resultItem.duration = latestEpisode;
474
+ }
475
+ result.results.push(resultItem);
476
+ })
477
+ .get();
478
+
479
+ return result;
480
+ } catch (err) {
481
+ throw new Error((err as Error).message);
482
+ }
483
+ };
484
+ }
485
+
486
+ // (async () => {
487
+ // const movie = new HiMovies();
488
+ // const search = await movie.search('jujutsu');
489
+ // const movieInfo = await movie.fetchMediaInfo(search.results[0].id);
490
+ // // const recentTv = await movie.fetchTrendingTvShows();
491
+ // const genre = await movie.fetchEpisodeSources(movieInfo.episodes![0].id, movieInfo.id);
492
+ // console.log(genre);
493
+ // })();
494
+
495
+ export default HiMovies;
@@ -10,6 +10,7 @@ import ViewAsian from './viewAsian';
10
10
  import SFlix from './sflix';
11
11
  import MultiMovies from './multimovies';
12
12
  import NetflixMirror from './netflixmirror';
13
+ import HiMovies from './himovies';
13
14
 
14
15
  export default {
15
16
  DramaCool,
@@ -24,4 +25,5 @@ export default {
24
25
  SFlix,
25
26
  MultiMovies,
26
27
  NetflixMirror,
28
+ HiMovies,
27
29
  };
@@ -13,9 +13,9 @@ import { MixDrop, StreamTape, StreamWish, VidHide } from '../../extractors';
13
13
 
14
14
  class MultiMovies extends MovieParser {
15
15
  override readonly name = 'MultiMovies';
16
- protected override baseUrl = 'https://multimovies.digital';
16
+ protected override baseUrl = 'https://multimovies.email';
17
17
  protected override logo =
18
- 'https://multimovies.digital/wp-content/uploads/2024/01/cropped-CompressJPEG.online_512x512_image.png';
18
+ 'https://multimovies.email/wp-content/uploads/2024/01/cropped-CompressJPEG.online_512x512_image.png';
19
19
  protected override classPath = 'MOVIES.MultiMovies';
20
20
  override supportedTypes = new Set([TvType.MOVIE, TvType.TVSERIES]);
21
21
  constructor(customBaseURL?: string) {
@@ -227,8 +227,8 @@ class MultiMovies extends MovieParser {
227
227
  case StreamingServers.StreamWish:
228
228
  return {
229
229
  headers: { Referer: serverUrl.href },
230
- ...(await new StreamWish(this.proxyConfig, this.adapter).extract(serverUrl)),
231
- download: fileId ? `https://gdmirrorbot.nl/file/${fileId}` : '',
230
+ ...(await new StreamWish(this.proxyConfig, this.adapter).extract(serverUrl, this.baseUrl)),
231
+ download: fileId ? `${serverUrl.href.toString().replace('/e/', '/f/')}/${fileId}` : '',
232
232
  };
233
233
  case StreamingServers.StreamTape:
234
234
  return {
@@ -254,10 +254,10 @@ class MultiMovies extends MovieParser {
254
254
  try {
255
255
  const servers = await this.fetchEpisodeServers(episodeId);
256
256
  const i = servers.findIndex((s) => s.name.toLowerCase() === server.toLowerCase());
257
-
258
257
  if (i === -1) {
259
258
  throw new Error(`Server ${server} not found`);
260
259
  }
260
+
261
261
  const serverUrl: URL = new URL(servers[i]!.url);
262
262
  let fileId = '';
263
263
 
@@ -268,6 +268,7 @@ class MultiMovies extends MovieParser {
268
268
  // fileId to be used for download link
269
269
  return await this.fetchEpisodeSources(serverUrl.href, mediaId, server, fileId);
270
270
  } catch (err) {
271
+ console.log(err);
271
272
  throw new Error((err as Error).message);
272
273
  }
273
274
  };
@@ -283,9 +284,9 @@ class MultiMovies extends MovieParser {
283
284
 
284
285
  try {
285
286
  const { servers } = await this.getServer(episodeId);
286
-
287
287
  return servers;
288
288
  } catch (err) {
289
+ console.log(err);
289
290
  throw new Error((err as Error).message);
290
291
  }
291
292
  };
@@ -394,10 +395,17 @@ class MultiMovies extends MovieParser {
394
395
 
395
396
  // Handle non-multimovies case
396
397
  if (!iframeUrl.includes('multimovies')) {
398
+ if (iframeUrl.includes('dhcplay')) {
399
+ return {
400
+ servers: [{ name: 'StreamWish', url: iframeUrl }],
401
+ fileId: iframeUrl.split('/').pop() ?? '',
402
+ };
403
+ }
397
404
  let playerBaseUrl = iframeUrl.split('/').slice(0, 3).join('/');
398
405
  const redirectResponse = await this.client.head(playerBaseUrl, {
399
406
  headers,
400
407
  });
408
+
401
409
  // Update base URL if redirect occurred
402
410
  if (redirectResponse) {
403
411
  playerBaseUrl = redirectResponse.request?.responseURL?.split('/').slice(0, 3).join('/');
@@ -410,27 +418,18 @@ class MultiMovies extends MovieParser {
410
418
 
411
419
  const streamRequestData = new FormData();
412
420
  streamRequestData.append('sid', fileId);
413
- // console.log('redirectResponse', playerBaseUrl, streamRequestData);
414
- let streamResponse;
415
- try {
416
- streamResponse = await this.client.post(`${playerBaseUrl}/embedhelper.php`, streamRequestData, {
417
- headers,
418
- });
419
- } catch (_) {
420
- // If the embedhelper.php endpoint fails, just return the direct embed URL
421
- return {
422
- servers: [{ name: 'streamwish', url: `${playerBaseUrl}/embed/${fileId}` }],
423
- fileId: iframeUrl.split('/').pop() ?? '',
424
- };
425
- }
426
-
427
- // console.log('streamResponse', streamResponse.data);
428
-
429
- if (!streamResponse.data) {
421
+
422
+ const streamResponse = await fetch(`${playerBaseUrl}/embedhelper.php`, {
423
+ headers: headers,
424
+ body: streamRequestData,
425
+ method: 'POST',
426
+ });
427
+ const streamResponseData = await streamResponse.json();
428
+ if (!streamResponseData) {
430
429
  throw new Error('No stream data found');
431
430
  }
432
431
 
433
- const streamDetails = streamResponse.data;
432
+ const streamDetails = streamResponseData;
434
433
  const mresultKeys = new Set(Object.keys(JSON.parse(atob(streamDetails.mresult))));
435
434
  const siteUrlsKeys = new Set(Object.keys(streamDetails.siteUrls));
436
435
 
@@ -8,7 +8,7 @@ import {
8
8
  type ISearch,
9
9
  type IMovieEpisode,
10
10
  } from '../../models';
11
- import { makeGetRequestWithWebView } from '../../index';
11
+ import { makeGetRequestWithWebView } from '../../NativeConsumet';
12
12
  class NetflixMirror extends MovieParser {
13
13
  override readonly name = 'NetflixMirror';
14
14
  protected override baseUrl = 'https://netfree2.cc';
@@ -42,6 +42,7 @@ export const PROVIDERS_LIST = {
42
42
  new MOVIES.SFlix(),
43
43
  new MOVIES.MultiMovies(),
44
44
  new MOVIES.NetflixMirror(),
45
+ new MOVIES.HiMovies(),
45
46
  ],
46
47
  NEWS: [new NEWS.ANN()],
47
48
  META: [new META.Anilist(), new META.TMDB(), new META.Myanimelist()],