react-native-consumet 0.7.2 → 0.9.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.
- package/Consumet.podspec +26 -26
- package/LICENSE +673 -673
- package/README.md +49 -49
- package/android/build.gradle +106 -106
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +4 -4
- package/android/src/main/AndroidManifestNew.xml +3 -3
- package/android/src/main/java/com/consumet/ConsumetModule.kt +49 -49
- package/android/src/main/java/com/consumet/ConsumetPackage.kt +33 -33
- package/ios/Consumet.h +6 -6
- package/ios/Consumet.mm +18 -18
- package/lib/commonjs/extractors/luffy.js +2 -1
- package/lib/commonjs/extractors/luffy.js.map +1 -1
- package/lib/commonjs/extractors/megacloud/index.js +12 -27
- package/lib/commonjs/extractors/megacloud/index.js.map +1 -1
- package/lib/commonjs/extractors/megacloud/megacloud.getsrcs.js +99 -0
- package/lib/commonjs/extractors/megacloud/megacloud.getsrcs.js.map +1 -0
- package/lib/commonjs/extractors/vidcloud.js +39 -48
- package/lib/commonjs/extractors/vidcloud.js.map +1 -1
- package/lib/commonjs/extractors/voe.js.map +1 -1
- package/lib/commonjs/models/types.js +1 -0
- package/lib/commonjs/models/types.js.map +1 -1
- package/lib/commonjs/providers/anime/animeowl.js +55 -53
- package/lib/commonjs/providers/anime/animeowl.js.map +1 -1
- package/lib/commonjs/providers/meta/anilist.js +22 -7
- package/lib/commonjs/providers/meta/anilist.js.map +1 -1
- package/lib/commonjs/providers/meta/tmdb.js +1 -1
- package/lib/commonjs/providers/meta/tmdb.js.map +1 -1
- package/lib/commonjs/providers/movies/himovies.js +16 -16
- package/lib/commonjs/providers/movies/index.js +3 -1
- package/lib/commonjs/providers/movies/index.js.map +1 -1
- package/lib/commonjs/providers/movies/multimovies.js +2 -2
- package/lib/commonjs/providers/movies/multimovies.js.map +1 -1
- package/lib/commonjs/providers/movies/multistream/index.js +208 -0
- package/lib/commonjs/providers/movies/multistream/index.js.map +1 -0
- package/lib/commonjs/providers/movies/multistream/utils.js +267 -0
- package/lib/commonjs/providers/movies/multistream/utils.js.map +1 -0
- package/lib/commonjs/providers/movies/netflixmirror.js +2 -2
- package/lib/commonjs/providers/movies/netflixmirror.js.map +1 -1
- package/lib/commonjs/utils/utils.js +58 -34
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/extractors/luffy.js +2 -1
- package/lib/module/extractors/luffy.js.map +1 -1
- package/lib/module/extractors/megacloud/index.js +12 -26
- package/lib/module/extractors/megacloud/index.js.map +1 -1
- package/lib/module/extractors/megacloud/megacloud.getsrcs.js +95 -0
- package/lib/module/extractors/megacloud/megacloud.getsrcs.js.map +1 -0
- package/lib/module/extractors/vidcloud.js +38 -47
- package/lib/module/extractors/vidcloud.js.map +1 -1
- package/lib/module/extractors/voe.js.map +1 -1
- package/lib/module/models/types.js +1 -0
- package/lib/module/models/types.js.map +1 -1
- package/lib/module/providers/anime/animeowl.js +56 -53
- package/lib/module/providers/anime/animeowl.js.map +1 -1
- package/lib/module/providers/meta/anilist.js +22 -7
- package/lib/module/providers/meta/anilist.js.map +1 -1
- package/lib/module/providers/meta/tmdb.js +1 -1
- package/lib/module/providers/meta/tmdb.js.map +1 -1
- package/lib/module/providers/movies/himovies.js +16 -16
- package/lib/module/providers/movies/index.js +3 -1
- package/lib/module/providers/movies/index.js.map +1 -1
- package/lib/module/providers/movies/multimovies.js +2 -2
- package/lib/module/providers/movies/multimovies.js.map +1 -1
- package/lib/module/providers/movies/multistream/index.js +205 -0
- package/lib/module/providers/movies/multistream/index.js.map +1 -0
- package/lib/module/providers/movies/multistream/utils.js +259 -0
- package/lib/module/providers/movies/multistream/utils.js.map +1 -0
- package/lib/module/providers/movies/netflixmirror.js +2 -2
- package/lib/module/providers/movies/netflixmirror.js.map +1 -1
- package/lib/module/utils/utils.js +55 -30
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/commonjs/src/extractors/luffy.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/megacloud/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/megacloud/megacloud.getsrcs.d.ts +10 -0
- package/lib/typescript/commonjs/src/extractors/megacloud/megacloud.getsrcs.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/extractors/vidcloud.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/types.d.ts +2 -1
- package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animeowl.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/tmdb.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/index.d.ts +2 -0
- package/lib/typescript/commonjs/src/providers/movies/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/multimovies.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/multistream/index.d.ts +37 -0
- package/lib/typescript/commonjs/src/providers/movies/multistream/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts +10 -0
- package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/utils.d.ts +8 -8
- package/lib/typescript/commonjs/src/utils/utils.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/luffy.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/megacloud/index.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/megacloud/megacloud.getsrcs.d.ts +10 -0
- package/lib/typescript/module/src/extractors/megacloud/megacloud.getsrcs.d.ts.map +1 -0
- package/lib/typescript/module/src/extractors/vidcloud.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +1 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/types.d.ts +2 -1
- package/lib/typescript/module/src/models/types.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animeowl.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/anilist.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/tmdb.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/index.d.ts +2 -0
- package/lib/typescript/module/src/providers/movies/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/multimovies.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/multistream/index.d.ts +37 -0
- package/lib/typescript/module/src/providers/movies/multistream/index.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts +10 -0
- package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/netflixmirror.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/index.d.ts +1 -1
- package/lib/typescript/module/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/utils.d.ts +8 -8
- package/lib/typescript/module/src/utils/utils.d.ts.map +1 -1
- package/package.json +3 -2
- package/react-native.config.js +12 -12
- package/src/extractors/luffy.ts +33 -32
- package/src/extractors/megacloud/index.ts +14 -27
- package/src/extractors/megacloud/megacloud.getsrcs.ts +104 -0
- package/src/extractors/vidcloud.ts +39 -49
- package/src/extractors/voe.ts +3 -3
- package/src/index.tsx +137 -137
- package/src/models/types.ts +1 -0
- package/src/providers/anime/animeowl.ts +565 -564
- package/src/providers/meta/anilist.ts +20 -7
- package/src/providers/meta/tmdb.ts +1 -2
- package/src/providers/movies/himovies.ts +495 -495
- package/src/providers/movies/index.ts +2 -0
- package/src/providers/movies/multimovies.ts +3 -3
- package/src/providers/movies/multistream/index.ts +232 -0
- package/src/providers/movies/multistream/utils.ts +393 -0
- package/src/providers/movies/netflixmirror.ts +2 -2
- package/src/utils/index.ts +2 -2
- package/src/utils/utils.ts +66 -31
|
@@ -11,6 +11,7 @@ import SFlix from './sflix';
|
|
|
11
11
|
import MultiMovies from './multimovies';
|
|
12
12
|
import NetflixMirror from './netflixmirror';
|
|
13
13
|
import HiMovies from './himovies';
|
|
14
|
+
import MultiStream from './multistream';
|
|
14
15
|
|
|
15
16
|
export default {
|
|
16
17
|
DramaCool,
|
|
@@ -26,4 +27,5 @@ export default {
|
|
|
26
27
|
MultiMovies,
|
|
27
28
|
NetflixMirror,
|
|
28
29
|
HiMovies,
|
|
30
|
+
MultiStream,
|
|
29
31
|
};
|
|
@@ -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.
|
|
16
|
+
protected override baseUrl = 'https://multimovies.agency';
|
|
17
17
|
protected override logo =
|
|
18
|
-
'https://multimovies.
|
|
18
|
+
'https://multimovies.agency/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) {
|
|
@@ -418,7 +418,7 @@ class MultiMovies extends MovieParser {
|
|
|
418
418
|
|
|
419
419
|
const streamRequestData = new FormData();
|
|
420
420
|
streamRequestData.append('sid', fileId);
|
|
421
|
-
|
|
421
|
+
|
|
422
422
|
const streamResponse = await fetch(`${playerBaseUrl}/embedhelper.php`, {
|
|
423
423
|
headers: headers,
|
|
424
424
|
body: streamRequestData,
|
|
@@ -0,0 +1,232 @@
|
|
|
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, MixDrop, VidCloud } from '../../../extractors';
|
|
14
|
+
import { getMultiServers, getMultiSources } from './utils';
|
|
15
|
+
|
|
16
|
+
class MultiStream extends MovieParser {
|
|
17
|
+
override readonly name = 'MultiStream';
|
|
18
|
+
protected override baseUrl = 'https://rivestream.org';
|
|
19
|
+
protected apiUrl = 'https://api.themoviedb.org/3';
|
|
20
|
+
private apiKey: string = '5201b54eb0968700e693a30576d7d4dc';
|
|
21
|
+
protected override logo = 'https://himovies.sx/images/group_1/theme_1/favicon.png';
|
|
22
|
+
protected override classPath = 'MOVIES.MultiStream';
|
|
23
|
+
override supportedTypes = new Set([TvType.MOVIE, TvType.TVSERIES]);
|
|
24
|
+
constructor(customBaseURL?: string) {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
if (customBaseURL) {
|
|
27
|
+
if (customBaseURL.startsWith('http://') || customBaseURL.startsWith('https://')) {
|
|
28
|
+
this.baseUrl = customBaseURL;
|
|
29
|
+
} else {
|
|
30
|
+
this.baseUrl = `http://${customBaseURL}`;
|
|
31
|
+
}
|
|
32
|
+
} else {
|
|
33
|
+
this.baseUrl = this.baseUrl;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @param query search query string
|
|
40
|
+
* @param page page number (default 1) (optional)
|
|
41
|
+
*/
|
|
42
|
+
override search = async (query: string, page: number = 1): Promise<ISearch<IMovieResult>> => {
|
|
43
|
+
const searchUrl = `${this.apiUrl}/search/multi?api_key=${this.apiKey}&language=en-US&page=${page}&include_adult=false&query=${query}`;
|
|
44
|
+
|
|
45
|
+
const search: ISearch<IMovieResult> = {
|
|
46
|
+
currentPage: page,
|
|
47
|
+
hasNextPage: false,
|
|
48
|
+
results: [],
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
try {
|
|
52
|
+
const { data } = await this.client.get(searchUrl);
|
|
53
|
+
|
|
54
|
+
if (data.results.length < 1) return search;
|
|
55
|
+
|
|
56
|
+
search.hasNextPage = page + 1 <= data.total_pages;
|
|
57
|
+
search.currentPage = page;
|
|
58
|
+
search.totalResults = data.total_results;
|
|
59
|
+
search.totalPages = data.total_pages;
|
|
60
|
+
|
|
61
|
+
const moviePromises = data.results.map(async (result: any) => {
|
|
62
|
+
const date = new Date(result?.release_date || result?.first_air_date);
|
|
63
|
+
|
|
64
|
+
let totalSeasons = undefined;
|
|
65
|
+
if (result.media_type === 'tv') {
|
|
66
|
+
try {
|
|
67
|
+
const { data: tvData } = await this.client.get(
|
|
68
|
+
`${this.apiUrl}/tv/${result.id}?api_key=${this.apiKey}&language=en-US`
|
|
69
|
+
);
|
|
70
|
+
totalSeasons = tvData.number_of_seasons;
|
|
71
|
+
} catch (err) {
|
|
72
|
+
// Continue without seasons data if request fails
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const movie: IMovieResult = {
|
|
77
|
+
id: `${result.id}$${result.media_type}`,
|
|
78
|
+
title: result?.title || result?.name,
|
|
79
|
+
image: `https://image.tmdb.org/t/p/original${result?.poster_path}`,
|
|
80
|
+
type: result.media_type === 'movie' ? TvType.MOVIE : TvType.TVSERIES,
|
|
81
|
+
rating: result?.vote_average || 0,
|
|
82
|
+
releaseDate: `${date.getFullYear()}` || '0',
|
|
83
|
+
seasons: totalSeasons,
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
return movie;
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
search.results = await Promise.all(moviePromises);
|
|
90
|
+
|
|
91
|
+
return search;
|
|
92
|
+
} catch (err) {
|
|
93
|
+
throw new Error((err as Error).message);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
*
|
|
99
|
+
* @param mediaId - The media identifier (TMDB ID with type, e.g., "1071585$movie")
|
|
100
|
+
*/
|
|
101
|
+
override fetchMediaInfo = async (mediaId: string): Promise<IMovieInfo> => {
|
|
102
|
+
const movieInfo: IMovieInfo = {
|
|
103
|
+
id: mediaId,
|
|
104
|
+
title: '',
|
|
105
|
+
};
|
|
106
|
+
const parts = mediaId.split('$');
|
|
107
|
+
const type = parts[1];
|
|
108
|
+
mediaId = parts[0]!;
|
|
109
|
+
const infoUrl = `${this.apiUrl}/${type}/${parts[0]}?api_key=${this.apiKey}&language=en-US&append_to_response=release_dates,images,recommendations,credits,videos`;
|
|
110
|
+
try {
|
|
111
|
+
const { data } = await this.client.get(infoUrl);
|
|
112
|
+
movieInfo.title = data?.title || data?.name;
|
|
113
|
+
movieInfo.image = `https://image.tmdb.org/t/p/original${data?.poster_path}`;
|
|
114
|
+
movieInfo.cover = `https://image.tmdb.org/t/p/original${data?.backdrop_path}`;
|
|
115
|
+
movieInfo.type = type === 'movie' ? TvType.MOVIE : TvType.TVSERIES;
|
|
116
|
+
movieInfo.rating = data?.vote_average || 0;
|
|
117
|
+
movieInfo.releaseDate = data?.release_date || data?.first_air_date;
|
|
118
|
+
movieInfo.description = data?.overview;
|
|
119
|
+
movieInfo.genres = data?.genres.map((genre: { name: string }) => genre.name);
|
|
120
|
+
movieInfo.duration = data?.runtime || data?.episode_run_time[0];
|
|
121
|
+
movieInfo.totalEpisodes = data?.number_of_episodes;
|
|
122
|
+
movieInfo.totalSeasons = data?.number_of_seasons as number;
|
|
123
|
+
|
|
124
|
+
movieInfo.characters = data?.credits?.cast.map((cast: any) => ({
|
|
125
|
+
id: cast.id,
|
|
126
|
+
name: cast.name,
|
|
127
|
+
url: `https://www.themoviedb.org/person/${cast.id}`,
|
|
128
|
+
character: cast.character,
|
|
129
|
+
image: `https://image.tmdb.org/t/p/original${cast.profile_path}`,
|
|
130
|
+
}));
|
|
131
|
+
movieInfo.trailer = {
|
|
132
|
+
id: data?.videos?.results[0]?.key,
|
|
133
|
+
site: data?.videos?.results[0]?.site,
|
|
134
|
+
url: `https://www.youtube.com/watch?v=${data?.videos?.results[0]?.key}`,
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
movieInfo.recommendations =
|
|
138
|
+
data?.recommendations?.results?.length <= 0
|
|
139
|
+
? undefined
|
|
140
|
+
: data?.recommendations?.results.map((result: any) => {
|
|
141
|
+
return {
|
|
142
|
+
id: result.id,
|
|
143
|
+
title: result.title || result.name,
|
|
144
|
+
image: `https://image.tmdb.org/t/p/original${result.poster_path}`,
|
|
145
|
+
type: type === 'movie' ? TvType.MOVIE : TvType.TVSERIES,
|
|
146
|
+
rating: result.vote_average || 0,
|
|
147
|
+
releaseDate: result.release_date || result.first_air_date,
|
|
148
|
+
};
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
if (movieInfo.type === TvType.TVSERIES) {
|
|
152
|
+
movieInfo.episodes = [];
|
|
153
|
+
for (let i = 1; i <= data?.number_of_seasons; i++) {
|
|
154
|
+
const { data } = await this.client.get(`${this.apiUrl}/tv/${mediaId}/season/${i}?api_key=${this.apiKey}`);
|
|
155
|
+
data.episodes.map((item: any) => {
|
|
156
|
+
const episode = {
|
|
157
|
+
id: `${mediaId}$tv$${item.episode_number}$${item.season_number}$${item.id}`,
|
|
158
|
+
//first part is mediaId, second is episode number, third is season number, fourth is episode id(to avoid conflicts just in case)
|
|
159
|
+
title: item.name,
|
|
160
|
+
number: item.episode_number,
|
|
161
|
+
season: item.season_number || i,
|
|
162
|
+
description: item.overview,
|
|
163
|
+
image: `https://image.tmdb.org/t/p/original${item.still_path}`,
|
|
164
|
+
};
|
|
165
|
+
movieInfo.episodes?.push(episode);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
} else {
|
|
169
|
+
movieInfo.episodes = [
|
|
170
|
+
{
|
|
171
|
+
id: `${mediaId}$movie`,
|
|
172
|
+
title: movieInfo.title as string,
|
|
173
|
+
description: movieInfo.description,
|
|
174
|
+
image: movieInfo.image,
|
|
175
|
+
number: 1,
|
|
176
|
+
},
|
|
177
|
+
];
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return movieInfo;
|
|
181
|
+
} catch (err) {
|
|
182
|
+
console.log(err);
|
|
183
|
+
throw new Error((err as Error).message);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
*
|
|
189
|
+
* @param episodeId episode id
|
|
190
|
+
* @param mediaId media id
|
|
191
|
+
* @param server server type (defaults to the first from `fetchEpisodeServers`) (optional)
|
|
192
|
+
*/
|
|
193
|
+
override fetchEpisodeSources = async (
|
|
194
|
+
episodeId: string,
|
|
195
|
+
mediaId: string,
|
|
196
|
+
server: StreamingServers | string
|
|
197
|
+
): Promise<ISource> => {
|
|
198
|
+
const firstServer = (await this.fetchEpisodeServers(episodeId, mediaId))[0]!.name as StreamingServers;
|
|
199
|
+
return await getMultiSources(episodeId, server ? server : firstServer);
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
*
|
|
204
|
+
* @param episodeId takes episode link or movie id
|
|
205
|
+
* @param mediaId takes movie link or id (found on movie movieInfo object)
|
|
206
|
+
*/
|
|
207
|
+
override fetchEpisodeServers = async (episodeId: string, mediaId?: string): Promise<IEpisodeServer[]> => {
|
|
208
|
+
try {
|
|
209
|
+
const servers = await getMultiServers(episodeId);
|
|
210
|
+
return servers;
|
|
211
|
+
} catch (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;
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import type { IEpisodeServer, ISource, ISubtitle, IVideo } from '../../../models';
|
|
3
|
+
import { USER_AGENT } from '../../../utils';
|
|
4
|
+
import { filterValidM3U8 } from '../../../utils/utils';
|
|
5
|
+
import { load } from 'cheerio';
|
|
6
|
+
|
|
7
|
+
export async function getRiveSourcesAndServers(id: string): Promise<ISource & { servers: IEpisodeServer[] }> {
|
|
8
|
+
const parts = id.split('$');
|
|
9
|
+
const [tmdbId, type, episode, season] = parts;
|
|
10
|
+
const secret = generateSecretKey(Number(tmdbId));
|
|
11
|
+
const riveServers = [
|
|
12
|
+
'flowcast',
|
|
13
|
+
'primevids',
|
|
14
|
+
'loki',
|
|
15
|
+
'shadow',
|
|
16
|
+
'asiacloud',
|
|
17
|
+
'hindicast',
|
|
18
|
+
'anime',
|
|
19
|
+
'animez',
|
|
20
|
+
'sapphire',
|
|
21
|
+
'guru',
|
|
22
|
+
'guard',
|
|
23
|
+
'curve',
|
|
24
|
+
'hq',
|
|
25
|
+
'ninja',
|
|
26
|
+
'alpha',
|
|
27
|
+
'kaze',
|
|
28
|
+
'zenesis',
|
|
29
|
+
'genesis',
|
|
30
|
+
'zenith',
|
|
31
|
+
'ghost',
|
|
32
|
+
'halo',
|
|
33
|
+
'kinoecho',
|
|
34
|
+
'ee3',
|
|
35
|
+
'volt',
|
|
36
|
+
'putafilme',
|
|
37
|
+
'ophim',
|
|
38
|
+
'kage',
|
|
39
|
+
];
|
|
40
|
+
const baseUrl = 'https://rivestream.org';
|
|
41
|
+
const route =
|
|
42
|
+
type === 'tv'
|
|
43
|
+
? `/api/backendfetch?requestID=tvVideoProvider&id=${tmdbId}&season=${season}&episode=${episode}&secretKey=${secret}&service=`
|
|
44
|
+
: `/api/backendfetch?requestID=movieVideoProvider&id=${tmdbId}&secretKey=${secret}&service=`;
|
|
45
|
+
const url = baseUrl + route;
|
|
46
|
+
const subtitles: ISubtitle[] = [];
|
|
47
|
+
const sources: IVideo[] = [];
|
|
48
|
+
const servers: IEpisodeServer[] = [];
|
|
49
|
+
await Promise.all(
|
|
50
|
+
riveServers.map(async (server) => {
|
|
51
|
+
// console.log('Rive: ' + url + server);
|
|
52
|
+
try {
|
|
53
|
+
const res = await axios.get(url + server, {
|
|
54
|
+
timeout: 4000,
|
|
55
|
+
headers: {
|
|
56
|
+
'Referer': baseUrl,
|
|
57
|
+
'User-Agent': USER_AGENT,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
if (res.data?.data?.captions) {
|
|
62
|
+
res.data?.data?.captions.forEach((sub: any) => {
|
|
63
|
+
subtitles.push({
|
|
64
|
+
lang: sub?.label?.slice(0, 2) || 'Und',
|
|
65
|
+
url: sub?.file,
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
res.data?.data?.sources.forEach((source: IVideo) => {
|
|
71
|
+
servers.push({
|
|
72
|
+
name: source?.source + '-' + source?.quality,
|
|
73
|
+
url: source?.url,
|
|
74
|
+
});
|
|
75
|
+
sources.push({
|
|
76
|
+
url: source?.url,
|
|
77
|
+
isM3U8: source?.format === 'hls' ? true : false,
|
|
78
|
+
quality: source?.quality,
|
|
79
|
+
name: source?.source + '-' + source?.quality,
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
} catch (e) {
|
|
83
|
+
// console.log(e);
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
const validUrls = await filterValidM3U8(sources.map((s) => s.url));
|
|
89
|
+
return {
|
|
90
|
+
sources: sources.filter((source) => validUrls.includes(source.url)),
|
|
91
|
+
subtitles: subtitles.filter((sub) => sub.url && sub.lang),
|
|
92
|
+
servers: servers.filter((source) => validUrls.includes(source.url)),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function generateSecretKey(id: number | string) {
|
|
97
|
+
// Array of secret key fragments - updated array from the new implementation
|
|
98
|
+
const c = [
|
|
99
|
+
'oYRu3JJ5g1C',
|
|
100
|
+
'TRlWJIJXT',
|
|
101
|
+
'RuoyGA0udvsFVXr',
|
|
102
|
+
'Y4s2LNM4y',
|
|
103
|
+
'wHzuSgl0fD',
|
|
104
|
+
'MGLTaSGs',
|
|
105
|
+
'rr0rSBIYfwutV7E',
|
|
106
|
+
'ABJXC9c',
|
|
107
|
+
'W2BuY0yDB9CcK',
|
|
108
|
+
'3yvZP1OJuTM',
|
|
109
|
+
'YDoqbu6zdN0zT',
|
|
110
|
+
'rnNQ2a5OBaMu',
|
|
111
|
+
'eSKa1Uy',
|
|
112
|
+
'QsIV8J472Xa',
|
|
113
|
+
'cPfTgu27',
|
|
114
|
+
'j4mzadQCou9',
|
|
115
|
+
'qHLZbLrZQfB',
|
|
116
|
+
'8U9YP6hrTz4cJNQ',
|
|
117
|
+
'xbAbu4pzFEXz',
|
|
118
|
+
'dhuA9zvdw',
|
|
119
|
+
'k3A1JGmb',
|
|
120
|
+
'eVC3z4COdUNvvzA',
|
|
121
|
+
'dwMmuXnrb',
|
|
122
|
+
'AqpWzY9I1ZmGPR',
|
|
123
|
+
'VGXWUm0JTetmXs',
|
|
124
|
+
'gD4sH3CISTanpTs',
|
|
125
|
+
'd6w8dntV',
|
|
126
|
+
'iL6dvSNqEab4kd',
|
|
127
|
+
'mIB8NFtmPjnX1kM',
|
|
128
|
+
'F4PXdP0Hx3',
|
|
129
|
+
'5Fijua4Z7C',
|
|
130
|
+
'wPGnHJrkYa1Tu4P',
|
|
131
|
+
'pjrfBfTf',
|
|
132
|
+
'vswQDEbM0y64io',
|
|
133
|
+
'LAnpQuk6hR2bEWs',
|
|
134
|
+
'kX8orxNnkK',
|
|
135
|
+
'mRsZ5fjHbC8YuT',
|
|
136
|
+
'JnBr1jr',
|
|
137
|
+
'2twFGU5PgvDmKdP',
|
|
138
|
+
'3wCg6zYtHFjy',
|
|
139
|
+
'gaQSJhixHiy1pa8',
|
|
140
|
+
'pE2cXTP0GPX',
|
|
141
|
+
'xr0ONW3sOnCRdt',
|
|
142
|
+
'QZu43flHFsebX',
|
|
143
|
+
'yrvtqRTOnHo',
|
|
144
|
+
'kvXEs16lgj',
|
|
145
|
+
'AGwT2zpQVHCMb09',
|
|
146
|
+
'M4BxOh3z2JgC',
|
|
147
|
+
'5hbV7briYC7',
|
|
148
|
+
'YfHMsm0',
|
|
149
|
+
'jC9PAPfz34Vgc',
|
|
150
|
+
'ExoJ1tgEXpK',
|
|
151
|
+
'eD8WPA4Lmsyf4W',
|
|
152
|
+
'h7WSlhT7iNOj',
|
|
153
|
+
'RRP61kk',
|
|
154
|
+
'QtY0f1aN',
|
|
155
|
+
'TlatGjcOQjup',
|
|
156
|
+
'MfpeEGbjouYSOa',
|
|
157
|
+
'Zz0Qh8B0pwUkdRT',
|
|
158
|
+
'Y4SkLSQNU',
|
|
159
|
+
'hOk01KFeEVbNRZx',
|
|
160
|
+
'fyf4H8MXazm3oY',
|
|
161
|
+
'Z116B9F2p',
|
|
162
|
+
'GdxNJOnvdz',
|
|
163
|
+
'kqVNNHfP',
|
|
164
|
+
'IO3hhNu',
|
|
165
|
+
'qDdC9Lcllce',
|
|
166
|
+
'Et7lLOg',
|
|
167
|
+
'6ZlQrvfgZu',
|
|
168
|
+
'YXHLeZBF',
|
|
169
|
+
'NH6nAd7y',
|
|
170
|
+
'ARsut59gfK6j0v',
|
|
171
|
+
'jPE2KXiJjnSsjn',
|
|
172
|
+
'qYcG5HOJc3TtxM',
|
|
173
|
+
'C2w06YGj5C',
|
|
174
|
+
'kHx1pT7',
|
|
175
|
+
'2enXfHXw',
|
|
176
|
+
'koFHBiR054aizN',
|
|
177
|
+
'Uj53XTQ92Ntbq7K',
|
|
178
|
+
'QjC5euFYi2AuxWb',
|
|
179
|
+
'njLwvdMejA',
|
|
180
|
+
'NWMzrwTAVZEb',
|
|
181
|
+
's4sVqC0AyTM5h',
|
|
182
|
+
'pu01jeZ6AoH',
|
|
183
|
+
'SgiOfwx9qkR',
|
|
184
|
+
'grjsLtBNn9eTQg',
|
|
185
|
+
'XABTTaYgihZk2mq',
|
|
186
|
+
'2vlSCZQc3HT27F4',
|
|
187
|
+
'kQZ7VQfEL3TC7P',
|
|
188
|
+
'MEzqVne021W',
|
|
189
|
+
'BLYPZp2SIO',
|
|
190
|
+
'5zDMVoqw4nH',
|
|
191
|
+
't14S9uLuGKX7Lb5',
|
|
192
|
+
'4McODHAYTyp',
|
|
193
|
+
'EAoxL5UKvMPqjH3',
|
|
194
|
+
'hJpAbqp',
|
|
195
|
+
'tcj63Wpz',
|
|
196
|
+
'hGqEu0LxKkMv46P',
|
|
197
|
+
'u2wNvb8ou19N3',
|
|
198
|
+
'wUKY6Opi1kH',
|
|
199
|
+
];
|
|
200
|
+
|
|
201
|
+
try {
|
|
202
|
+
let e = (function (e) {
|
|
203
|
+
if (e === undefined) {
|
|
204
|
+
return 'rive';
|
|
205
|
+
}
|
|
206
|
+
try {
|
|
207
|
+
let t;
|
|
208
|
+
let n;
|
|
209
|
+
let r = String(e);
|
|
210
|
+
if (isNaN(Number(e))) {
|
|
211
|
+
let e = r.split('').reduce((e, t) => e + t.charCodeAt(0), 0);
|
|
212
|
+
t = c[e % c.length] || btoa(r);
|
|
213
|
+
n = Math.floor((e % r.length) / 2);
|
|
214
|
+
} else {
|
|
215
|
+
let i = Number(e);
|
|
216
|
+
t = c[i % c.length] || btoa(r);
|
|
217
|
+
n = Math.floor((i % r.length) / 2);
|
|
218
|
+
}
|
|
219
|
+
let i = r.slice(0, n) + t + r.slice(n);
|
|
220
|
+
let o = (function (e) {
|
|
221
|
+
let t = String(e);
|
|
222
|
+
let n = t.length ^ -559038737;
|
|
223
|
+
for (let e = 0; e < t.length; e++) {
|
|
224
|
+
let r = t.charCodeAt(e);
|
|
225
|
+
r ^= ((e * 131 + 89) ^ (r << e % 5)) & 255;
|
|
226
|
+
n = (((n << 7) | (n >>> 25)) >>> 0) ^ r;
|
|
227
|
+
let i = (n & 65535) * 60205;
|
|
228
|
+
let o = ((n >>> 16) * 60205) << 16;
|
|
229
|
+
n = (i + o) >>> 0;
|
|
230
|
+
n ^= n >>> 11;
|
|
231
|
+
}
|
|
232
|
+
n ^= n >>> 15;
|
|
233
|
+
n = ((n & 65535) * 49842 + (((n >>> 16) * 49842) << 16)) >>> 0;
|
|
234
|
+
n ^= n >>> 13;
|
|
235
|
+
n = ((n & 65535) * 40503 + (((n >>> 16) * 40503) << 16)) >>> 0;
|
|
236
|
+
n ^= n >>> 16;
|
|
237
|
+
n = ((n & 65535) * 10196 + (((n >>> 16) * 10196) << 16)) >>> 0;
|
|
238
|
+
return (n ^= n >>> 15).toString(16).padStart(8, '0');
|
|
239
|
+
})(
|
|
240
|
+
(function (e) {
|
|
241
|
+
e = String(e);
|
|
242
|
+
let t = 0;
|
|
243
|
+
for (let n = 0; n < e.length; n++) {
|
|
244
|
+
let r = e.charCodeAt(n);
|
|
245
|
+
let i = (((t = (r + (t << 6) + (t << 16) - t) >>> 0) << n % 5) | (t >>> (32 - (n % 5)))) >>> 0;
|
|
246
|
+
t ^= (i ^ ((r << n % 7) | (r >>> (8 - (n % 7))))) >>> 0;
|
|
247
|
+
t = (t + ((t >>> 11) ^ (t << 3))) >>> 0;
|
|
248
|
+
}
|
|
249
|
+
t ^= t >>> 15;
|
|
250
|
+
t = ((t & 65535) * 49842 + ((((t >>> 16) * 49842) & 65535) << 16)) >>> 0;
|
|
251
|
+
t ^= t >>> 13;
|
|
252
|
+
t = ((t & 65535) * 40503 + ((((t >>> 16) * 40503) & 65535) << 16)) >>> 0;
|
|
253
|
+
return (t ^= t >>> 16).toString(16).padStart(8, '0');
|
|
254
|
+
})(i)
|
|
255
|
+
);
|
|
256
|
+
return btoa(o);
|
|
257
|
+
} catch (e) {
|
|
258
|
+
return 'topSecret';
|
|
259
|
+
}
|
|
260
|
+
})(id);
|
|
261
|
+
return e;
|
|
262
|
+
} catch (e) {
|
|
263
|
+
console.error('Error fetching data:', e);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export async function getVidsrcSourcesAndServers(id: string): Promise<ISource & { servers: IEpisodeServer[] }> {
|
|
268
|
+
const parts = id.split('$');
|
|
269
|
+
const [tmdbId, type, episode, season] = parts;
|
|
270
|
+
const baseURL = 'https://vidsrc.xyz/embed/';
|
|
271
|
+
const headers = {
|
|
272
|
+
'User-Agent':
|
|
273
|
+
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36',
|
|
274
|
+
'Referer': 'https://vidsrc.xyz/',
|
|
275
|
+
};
|
|
276
|
+
const servers: IEpisodeServer[] = [];
|
|
277
|
+
const sources: IVideo[] = [];
|
|
278
|
+
const url =
|
|
279
|
+
type === 'tv'
|
|
280
|
+
? `${baseURL}tv?tmdb=${tmdbId}&season=${season}&episode=${episode}`
|
|
281
|
+
: `${baseURL}movie?tmdb=${tmdbId}`;
|
|
282
|
+
|
|
283
|
+
try {
|
|
284
|
+
// Step 1: Fetch embed iframe
|
|
285
|
+
const { data: html1 } = await axios.get(url, { headers });
|
|
286
|
+
const match1 = html1.match(/src="(.*?)"/)?.[1];
|
|
287
|
+
if (!match1) throw new Error('No source iframe found');
|
|
288
|
+
const allUrlRCP: any = [];
|
|
289
|
+
// Construct the RCP URL
|
|
290
|
+
const urlRCP = match1.startsWith('http')
|
|
291
|
+
? match1
|
|
292
|
+
: match1.startsWith('/embed')
|
|
293
|
+
? baseURL.split('/embed')[0] + match1
|
|
294
|
+
: 'https:' + match1;
|
|
295
|
+
|
|
296
|
+
const $ = load(html1);
|
|
297
|
+
$('.serversList .server').each((i, el) => {
|
|
298
|
+
const name = $(el).text().trim();
|
|
299
|
+
const hash = $(el).attr('data-hash');
|
|
300
|
+
allUrlRCP.push({ name, url: `${urlRCP.split('rcp')[0]}rcp/${hash!}` });
|
|
301
|
+
});
|
|
302
|
+
// Step 2: Fetch all URLs from allUrlRCP and process them
|
|
303
|
+
await Promise.all(
|
|
304
|
+
allUrlRCP.map(async ({ name, url: rcpUrl }: { name: string; url: string }) => {
|
|
305
|
+
try {
|
|
306
|
+
// console.log(`Fetching RCP for ${name} from ${rcpUrl}`);
|
|
307
|
+
const { data: html2 } = await axios.get(rcpUrl, {
|
|
308
|
+
headers: { ...headers, Referer: url },
|
|
309
|
+
});
|
|
310
|
+
// console.log(`Found RCP for ${name}: ${html2}`);
|
|
311
|
+
const match2 = html2.match(/src.*['"](\/(?:src|pro)rcp.*?)['"]/)?.[1];
|
|
312
|
+
if (!match2) return;
|
|
313
|
+
|
|
314
|
+
const urlPRORCP = rcpUrl.split('rcp')[0] + match2;
|
|
315
|
+
|
|
316
|
+
// Step 3: Fetch M3U8 file URL
|
|
317
|
+
// console.log(`Fetching M3U8 for ${name} from ${urlPRORCP}`);
|
|
318
|
+
const { data: html3 } = await axios.get(urlPRORCP, {
|
|
319
|
+
headers: { ...headers, Referer: rcpUrl },
|
|
320
|
+
});
|
|
321
|
+
const match3 = html3.match(/file:\s*['"]([^'"]+\.m3u8)['"]/)?.[1];
|
|
322
|
+
// console.log(`Found M3U8 for ${name}: ${match3}`);
|
|
323
|
+
if (match3) {
|
|
324
|
+
servers.push({
|
|
325
|
+
name: name,
|
|
326
|
+
url: match3,
|
|
327
|
+
});
|
|
328
|
+
sources.push({
|
|
329
|
+
url: match3,
|
|
330
|
+
isM3U8: match3.includes('.m3u8'),
|
|
331
|
+
quality: 'default',
|
|
332
|
+
name: name,
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
} catch (error) {
|
|
336
|
+
// Silently continue on error for individual servers
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
})
|
|
340
|
+
);
|
|
341
|
+
return {
|
|
342
|
+
servers,
|
|
343
|
+
sources,
|
|
344
|
+
headers: { Referer: urlRCP.split('rcp')[0] },
|
|
345
|
+
};
|
|
346
|
+
} catch (error) {
|
|
347
|
+
throw new Error(`Failed to fetch Vidsrc stream: ${(error as Error).message}`);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export async function getMultiServers(id: string): Promise<IEpisodeServer[]> {
|
|
352
|
+
try {
|
|
353
|
+
const servers: IEpisodeServer[] = [];
|
|
354
|
+
const [{ servers: riveServers }, { servers: vidsrcServers }] = await Promise.all([
|
|
355
|
+
getRiveSourcesAndServers(id),
|
|
356
|
+
getVidsrcSourcesAndServers(id),
|
|
357
|
+
]);
|
|
358
|
+
servers.push(...riveServers, ...vidsrcServers);
|
|
359
|
+
|
|
360
|
+
return servers;
|
|
361
|
+
} catch (error) {
|
|
362
|
+
throw new Error(`Failed to fetch Multistream servers: ${(error as Error).message}`);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export async function getMultiSources(id: string, server: string): Promise<ISource> {
|
|
367
|
+
try {
|
|
368
|
+
const [{ servers: _, ...riveSources }, { servers: __, ...vidsrcSources }] = await Promise.all([
|
|
369
|
+
getRiveSourcesAndServers(id),
|
|
370
|
+
getVidsrcSourcesAndServers(id),
|
|
371
|
+
]);
|
|
372
|
+
|
|
373
|
+
const allSources = {
|
|
374
|
+
...riveSources,
|
|
375
|
+
...vidsrcSources,
|
|
376
|
+
sources: [...(riveSources.sources || []), ...(vidsrcSources.sources || [])],
|
|
377
|
+
subtitles: [...(riveSources.subtitles || []), ...(vidsrcSources.subtitles || [])],
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
const matchedSources = allSources.sources?.filter((source: IVideo) => source.name === server) || [];
|
|
381
|
+
|
|
382
|
+
if (matchedSources.length === 0) {
|
|
383
|
+
throw new Error(`No sources found for server: ${server}`);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
return {
|
|
387
|
+
sources: matchedSources,
|
|
388
|
+
subtitles: allSources.subtitles || [],
|
|
389
|
+
};
|
|
390
|
+
} catch (error) {
|
|
391
|
+
throw new Error(`Failed to fetch MultiSources: ${(error as Error).message}`);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
import { makeGetRequestWithWebView } from '../../NativeConsumet';
|
|
12
12
|
class NetflixMirror extends MovieParser {
|
|
13
13
|
override readonly name = 'NetflixMirror';
|
|
14
|
-
protected override baseUrl = 'https://netfree2.cc';
|
|
15
|
-
protected override logo = 'https://netfree2.cc//mobile/img/nf2/icon_x192.png';
|
|
14
|
+
protected override baseUrl = 'https://a.netfree2.cc';
|
|
15
|
+
protected override logo = 'https://a.netfree2.cc//mobile/img/nf2/icon_x192.png';
|
|
16
16
|
protected override classPath = 'MOVIES.NetflixMirror';
|
|
17
17
|
override supportedTypes = new Set([TvType.MOVIE, TvType.TVSERIES]);
|
|
18
18
|
private nfCookie: null | string = 'hd=on;';
|