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.
- package/lib/commonjs/extension-registry.json +4 -4
- package/lib/commonjs/extractors/megaup.js +1 -1
- package/lib/commonjs/extractors/megaup.js.map +1 -1
- package/lib/commonjs/providers/anime/animekai/create-animekai.js +44 -27
- package/lib/commonjs/providers/anime/animekai/create-animekai.js.map +1 -1
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +2 -2
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/commonjs/providers/meta/anilist.js +1 -1
- package/lib/commonjs/providers/meta/anilist.js.map +1 -1
- package/lib/commonjs/providers/meta/tmdb.js +1 -2
- package/lib/commonjs/providers/meta/tmdb.js.map +1 -1
- 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/create-multimovies.js +21 -21
- package/lib/commonjs/providers/movies/multimovies/create-multimovies.js.map +1 -1
- package/lib/commonjs/providers/movies/multistream/index.js +16 -16
- package/lib/commonjs/providers/movies/netflixmirror/create-netflixmirror.js +267 -0
- package/lib/commonjs/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -0
- package/lib/commonjs/providers/movies/netflixmirror/netflixmirror.js +35 -0
- package/lib/commonjs/providers/movies/netflixmirror/netflixmirror.js.map +1 -0
- package/lib/commonjs/utils/utils.js +16 -9
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/extension-registry.json +4 -4
- package/lib/module/extractors/megaup.js +1 -1
- package/lib/module/extractors/megaup.js.map +1 -1
- package/lib/module/providers/anime/animekai/create-animekai.js +44 -27
- package/lib/module/providers/anime/animekai/create-animekai.js.map +1 -1
- package/lib/module/providers/anime/animepahe/create-animepahe.js +2 -2
- package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/module/providers/meta/anilist.js +1 -1
- package/lib/module/providers/meta/anilist.js.map +1 -1
- package/lib/module/providers/meta/tmdb.js +1 -2
- package/lib/module/providers/meta/tmdb.js.map +1 -1
- 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/create-multimovies.js +21 -21
- package/lib/module/providers/movies/multimovies/create-multimovies.js.map +1 -1
- package/lib/module/providers/movies/multistream/index.js +16 -16
- package/lib/module/providers/movies/netflixmirror/create-netflixmirror.js +263 -0
- package/lib/module/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -0
- package/lib/module/providers/movies/netflixmirror/netflixmirror.js +32 -0
- package/lib/module/providers/movies/netflixmirror/netflixmirror.js.map +1 -0
- package/lib/module/utils/utils.js +16 -9
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animekai/create-animekai.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 +3 -1
- package/lib/typescript/commonjs/src/providers/movies/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/multimovies/create-multimovies.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/create-netflixmirror.d.ts +23 -0
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/create-netflixmirror.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/netflixmirror.d.ts +20 -0
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/netflixmirror.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/utils.d.ts +5 -0
- package/lib/typescript/commonjs/src/utils/utils.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animekai/create-animekai.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 +3 -1
- package/lib/typescript/module/src/providers/movies/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/multimovies/create-multimovies.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/netflixmirror/create-netflixmirror.d.ts +23 -0
- package/lib/typescript/module/src/providers/movies/netflixmirror/create-netflixmirror.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/netflixmirror/netflixmirror.d.ts +20 -0
- package/lib/typescript/module/src/providers/movies/netflixmirror/netflixmirror.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/utils.d.ts +5 -0
- package/lib/typescript/module/src/utils/utils.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/extension-registry.json +4 -4
- package/src/extractors/megaup.ts +1 -1
- package/src/providers/anime/animekai/create-animekai.ts +45 -26
- package/src/providers/anime/animepahe/create-animepahe.ts +2 -2
- package/src/providers/meta/anilist.ts +1 -1
- package/src/providers/meta/tmdb.ts +1 -2
- package/src/providers/movies/index.ts +3 -1
- package/src/providers/movies/multimovies/create-multimovies.ts +28 -24
- package/src/providers/movies/multistream/index.ts +232 -232
- package/src/providers/movies/netflixmirror/create-netflixmirror.ts +344 -0
- package/src/providers/movies/netflixmirror/netflixmirror.ts +46 -0
- package/src/utils/utils.ts +48 -20
- package/lib/commonjs/providers/movies/netflixmirror.js +0 -245
- package/lib/commonjs/providers/movies/netflixmirror.js.map +0 -1
- package/lib/module/providers/movies/netflixmirror.js +0 -241
- package/lib/module/providers/movies/netflixmirror.js.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror.d.ts +0 -38
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/netflixmirror.d.ts +0 -38
- package/lib/typescript/module/src/providers/movies/netflixmirror.d.ts.map +0 -1
- package/src/providers/movies/netflixmirror.ts +0 -288
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
import {
|
|
3
|
-
MovieParser,
|
|
4
|
-
TvType,
|
|
5
|
-
type IMovieInfo,
|
|
6
|
-
type IEpisodeServer,
|
|
7
|
-
type ISource,
|
|
8
|
-
type IMovieResult,
|
|
9
|
-
type ISearch,
|
|
10
|
-
type IMovieEpisode,
|
|
11
|
-
} from '../../models';
|
|
12
|
-
import { makeGetRequestWithWebView } from '../../NativeConsumet';
|
|
13
|
-
class NetflixMirror extends MovieParser {
|
|
14
|
-
override readonly name = 'NetflixMirror';
|
|
15
|
-
protected override baseUrl = 'https://a.netfree2.cc';
|
|
16
|
-
protected override logo = 'https://a.netfree2.cc//mobile/img/nf2/icon_x192.png';
|
|
17
|
-
protected override classPath = 'MOVIES.NetflixMirror';
|
|
18
|
-
override supportedTypes = new Set([TvType.MOVIE, TvType.TVSERIES]);
|
|
19
|
-
private nfCookie: null | string = 'hd=on;';
|
|
20
|
-
|
|
21
|
-
constructor(customBaseURL?: string) {
|
|
22
|
-
super();
|
|
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
|
-
this.initCookie();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
private async initCookie(): Promise<void> {
|
|
36
|
-
try {
|
|
37
|
-
const { data } = await axios.get(
|
|
38
|
-
'https://raw.githubusercontent.com/2004durgesh/nfmirror-cookies/refs/heads/main/captured-cookies.json'
|
|
39
|
-
);
|
|
40
|
-
for (const cookie of data.cookiesByDomain['.netfree2.cc']) {
|
|
41
|
-
this.nfCookie += `${cookie.name}=${cookie.value.replace('%3A%3Asu', '%3A%3Ani')};`;
|
|
42
|
-
}
|
|
43
|
-
} catch (err) {
|
|
44
|
-
console.error('Failed to get cookie:', err);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
private Headers() {
|
|
49
|
-
const headers: Record<string, string> = {
|
|
50
|
-
'authority': 'netfree2.cc',
|
|
51
|
-
'accept': 'application/json, text/javascript, */*; q=0.01',
|
|
52
|
-
'sec-ch-ua': '"Not A(Brand";v="99", "Microsoft Edge";v="121", "Chromium";v="121"',
|
|
53
|
-
'sec-ch-ua-mobile': '?0',
|
|
54
|
-
'sec-ch-ua-platform': '"Windows"',
|
|
55
|
-
'sec-fetch-dest': 'empty',
|
|
56
|
-
'sec-fetch-mode': 'cors',
|
|
57
|
-
'sec-fetch-site': 'same-origin',
|
|
58
|
-
'x-requested-with': 'XMLHttpRequest',
|
|
59
|
-
'Referer': `${this.baseUrl}/mobile/home`,
|
|
60
|
-
'user-agent':
|
|
61
|
-
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36',
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
if (this.nfCookie) {
|
|
65
|
-
headers.Cookie = this.nfCookie || '';
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return headers;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
*
|
|
73
|
-
* @param query search query string
|
|
74
|
-
* @param page page number (default 1) (optional)
|
|
75
|
-
*/
|
|
76
|
-
override search = async (query: string, page: number = 1): Promise<ISearch<IMovieResult>> => {
|
|
77
|
-
const searchResult: ISearch<IMovieResult> = {
|
|
78
|
-
currentPage: page,
|
|
79
|
-
hasNextPage: false,
|
|
80
|
-
results: [],
|
|
81
|
-
};
|
|
82
|
-
try {
|
|
83
|
-
const { data } = await axios.get(
|
|
84
|
-
`https://netmirror.8man.me/api/net-proxy?isPrime=false&url=${
|
|
85
|
-
this.baseUrl
|
|
86
|
-
}/mobile/search.php?s=${encodeURI(query)}`,
|
|
87
|
-
{
|
|
88
|
-
headers: this.Headers(),
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
const basicResults = data.searchResult || [];
|
|
93
|
-
|
|
94
|
-
if (basicResults.length === 0) {
|
|
95
|
-
return searchResult;
|
|
96
|
-
}
|
|
97
|
-
const detailedResults = await Promise.all(
|
|
98
|
-
basicResults.map(async (item: any) => {
|
|
99
|
-
try {
|
|
100
|
-
// Fetch additional details for each item
|
|
101
|
-
const detailResponse = await axios.get(
|
|
102
|
-
`https://netmirror.8man.me/api/net-proxy?isPrime=false&url=${this.baseUrl}/mobile/post.php?id=${item.id}`,
|
|
103
|
-
{
|
|
104
|
-
headers: this.Headers(),
|
|
105
|
-
}
|
|
106
|
-
);
|
|
107
|
-
|
|
108
|
-
return {
|
|
109
|
-
id: item.id,
|
|
110
|
-
title: item.t,
|
|
111
|
-
image: `https://imgcdn.media/poster/v/${item.id}.jpg`,
|
|
112
|
-
type: detailResponse.data.type === 't' ? TvType.TVSERIES : TvType.MOVIE,
|
|
113
|
-
releaseDate: detailResponse.data.year,
|
|
114
|
-
seasons: detailResponse.data.season?.length ?? undefined,
|
|
115
|
-
};
|
|
116
|
-
} catch (error) {
|
|
117
|
-
// If we can't fetch details, just return the basic info
|
|
118
|
-
console.error(`Error fetching details for ${item.id}:`, error);
|
|
119
|
-
return {
|
|
120
|
-
id: item.id,
|
|
121
|
-
title: item.t,
|
|
122
|
-
image: `https://imgcdn.media/poster/v/${item.id}.jpg`,
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
})
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
searchResult.results = detailedResults;
|
|
129
|
-
|
|
130
|
-
return searchResult;
|
|
131
|
-
} catch (err) {
|
|
132
|
-
throw new Error((err as Error).message);
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
private async fetchAllEpisodesForSeason(seasonId: string, seriesId: string): Promise<IMovieEpisode[]> {
|
|
137
|
-
let page = 1;
|
|
138
|
-
let episodes: IMovieEpisode[] = [];
|
|
139
|
-
|
|
140
|
-
while (true) {
|
|
141
|
-
const url = `https://netfree2.cc/mobile/episodes.php?s=${seasonId}&series=${seriesId}&page=${page}`;
|
|
142
|
-
const { data } = await axios.get(url);
|
|
143
|
-
|
|
144
|
-
if (data.episodes?.length) {
|
|
145
|
-
episodes.push(
|
|
146
|
-
...data.episodes.map((episode: IMovieEpisode) => ({
|
|
147
|
-
id: episode.id,
|
|
148
|
-
title: episode.t as string,
|
|
149
|
-
season: parseInt(String(episode.s).replace('S', '')),
|
|
150
|
-
number: parseInt(String(episode.ep).replace('E', '')),
|
|
151
|
-
image: `https://imgcdn.media/epimg/150/${episode.id}.jpg`,
|
|
152
|
-
}))
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if (data.nextPageShow !== 1) break; // no more pages
|
|
157
|
-
page++;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return episodes;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
private async fetchAllEpisodesOrdered(seasons: any[], seriesId: string) {
|
|
164
|
-
const allEpisodes: any[] = [];
|
|
165
|
-
|
|
166
|
-
for (const season of seasons.sort((a, b) => Number(a.s) - Number(b.s))) {
|
|
167
|
-
const seasonEpisodes = await this.fetchAllEpisodesForSeason(season.id, seriesId);
|
|
168
|
-
allEpisodes.push(...seasonEpisodes);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return allEpisodes;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
*
|
|
176
|
-
* @param mediaId media link or id
|
|
177
|
-
*/
|
|
178
|
-
override fetchMediaInfo = async (mediaId: string): Promise<IMovieInfo> => {
|
|
179
|
-
const movieInfo: IMovieInfo = {
|
|
180
|
-
id: mediaId!,
|
|
181
|
-
title: '',
|
|
182
|
-
};
|
|
183
|
-
try {
|
|
184
|
-
const { data } = await axios.get(
|
|
185
|
-
`https://netmirror.8man.me/api/net-proxy?isPrime=false&url=${this.baseUrl}/mobile/post.php?id=${mediaId}`,
|
|
186
|
-
{
|
|
187
|
-
headers: this.Headers(),
|
|
188
|
-
}
|
|
189
|
-
);
|
|
190
|
-
|
|
191
|
-
movieInfo.cover = `https://imgcdn.media/poster/h/${mediaId}.jpg`;
|
|
192
|
-
movieInfo.title = data.title;
|
|
193
|
-
movieInfo.image = `https://imgcdn.media/poster/v/${mediaId}.jpg`;
|
|
194
|
-
movieInfo.description = data.desc?.trim() ?? '';
|
|
195
|
-
movieInfo.type = data.type === 't' ? TvType.TVSERIES : TvType.MOVIE;
|
|
196
|
-
movieInfo.releaseDate = data.year;
|
|
197
|
-
movieInfo.genres = data.genre?.split(',').map((genre: string) => genre?.trim()) ?? [];
|
|
198
|
-
movieInfo.duration = data.runtime;
|
|
199
|
-
if (movieInfo.type === TvType.TVSERIES) {
|
|
200
|
-
movieInfo.episodes = await this.fetchAllEpisodesOrdered(data.season, mediaId);
|
|
201
|
-
} else {
|
|
202
|
-
movieInfo.episodes = [
|
|
203
|
-
{
|
|
204
|
-
id: mediaId,
|
|
205
|
-
title: data.title,
|
|
206
|
-
image: movieInfo.cover || movieInfo.image,
|
|
207
|
-
},
|
|
208
|
-
];
|
|
209
|
-
}
|
|
210
|
-
return movieInfo;
|
|
211
|
-
} catch (err) {
|
|
212
|
-
throw new Error((err as Error).message);
|
|
213
|
-
}
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
*
|
|
218
|
-
* @param episodeId episode id
|
|
219
|
-
* @param media media id
|
|
220
|
-
*/
|
|
221
|
-
override fetchEpisodeSources = async (
|
|
222
|
-
episodeId: string,
|
|
223
|
-
mediaId?: string //just placeholder for compatibility with tmdb
|
|
224
|
-
): Promise<ISource> => {
|
|
225
|
-
try {
|
|
226
|
-
if (!this.nfCookie) {
|
|
227
|
-
await this.initCookie();
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
await makeGetRequestWithWebView(
|
|
231
|
-
`https://netfree2.cc/mobile/playlist.php?id=${episodeId}&tm=${Math.round(new Date().getTime() / 1000)}`,
|
|
232
|
-
{
|
|
233
|
-
Cookie: this.nfCookie!,
|
|
234
|
-
}
|
|
235
|
-
);
|
|
236
|
-
const { data } = await axios.get(
|
|
237
|
-
`https://netmirror.8man.me/api/net-proxy?isPrime=false&url=${this.baseUrl}/mobile/playlist.php?id=${episodeId}`,
|
|
238
|
-
{
|
|
239
|
-
headers: this.Headers(),
|
|
240
|
-
}
|
|
241
|
-
);
|
|
242
|
-
const sources: ISource = {
|
|
243
|
-
sources: [],
|
|
244
|
-
subtitles: [],
|
|
245
|
-
};
|
|
246
|
-
data[0].sources?.map((source: any) => {
|
|
247
|
-
sources.sources.push({
|
|
248
|
-
url: `${this.baseUrl}${source.file.replace(/%3A%3Asu/g, '%3A%3Ani').replace(/::su/g, '::ni')}`,
|
|
249
|
-
quality: source.label === 'Auto' ? source.label.toLowerCase() : source.file.match(/[?&]q=([^&]+)/)?.[1],
|
|
250
|
-
isM3U8: source.file.includes('.m3u8'),
|
|
251
|
-
});
|
|
252
|
-
});
|
|
253
|
-
|
|
254
|
-
data[0].tracks?.map((subtitle: any) => {
|
|
255
|
-
sources.subtitles = sources.subtitles || [];
|
|
256
|
-
sources.subtitles.push({
|
|
257
|
-
url: `https:${subtitle.file}`,
|
|
258
|
-
lang: subtitle.label,
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
return sources;
|
|
263
|
-
} catch (error) {
|
|
264
|
-
throw new Error((error as Error).message);
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* @deprecated method not implemented
|
|
270
|
-
* @param episodeId takes episode link or movie id
|
|
271
|
-
*/
|
|
272
|
-
override fetchEpisodeServers = async (episodeId: string): Promise<IEpisodeServer[]> => {
|
|
273
|
-
throw new Error('Method not implemented.');
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
// (async () => {
|
|
278
|
-
// const movie = new NetflixMirror();
|
|
279
|
-
// const search = await movie.search('one');
|
|
280
|
-
// // const movieInfo = await movie.fetchMediaInfo(search.results[0]?.id);
|
|
281
|
-
// // const sources = await movie.fetchEpisodeSources(movieInfo.episodes![0]?.id);
|
|
282
|
-
// // const server = await movie.fetchEpisodeServers(search.results[0]?.id);
|
|
283
|
-
// // const recentTv = await movie.fetchPopular();
|
|
284
|
-
// // const genre = await movie.fetchByGenre('action');
|
|
285
|
-
// console.log(search);
|
|
286
|
-
// })();
|
|
287
|
-
|
|
288
|
-
export default NetflixMirror;
|