react-native-consumet 1.2.1 → 1.2.3

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 (88) hide show
  1. package/lib/commonjs/extension-registry.json +4 -4
  2. package/lib/commonjs/extractors/megaup.js +1 -1
  3. package/lib/commonjs/extractors/megaup.js.map +1 -1
  4. package/lib/commonjs/providers/anime/animekai/create-animekai.js +44 -27
  5. package/lib/commonjs/providers/anime/animekai/create-animekai.js.map +1 -1
  6. package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +2 -2
  7. package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
  8. package/lib/commonjs/providers/meta/anilist.js +1 -1
  9. package/lib/commonjs/providers/meta/anilist.js.map +1 -1
  10. package/lib/commonjs/providers/meta/tmdb.js +1 -2
  11. package/lib/commonjs/providers/meta/tmdb.js.map +1 -1
  12. package/lib/commonjs/providers/movies/index.js +3 -1
  13. package/lib/commonjs/providers/movies/index.js.map +1 -1
  14. package/lib/commonjs/providers/movies/multimovies/create-multimovies.js +21 -21
  15. package/lib/commonjs/providers/movies/multimovies/create-multimovies.js.map +1 -1
  16. package/lib/commonjs/providers/movies/multistream/index.js +16 -16
  17. package/lib/commonjs/providers/movies/netflixmirror/create-netflixmirror.js +267 -0
  18. package/lib/commonjs/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -0
  19. package/lib/commonjs/providers/movies/netflixmirror/netflixmirror.js +35 -0
  20. package/lib/commonjs/providers/movies/netflixmirror/netflixmirror.js.map +1 -0
  21. package/lib/commonjs/utils/utils.js +16 -9
  22. package/lib/commonjs/utils/utils.js.map +1 -1
  23. package/lib/module/extension-registry.json +4 -4
  24. package/lib/module/extractors/megaup.js +1 -1
  25. package/lib/module/extractors/megaup.js.map +1 -1
  26. package/lib/module/providers/anime/animekai/create-animekai.js +44 -27
  27. package/lib/module/providers/anime/animekai/create-animekai.js.map +1 -1
  28. package/lib/module/providers/anime/animepahe/create-animepahe.js +2 -2
  29. package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
  30. package/lib/module/providers/meta/anilist.js +1 -1
  31. package/lib/module/providers/meta/anilist.js.map +1 -1
  32. package/lib/module/providers/meta/tmdb.js +1 -2
  33. package/lib/module/providers/meta/tmdb.js.map +1 -1
  34. package/lib/module/providers/movies/index.js +3 -1
  35. package/lib/module/providers/movies/index.js.map +1 -1
  36. package/lib/module/providers/movies/multimovies/create-multimovies.js +21 -21
  37. package/lib/module/providers/movies/multimovies/create-multimovies.js.map +1 -1
  38. package/lib/module/providers/movies/multistream/index.js +16 -16
  39. package/lib/module/providers/movies/netflixmirror/create-netflixmirror.js +263 -0
  40. package/lib/module/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -0
  41. package/lib/module/providers/movies/netflixmirror/netflixmirror.js +32 -0
  42. package/lib/module/providers/movies/netflixmirror/netflixmirror.js.map +1 -0
  43. package/lib/module/utils/utils.js +16 -9
  44. package/lib/module/utils/utils.js.map +1 -1
  45. package/lib/typescript/commonjs/src/providers/anime/animekai/create-animekai.d.ts.map +1 -1
  46. package/lib/typescript/commonjs/src/providers/meta/tmdb.d.ts.map +1 -1
  47. package/lib/typescript/commonjs/src/providers/movies/index.d.ts +3 -1
  48. package/lib/typescript/commonjs/src/providers/movies/index.d.ts.map +1 -1
  49. package/lib/typescript/commonjs/src/providers/movies/multimovies/create-multimovies.d.ts.map +1 -1
  50. package/lib/typescript/commonjs/src/providers/movies/netflixmirror/create-netflixmirror.d.ts +23 -0
  51. package/lib/typescript/commonjs/src/providers/movies/netflixmirror/create-netflixmirror.d.ts.map +1 -0
  52. package/lib/typescript/commonjs/src/providers/movies/netflixmirror/netflixmirror.d.ts +20 -0
  53. package/lib/typescript/commonjs/src/providers/movies/netflixmirror/netflixmirror.d.ts.map +1 -0
  54. package/lib/typescript/commonjs/src/utils/utils.d.ts +5 -0
  55. package/lib/typescript/commonjs/src/utils/utils.d.ts.map +1 -1
  56. package/lib/typescript/module/src/providers/anime/animekai/create-animekai.d.ts.map +1 -1
  57. package/lib/typescript/module/src/providers/meta/tmdb.d.ts.map +1 -1
  58. package/lib/typescript/module/src/providers/movies/index.d.ts +3 -1
  59. package/lib/typescript/module/src/providers/movies/index.d.ts.map +1 -1
  60. package/lib/typescript/module/src/providers/movies/multimovies/create-multimovies.d.ts.map +1 -1
  61. package/lib/typescript/module/src/providers/movies/netflixmirror/create-netflixmirror.d.ts +23 -0
  62. package/lib/typescript/module/src/providers/movies/netflixmirror/create-netflixmirror.d.ts.map +1 -0
  63. package/lib/typescript/module/src/providers/movies/netflixmirror/netflixmirror.d.ts +20 -0
  64. package/lib/typescript/module/src/providers/movies/netflixmirror/netflixmirror.d.ts.map +1 -0
  65. package/lib/typescript/module/src/utils/utils.d.ts +5 -0
  66. package/lib/typescript/module/src/utils/utils.d.ts.map +1 -1
  67. package/package.json +5 -4
  68. package/src/extension-registry.json +4 -4
  69. package/src/extractors/megaup.ts +1 -1
  70. package/src/providers/anime/animekai/create-animekai.ts +45 -26
  71. package/src/providers/anime/animepahe/create-animepahe.ts +2 -2
  72. package/src/providers/meta/anilist.ts +1 -1
  73. package/src/providers/meta/tmdb.ts +1 -2
  74. package/src/providers/movies/index.ts +3 -1
  75. package/src/providers/movies/multimovies/create-multimovies.ts +28 -24
  76. package/src/providers/movies/multistream/index.ts +232 -232
  77. package/src/providers/movies/netflixmirror/create-netflixmirror.ts +344 -0
  78. package/src/providers/movies/netflixmirror/netflixmirror.ts +46 -0
  79. package/src/utils/utils.ts +48 -20
  80. package/lib/commonjs/providers/movies/netflixmirror.js +0 -245
  81. package/lib/commonjs/providers/movies/netflixmirror.js.map +0 -1
  82. package/lib/module/providers/movies/netflixmirror.js +0 -241
  83. package/lib/module/providers/movies/netflixmirror.js.map +0 -1
  84. package/lib/typescript/commonjs/src/providers/movies/netflixmirror.d.ts +0 -38
  85. package/lib/typescript/commonjs/src/providers/movies/netflixmirror.d.ts.map +0 -1
  86. package/lib/typescript/module/src/providers/movies/netflixmirror.d.ts +0 -38
  87. package/lib/typescript/module/src/providers/movies/netflixmirror.d.ts.map +0 -1
  88. package/src/providers/movies/netflixmirror.ts +0 -288
@@ -1,232 +1,232 @@
1
- import axios from 'axios';
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 { getMultiServers, getMultiSources } from './utils';
14
-
15
- class MultiStream extends MovieParser {
16
- override readonly name = 'MultiStream';
17
- protected override baseUrl = 'https://rivestream.org';
18
- protected apiUrl = 'https://api.themoviedb.org/3';
19
- private apiKey: string = '5201b54eb0968700e693a30576d7d4dc';
20
- protected override logo = 'https://himovies.sx/images/group_1/theme_1/favicon.png';
21
- protected override classPath = 'MOVIES.MultiStream';
22
- override supportedTypes = new Set([TvType.MOVIE, TvType.TVSERIES]);
23
- constructor(customBaseURL?: string) {
24
- super();
25
- if (customBaseURL) {
26
- if (customBaseURL.startsWith('http://') || customBaseURL.startsWith('https://')) {
27
- this.baseUrl = customBaseURL;
28
- } else {
29
- this.baseUrl = `http://${customBaseURL}`;
30
- }
31
- } else {
32
- this.baseUrl = this.baseUrl;
33
- }
34
- }
35
-
36
- /**
37
- *
38
- * @param query search query string
39
- * @param page page number (default 1) (optional)
40
- */
41
- override search = async (query: string, page: number = 1): Promise<ISearch<IMovieResult>> => {
42
- const searchUrl = `${this.apiUrl}/search/multi?api_key=${this.apiKey}&language=en-US&page=${page}&include_adult=false&query=${query}`;
43
-
44
- const search: ISearch<IMovieResult> = {
45
- currentPage: page,
46
- hasNextPage: false,
47
- results: [],
48
- };
49
-
50
- try {
51
- const { data } = await axios.get(searchUrl);
52
-
53
- if (data.results.length < 1) return search;
54
-
55
- search.hasNextPage = page + 1 <= data.total_pages;
56
- search.currentPage = page;
57
- search.totalResults = data.total_results;
58
- search.totalPages = data.total_pages;
59
-
60
- const moviePromises = data.results.map(async (result: any) => {
61
- const date = new Date(result?.release_date || result?.first_air_date);
62
-
63
- let totalSeasons;
64
- if (result.media_type === 'tv') {
65
- try {
66
- const { data: tvData } = await axios.get(
67
- `${this.apiUrl}/tv/${result.id}?api_key=${this.apiKey}&language=en-US`
68
- );
69
- totalSeasons = tvData.number_of_seasons;
70
- } catch (err) {
71
- // Continue without seasons data if request fails
72
- }
73
- }
74
-
75
- const movie: IMovieResult = {
76
- id: `${result.id}$${result.media_type}`,
77
- title: result?.title || result?.name,
78
- image: `https://image.tmdb.org/t/p/original${result?.poster_path}`,
79
- type: result.media_type === 'movie' ? TvType.MOVIE : TvType.TVSERIES,
80
- rating: result?.vote_average || 0,
81
- releaseDate: `${date.getFullYear()}` || '0',
82
- seasons: totalSeasons,
83
- };
84
-
85
- return movie;
86
- });
87
-
88
- search.results = await Promise.all(moviePromises);
89
-
90
- return search;
91
- } catch (err) {
92
- throw new Error((err as Error).message);
93
- }
94
- };
95
-
96
- /**
97
- *
98
- * @param mediaId - The media identifier (TMDB ID with type, e.g., "1071585$movie")
99
- */
100
- override fetchMediaInfo = async (mediaId: string): Promise<IMovieInfo> => {
101
- const movieInfo: IMovieInfo = {
102
- id: mediaId,
103
- title: '',
104
- };
105
- const parts = mediaId.split('$');
106
- const type = parts[1];
107
- mediaId = parts[0]!;
108
- const infoUrl = `${this.apiUrl}/${type}/${parts[0]}?api_key=${this.apiKey}&language=en-US&append_to_response=release_dates,images,recommendations,credits,videos`;
109
- try {
110
- const { data } = await axios.get(infoUrl);
111
- movieInfo.title = data?.title || data?.name;
112
- movieInfo.image = `https://image.tmdb.org/t/p/original${data?.poster_path}`;
113
- movieInfo.cover = `https://image.tmdb.org/t/p/original${data?.backdrop_path}`;
114
- movieInfo.type = type === 'movie' ? TvType.MOVIE : TvType.TVSERIES;
115
- movieInfo.rating = data?.vote_average || 0;
116
- movieInfo.releaseDate = data?.release_date || data?.first_air_date;
117
- movieInfo.description = data?.overview;
118
- movieInfo.genres = data?.genres.map((genre: { name: string }) => genre.name);
119
- movieInfo.duration = data?.runtime || data?.episode_run_time[0];
120
- movieInfo.totalEpisodes = data?.number_of_episodes;
121
- movieInfo.totalSeasons = data?.number_of_seasons as number;
122
-
123
- movieInfo.characters = data?.credits?.cast.map((cast: any) => ({
124
- id: cast.id,
125
- name: cast.name,
126
- url: `https://www.themoviedb.org/person/${cast.id}`,
127
- character: cast.character,
128
- image: `https://image.tmdb.org/t/p/original${cast.profile_path}`,
129
- }));
130
- movieInfo.trailer = {
131
- id: data?.videos?.results[0]?.key,
132
- site: data?.videos?.results[0]?.site,
133
- url: `https://www.youtube.com/watch?v=${data?.videos?.results[0]?.key}`,
134
- };
135
-
136
- movieInfo.recommendations =
137
- data?.recommendations?.results?.length <= 0
138
- ? undefined
139
- : data?.recommendations?.results.map((result: any) => {
140
- return {
141
- id: result.id,
142
- title: result.title || result.name,
143
- image: `https://image.tmdb.org/t/p/original${result.poster_path}`,
144
- type: type === 'movie' ? TvType.MOVIE : TvType.TVSERIES,
145
- rating: result.vote_average || 0,
146
- releaseDate: result.release_date || result.first_air_date,
147
- };
148
- });
149
-
150
- if (movieInfo.type === TvType.TVSERIES) {
151
- movieInfo.episodes = [];
152
- for (let i = 1; i <= data?.number_of_seasons; i++) {
153
- const { data } = await axios.get(`${this.apiUrl}/tv/${mediaId}/season/${i}?api_key=${this.apiKey}`);
154
- data.episodes.map((item: any) => {
155
- const episode = {
156
- id: `${mediaId}$tv$${item.episode_number}$${item.season_number}$${item.id}`,
157
- //first part is mediaId, second is episode number, third is season number, fourth is episode id(to avoid conflicts just in case)
158
- title: item.name,
159
- number: item.episode_number,
160
- season: item.season_number || i,
161
- description: item.overview,
162
- image: `https://image.tmdb.org/t/p/original${item.still_path}`,
163
- };
164
- movieInfo.episodes?.push(episode);
165
- });
166
- }
167
- } else {
168
- movieInfo.episodes = [
169
- {
170
- id: `${mediaId}$movie`,
171
- title: movieInfo.title as string,
172
- description: movieInfo.description,
173
- image: movieInfo.image,
174
- number: 1,
175
- },
176
- ];
177
- }
178
-
179
- return movieInfo;
180
- } catch (err) {
181
- //console.log(err);
182
- throw new Error((err as Error).message);
183
- }
184
- };
185
-
186
- /**
187
- *
188
- * @param episodeId episode id
189
- * @param mediaId media id
190
- * @param server server type (defaults to the first from `fetchEpisodeServers`) (optional)
191
- */
192
- override fetchEpisodeSources = async (
193
- episodeId: string,
194
- mediaId: string,
195
- server?: StreamingServers
196
- ): Promise<ISource> => {
197
- const firstServer = (await this.fetchEpisodeServers(episodeId, mediaId))[0]!.name as StreamingServers;
198
- return await getMultiSources(episodeId, server ? server : firstServer);
199
- };
200
-
201
- /**
202
- *
203
- * @param episodeId takes episode link or movie id
204
- * @param mediaId takes movie link or id (found on movie movieInfo object)
205
- */
206
- override fetchEpisodeServers = async (episodeId: string, mediaId?: string): Promise<IEpisodeServer[]> => {
207
- try {
208
- const servers = await getMultiServers(episodeId);
209
- return servers;
210
- } catch (err) {
211
- console.log(err);
212
- throw new Error((err as Error).message);
213
- }
214
- };
215
- }
216
-
217
- // (async () => {
218
- // const movie = new MultiStream();
219
- // const search = await movie.search('jujutsu');
220
- // const movieInfo = await movie.fetchMediaInfo(search.results[0]!.id);
221
- // // const recentTv = await movie.fetchTrendingTvShows();
222
- // const servers = await movie.fetchEpisodeServers(movieInfo.episodes![0]!.id, movieInfo.id);
223
- // console.log(servers);
224
- // const genre = await movie.fetchEpisodeSources(
225
- // movieInfo.episodes![0]!.id,
226
- // movieInfo.id,
227
- // servers[0]!.name as StreamingServers
228
- // );
229
- // console.log(genre);
230
- // })();
231
-
232
- export default MultiStream;
1
+ import axios from 'axios';
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 { getMultiServers, getMultiSources } from './utils';
14
+
15
+ class MultiStream extends MovieParser {
16
+ override readonly name = 'MultiStream';
17
+ protected override baseUrl = 'https://rivestream.org';
18
+ protected apiUrl = 'https://api.themoviedb.org/3';
19
+ private apiKey: string = '5201b54eb0968700e693a30576d7d4dc';
20
+ protected override logo = 'https://himovies.sx/images/group_1/theme_1/favicon.png';
21
+ protected override classPath = 'MOVIES.MultiStream';
22
+ override supportedTypes = new Set([TvType.MOVIE, TvType.TVSERIES]);
23
+ constructor(customBaseURL?: string) {
24
+ super();
25
+ if (customBaseURL) {
26
+ if (customBaseURL.startsWith('http://') || customBaseURL.startsWith('https://')) {
27
+ this.baseUrl = customBaseURL;
28
+ } else {
29
+ this.baseUrl = `http://${customBaseURL}`;
30
+ }
31
+ } else {
32
+ this.baseUrl = this.baseUrl;
33
+ }
34
+ }
35
+
36
+ /**
37
+ *
38
+ * @param query search query string
39
+ * @param page page number (default 1) (optional)
40
+ */
41
+ override search = async (query: string, page: number = 1): Promise<ISearch<IMovieResult>> => {
42
+ const searchUrl = `${this.apiUrl}/search/multi?api_key=${this.apiKey}&language=en-US&page=${page}&include_adult=false&query=${query}`;
43
+
44
+ const search: ISearch<IMovieResult> = {
45
+ currentPage: page,
46
+ hasNextPage: false,
47
+ results: [],
48
+ };
49
+
50
+ try {
51
+ const { data } = await axios.get(searchUrl);
52
+
53
+ if (data.results.length < 1) return search;
54
+
55
+ search.hasNextPage = page + 1 <= data.total_pages;
56
+ search.currentPage = page;
57
+ search.totalResults = data.total_results;
58
+ search.totalPages = data.total_pages;
59
+
60
+ const moviePromises = data.results.map(async (result: any) => {
61
+ const date = new Date(result?.release_date || result?.first_air_date);
62
+
63
+ let totalSeasons;
64
+ if (result.media_type === 'tv') {
65
+ try {
66
+ const { data: tvData } = await axios.get(
67
+ `${this.apiUrl}/tv/${result.id}?api_key=${this.apiKey}&language=en-US`
68
+ );
69
+ totalSeasons = tvData.number_of_seasons;
70
+ } catch (err) {
71
+ // Continue without seasons data if request fails
72
+ }
73
+ }
74
+
75
+ const movie: IMovieResult = {
76
+ id: `${result.id}$${result.media_type}`,
77
+ title: result?.title || result?.name,
78
+ image: `https://image.tmdb.org/t/p/original${result?.poster_path}`,
79
+ type: result.media_type === 'movie' ? TvType.MOVIE : TvType.TVSERIES,
80
+ rating: result?.vote_average || 0,
81
+ releaseDate: `${date.getFullYear()}` || '0',
82
+ seasons: totalSeasons,
83
+ };
84
+
85
+ return movie;
86
+ });
87
+
88
+ search.results = await Promise.all(moviePromises);
89
+
90
+ return search;
91
+ } catch (err) {
92
+ throw new Error((err as Error).message);
93
+ }
94
+ };
95
+
96
+ /**
97
+ *
98
+ * @param mediaId - The media identifier (TMDB ID with type, e.g., "1071585$movie")
99
+ */
100
+ override fetchMediaInfo = async (mediaId: string): Promise<IMovieInfo> => {
101
+ const movieInfo: IMovieInfo = {
102
+ id: mediaId,
103
+ title: '',
104
+ };
105
+ const parts = mediaId.split('$');
106
+ const type = parts[1];
107
+ mediaId = parts[0]!;
108
+ const infoUrl = `${this.apiUrl}/${type}/${parts[0]}?api_key=${this.apiKey}&language=en-US&append_to_response=release_dates,images,recommendations,credits,videos`;
109
+ try {
110
+ const { data } = await axios.get(infoUrl);
111
+ movieInfo.title = data?.title || data?.name;
112
+ movieInfo.image = `https://image.tmdb.org/t/p/original${data?.poster_path}`;
113
+ movieInfo.cover = `https://image.tmdb.org/t/p/original${data?.backdrop_path}`;
114
+ movieInfo.type = type === 'movie' ? TvType.MOVIE : TvType.TVSERIES;
115
+ movieInfo.rating = data?.vote_average || 0;
116
+ movieInfo.releaseDate = data?.release_date || data?.first_air_date;
117
+ movieInfo.description = data?.overview;
118
+ movieInfo.genres = data?.genres.map((genre: { name: string }) => genre.name);
119
+ movieInfo.duration = data?.runtime || data?.episode_run_time[0];
120
+ movieInfo.totalEpisodes = data?.number_of_episodes;
121
+ movieInfo.totalSeasons = data?.number_of_seasons as number;
122
+
123
+ movieInfo.characters = data?.credits?.cast.map((cast: any) => ({
124
+ id: cast.id,
125
+ name: cast.name,
126
+ url: `https://www.themoviedb.org/person/${cast.id}`,
127
+ character: cast.character,
128
+ image: `https://image.tmdb.org/t/p/original${cast.profile_path}`,
129
+ }));
130
+ movieInfo.trailer = {
131
+ id: data?.videos?.results[0]?.key,
132
+ site: data?.videos?.results[0]?.site,
133
+ url: `https://www.youtube.com/watch?v=${data?.videos?.results[0]?.key}`,
134
+ };
135
+
136
+ movieInfo.recommendations =
137
+ data?.recommendations?.results?.length <= 0
138
+ ? undefined
139
+ : data?.recommendations?.results.map((result: any) => {
140
+ return {
141
+ id: result.id,
142
+ title: result.title || result.name,
143
+ image: `https://image.tmdb.org/t/p/original${result.poster_path}`,
144
+ type: type === 'movie' ? TvType.MOVIE : TvType.TVSERIES,
145
+ rating: result.vote_average || 0,
146
+ releaseDate: result.release_date || result.first_air_date,
147
+ };
148
+ });
149
+
150
+ if (movieInfo.type === TvType.TVSERIES) {
151
+ movieInfo.episodes = [];
152
+ for (let i = 1; i <= data?.number_of_seasons; i++) {
153
+ const { data } = await axios.get(`${this.apiUrl}/tv/${mediaId}/season/${i}?api_key=${this.apiKey}`);
154
+ data.episodes.map((item: any) => {
155
+ const episode = {
156
+ id: `${mediaId}$tv$${item.episode_number}$${item.season_number}$${item.id}`,
157
+ //first part is mediaId, second is episode number, third is season number, fourth is episode id(to avoid conflicts just in case)
158
+ title: item.name,
159
+ number: item.episode_number,
160
+ season: item.season_number || i,
161
+ description: item.overview,
162
+ image: `https://image.tmdb.org/t/p/original${item.still_path}`,
163
+ };
164
+ movieInfo.episodes?.push(episode);
165
+ });
166
+ }
167
+ } else {
168
+ movieInfo.episodes = [
169
+ {
170
+ id: `${mediaId}$movie`,
171
+ title: movieInfo.title as string,
172
+ description: movieInfo.description,
173
+ image: movieInfo.image,
174
+ number: 1,
175
+ },
176
+ ];
177
+ }
178
+
179
+ return movieInfo;
180
+ } catch (err) {
181
+ //console.log(err);
182
+ throw new Error((err as Error).message);
183
+ }
184
+ };
185
+
186
+ /**
187
+ *
188
+ * @param episodeId episode id
189
+ * @param mediaId media id
190
+ * @param server server type (defaults to the first from `fetchEpisodeServers`) (optional)
191
+ */
192
+ override fetchEpisodeSources = async (
193
+ episodeId: string,
194
+ mediaId: string,
195
+ server?: StreamingServers
196
+ ): Promise<ISource> => {
197
+ const firstServer = (await this.fetchEpisodeServers(episodeId, mediaId))[0]!.name as StreamingServers;
198
+ return await getMultiSources(episodeId, server ? server : firstServer);
199
+ };
200
+
201
+ /**
202
+ *
203
+ * @param episodeId takes episode link or movie id
204
+ * @param mediaId takes movie link or id (found on movie movieInfo object)
205
+ */
206
+ override fetchEpisodeServers = async (episodeId: string, mediaId?: string): Promise<IEpisodeServer[]> => {
207
+ try {
208
+ const servers = await getMultiServers(episodeId);
209
+ return servers;
210
+ } catch (err) {
211
+ console.log(err);
212
+ throw new Error((err as Error).message);
213
+ }
214
+ };
215
+ }
216
+
217
+ // (async () => {
218
+ // const movie = new MultiStream();
219
+ // const search = await movie.search('jujutsu');
220
+ // const movieInfo = await movie.fetchMediaInfo(search.results[0]!.id);
221
+ // // const recentTv = await movie.fetchTrendingTvShows();
222
+ // const servers = await movie.fetchEpisodeServers(movieInfo.episodes![0]!.id, movieInfo.id);
223
+ // console.log(servers);
224
+ // const genre = await movie.fetchEpisodeSources(
225
+ // movieInfo.episodes![0]!.id,
226
+ // movieInfo.id,
227
+ // servers[0]!.name as StreamingServers
228
+ // );
229
+ // console.log(genre);
230
+ // })();
231
+
232
+ export default MultiStream;