react-native-consumet 1.0.0-rc.1 → 1.0.0-rc.2
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/android/generated/java/com/consumet/NativeConsumetSpec.java +4 -0
- package/android/generated/jni/RNConsumetSpec-generated.cpp +6 -0
- package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI-generated.cpp +8 -0
- package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI.h +9 -0
- package/android/src/main/java/com/consumet/ConsumetModule.kt +7 -0
- package/android/src/main/java/com/consumet/DdosGuardModule.kt +248 -189
- package/ios/generated/RNConsumetSpec/RNConsumetSpec-generated.mm +7 -0
- package/ios/generated/RNConsumetSpec/RNConsumetSpec.h +2 -0
- package/ios/generated/RNConsumetSpecJSI-generated.cpp +8 -0
- package/ios/generated/RNConsumetSpecJSI.h +9 -0
- package/lib/commonjs/NativeConsumet.ts +28 -26
- package/lib/commonjs/extension-registry.json +81 -81
- package/lib/commonjs/extractors/kwik.js +64 -19
- package/lib/commonjs/extractors/kwik.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +12 -8
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/commonjs/providers/anime/animesuge/animesuge.js +78 -0
- package/lib/commonjs/providers/anime/animesuge/animesuge.js.map +1 -0
- package/lib/commonjs/providers/anime/animesuge/create-animesuge.js +312 -0
- package/lib/commonjs/providers/anime/animesuge/create-animesuge.js.map +1 -0
- package/lib/commonjs/providers/anime/zoro/create-zoro.js +2 -1
- package/lib/commonjs/providers/anime/zoro/create-zoro.js.map +1 -1
- package/lib/commonjs/providers/anime/zoro/zoro.js +4 -3
- package/lib/commonjs/providers/anime/zoro/zoro.js.map +1 -1
- package/lib/commonjs/providers/movies/multistream/index.js +5 -4
- package/lib/commonjs/providers/movies/multistream/index.js.map +1 -1
- package/lib/commonjs/providers/movies/multistream/utils.js +142 -130
- package/lib/commonjs/providers/movies/multistream/utils.js.map +1 -1
- package/lib/commonjs/utils/ProviderManager.js +30 -29
- package/lib/commonjs/utils/ProviderManager.js.map +1 -1
- package/lib/commonjs/utils/create-extractor-context.js +11 -3
- package/lib/commonjs/utils/create-extractor-context.js.map +1 -1
- package/lib/commonjs/utils/create-provider-context.js +10 -6
- package/lib/commonjs/utils/create-provider-context.js.map +1 -1
- package/lib/commonjs/utils/extension-utils.js +9 -1
- package/lib/commonjs/utils/extension-utils.js.map +1 -1
- package/lib/module/NativeConsumet.ts +28 -26
- package/lib/module/extension-registry.json +81 -81
- package/lib/module/extractors/kwik.js +64 -19
- package/lib/module/extractors/kwik.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/providers/anime/animepahe/create-animepahe.js +12 -8
- package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/module/providers/anime/animesuge/animesuge.js +73 -0
- package/lib/module/providers/anime/animesuge/animesuge.js.map +1 -0
- package/lib/module/providers/anime/animesuge/create-animesuge.js +309 -0
- package/lib/module/providers/anime/animesuge/create-animesuge.js.map +1 -0
- package/lib/module/providers/anime/zoro/create-zoro.js +2 -1
- package/lib/module/providers/anime/zoro/create-zoro.js.map +1 -1
- package/lib/module/providers/anime/zoro/zoro.js +4 -3
- package/lib/module/providers/anime/zoro/zoro.js.map +1 -1
- package/lib/module/providers/movies/multistream/index.js +5 -4
- package/lib/module/providers/movies/multistream/index.js.map +1 -1
- package/lib/module/providers/movies/multistream/utils.js +141 -129
- package/lib/module/providers/movies/multistream/utils.js.map +1 -1
- package/lib/module/utils/ProviderManager.js +30 -29
- package/lib/module/utils/ProviderManager.js.map +1 -1
- package/lib/module/utils/create-extractor-context.js +12 -3
- package/lib/module/utils/create-extractor-context.js.map +1 -1
- package/lib/module/utils/create-provider-context.js +11 -7
- package/lib/module/utils/create-provider-context.js.map +1 -1
- package/lib/module/utils/extension-utils.js +9 -1
- package/lib/module/utils/extension-utils.js.map +1 -1
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts +2 -0
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/kwik.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +2 -2
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/extractor-context.d.ts +8 -0
- package/lib/typescript/commonjs/src/models/extractor-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/index.d.ts +2 -2
- package/lib/typescript/commonjs/src/models/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/provider-context.d.ts +6 -2
- package/lib/typescript/commonjs/src/models/provider-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animesuge/animesuge.d.ts +34 -0
- package/lib/typescript/commonjs/src/providers/anime/animesuge/animesuge.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/anime/animesuge/create-animesuge.d.ts +14 -0
- package/lib/typescript/commonjs/src/providers/anime/animesuge/create-animesuge.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/multistream/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/providers/movies/multistream/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts +2 -2
- package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/create-extractor-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/create-provider-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/extension-utils.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeConsumet.d.ts +2 -0
- package/lib/typescript/module/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/kwik.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +2 -2
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/extractor-context.d.ts +8 -0
- package/lib/typescript/module/src/models/extractor-context.d.ts.map +1 -1
- package/lib/typescript/module/src/models/index.d.ts +2 -2
- package/lib/typescript/module/src/models/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/provider-context.d.ts +6 -2
- package/lib/typescript/module/src/models/provider-context.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animesuge/animesuge.d.ts +34 -0
- package/lib/typescript/module/src/providers/anime/animesuge/animesuge.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/anime/animesuge/create-animesuge.d.ts +14 -0
- package/lib/typescript/module/src/providers/anime/animesuge/create-animesuge.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/multistream/index.d.ts +1 -1
- package/lib/typescript/module/src/providers/movies/multistream/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts +2 -2
- package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/ProviderManager.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/create-extractor-context.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/create-provider-context.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/extension-utils.d.ts.map +1 -1
- package/package.json +207 -206
- package/src/NativeConsumet.ts +2 -0
- package/src/extension-registry.json +12 -12
- package/src/extractors/kwik.ts +75 -12
- package/src/index.tsx +2 -0
- package/src/models/extractor-context.ts +14 -0
- package/src/models/index.ts +2 -1
- package/src/models/provider-context.ts +12 -2
- package/src/providers/anime/animepahe/create-animepahe.ts +10 -8
- package/src/providers/anime/animesuge/animesuge.ts +77 -0
- package/src/providers/anime/animesuge/create-animesuge.ts +327 -0
- package/src/providers/anime/zoro/create-zoro.ts +2 -1
- package/src/providers/anime/zoro/zoro.ts +4 -3
- package/src/providers/movies/multistream/index.ts +6 -5
- package/src/providers/movies/multistream/utils.ts +147 -270
- package/src/utils/ProviderManager.ts +1 -2
- package/src/utils/create-extractor-context.ts +14 -0
- package/src/utils/create-provider-context.ts +11 -1
- package/src/utils/extension-utils.ts +14 -0
|
@@ -1,268 +1,8 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import type { IEpisodeServer, ISource, ISubtitle, IVideo } from '../../../models';
|
|
3
|
-
import { USER_AGENT } from '../../../utils';
|
|
4
|
-
import { filterValidM3U8 } from '../../../utils/utils';
|
|
5
3
|
import { load } from 'cheerio';
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
}
|
|
4
|
+
import { URL } from '../../../utils/url-polyfill';
|
|
5
|
+
import CryptoJS from 'crypto-js';
|
|
266
6
|
|
|
267
7
|
export async function getVidsrcSourcesAndServers(id: string): Promise<ISource & { servers: IEpisodeServer[] }> {
|
|
268
8
|
const parts = id.split('$');
|
|
@@ -348,14 +88,151 @@ export async function getVidsrcSourcesAndServers(id: string): Promise<ISource &
|
|
|
348
88
|
}
|
|
349
89
|
}
|
|
350
90
|
|
|
91
|
+
export async function get111MoviesSourcesAndServers(id: string): Promise<ISource & { servers: IEpisodeServer[] }> {
|
|
92
|
+
const parts = id.split('$');
|
|
93
|
+
const [tmdbId, type, episode, season] = parts;
|
|
94
|
+
const baseUrl = 'https://111movies.com';
|
|
95
|
+
const userAgent =
|
|
96
|
+
'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Mobile Safari/537.36';
|
|
97
|
+
|
|
98
|
+
const defaultDomain = (() => {
|
|
99
|
+
const u = new URL(baseUrl);
|
|
100
|
+
return `${u.protocol}//${u.host}/`;
|
|
101
|
+
})();
|
|
102
|
+
|
|
103
|
+
const headers = {
|
|
104
|
+
'Referer': defaultDomain,
|
|
105
|
+
'User-Agent': userAgent,
|
|
106
|
+
// 'Content-Type': 'image/gif',
|
|
107
|
+
'X-Requested-With': 'XMLHttpRequest',
|
|
108
|
+
};
|
|
109
|
+
function customEncode(input: string): string {
|
|
110
|
+
const src = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_';
|
|
111
|
+
const dst = 'BdNqfj2X1RalybZHxP50e8UGz4Tv6mg3QS-7JnAWIsiKrCpFktVM9D_chuYOoEwL';
|
|
112
|
+
|
|
113
|
+
// Normal base64 url-safe
|
|
114
|
+
let b64 = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(input));
|
|
115
|
+
b64 = b64.replace(/\+/g, '-').replace(/\//g, '_').replace(/[=]+$/, '');
|
|
116
|
+
|
|
117
|
+
// Translate characters
|
|
118
|
+
let result = '';
|
|
119
|
+
for (const ch of b64) {
|
|
120
|
+
const idx = src.indexOf(ch);
|
|
121
|
+
result += idx >= 0 ? dst[idx] : ch;
|
|
122
|
+
}
|
|
123
|
+
return result;
|
|
124
|
+
}
|
|
125
|
+
let url;
|
|
126
|
+
if (type === 'tv') {
|
|
127
|
+
url = `${baseUrl}/tv/${tmdbId}/${season}/${episode}`;
|
|
128
|
+
} else {
|
|
129
|
+
url = `${baseUrl}/movie/${tmdbId}`;
|
|
130
|
+
}
|
|
131
|
+
const res = await axios.get(url, { headers });
|
|
132
|
+
const html = res.data as string;
|
|
133
|
+
|
|
134
|
+
// Extract raw data
|
|
135
|
+
const match = html.match(/\{\"data\":\"(.*?)\"/);
|
|
136
|
+
if (!match) {
|
|
137
|
+
console.error('No data found!');
|
|
138
|
+
throw new Error('No data found in the response');
|
|
139
|
+
}
|
|
140
|
+
const rawData = match[1];
|
|
141
|
+
|
|
142
|
+
// AES CBC encrypt
|
|
143
|
+
const keyHex = '912660f3d9f3f35cee36396d31ed73366ab53c22c70710ce029697d17762997e';
|
|
144
|
+
const ivHex = 'f91f2863783814f51c56f341d6ce1677';
|
|
145
|
+
|
|
146
|
+
const aesKey = CryptoJS.enc.Hex.parse(keyHex);
|
|
147
|
+
const aesIv = CryptoJS.enc.Hex.parse(ivHex);
|
|
148
|
+
|
|
149
|
+
const padded = CryptoJS.enc.Utf8.parse(rawData!);
|
|
150
|
+
const encrypted = CryptoJS.AES.encrypt(padded, aesKey, {
|
|
151
|
+
iv: aesIv,
|
|
152
|
+
mode: CryptoJS.mode.CBC,
|
|
153
|
+
padding: CryptoJS.pad.Pkcs7,
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// Python used .hex(), CryptoJS AES output is base64 → convert to hex
|
|
157
|
+
// AES ciphertext in hex (same as Python's .hex())
|
|
158
|
+
const aesEncryptedHex = encrypted.ciphertext.toString(CryptoJS.enc.Hex);
|
|
159
|
+
|
|
160
|
+
// XOR key as a Uint8Array instead of Buffer
|
|
161
|
+
const xorKey = new Uint8Array([0xbe, 0x43, 0x0a]);
|
|
162
|
+
|
|
163
|
+
let xorResult = '';
|
|
164
|
+
for (let i = 0; i < aesEncryptedHex.length; i++) {
|
|
165
|
+
const charCode = aesEncryptedHex.charCodeAt(i);
|
|
166
|
+
xorResult += String.fromCharCode(charCode ^ xorKey[i % xorKey.length]!);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Encode final
|
|
170
|
+
const encodedFinal = customEncode(xorResult);
|
|
171
|
+
|
|
172
|
+
// API call
|
|
173
|
+
const staticPath =
|
|
174
|
+
'to/1000003134441812/c945be05/2f30b6e198562e7015537bb71a738ff8245942a7/y/2c20617150078ad280239d1cc3a8b6ee9331acef9b0bdc6b742435597c38edb4/c8ddbffe-3efb-53e1-b883-3b6ce90ba310';
|
|
175
|
+
|
|
176
|
+
const apiServers = `https://111movies.com/${staticPath}/${encodedFinal}/sr`;
|
|
177
|
+
const { data: serversData } = await axios.post(apiServers, {}, { headers });
|
|
178
|
+
// const servers = serverRes.data;
|
|
179
|
+
|
|
180
|
+
if (!Array.isArray(serversData) || serversData.length === 0) {
|
|
181
|
+
console.error('No servers found!');
|
|
182
|
+
throw new Error('No servers found in the response');
|
|
183
|
+
}
|
|
184
|
+
const servers: IEpisodeServer[] = serversData.map((s: any) => ({
|
|
185
|
+
name: s.name,
|
|
186
|
+
url: `https://111movies.com/${staticPath}/${s.data}`,
|
|
187
|
+
}));
|
|
188
|
+
|
|
189
|
+
const sources: IVideo[] = [];
|
|
190
|
+
let subtitles: ISubtitle[] = [];
|
|
191
|
+
|
|
192
|
+
// console.log(subtitles);
|
|
193
|
+
for (const server of servers) {
|
|
194
|
+
try {
|
|
195
|
+
const { data: streamData } = await axios.post(server.url, {}, { headers });
|
|
196
|
+
if (streamData.tracks && streamData.tracks.length > 0) {
|
|
197
|
+
const newSubs = streamData.tracks.map((sub: any) => ({
|
|
198
|
+
url: sub.file,
|
|
199
|
+
lang: sub.label,
|
|
200
|
+
}));
|
|
201
|
+
|
|
202
|
+
const allSubs = [...subtitles, ...newSubs];
|
|
203
|
+
const uniqueSubs = allSubs.filter(
|
|
204
|
+
(sub, index, self) => index === self.findIndex((s) => s.lang === sub.lang)
|
|
205
|
+
) as ISubtitle[];
|
|
206
|
+
|
|
207
|
+
subtitles = uniqueSubs;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
sources.push({
|
|
211
|
+
url: streamData.url,
|
|
212
|
+
isM3U8: streamData.url.includes('.m3u8'),
|
|
213
|
+
quality: 'default',
|
|
214
|
+
name: server.name,
|
|
215
|
+
});
|
|
216
|
+
} catch (err) {
|
|
217
|
+
// ignore bad ones
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return {
|
|
222
|
+
servers,
|
|
223
|
+
sources,
|
|
224
|
+
subtitles,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
|
|
351
228
|
export async function getMultiServers(id: string): Promise<IEpisodeServer[]> {
|
|
352
229
|
try {
|
|
353
230
|
const servers: IEpisodeServer[] = [];
|
|
354
|
-
const [{ servers:
|
|
355
|
-
|
|
231
|
+
const [{ servers: oneoneoneServers }, { servers: vidsrcServers }] = await Promise.all([
|
|
232
|
+
get111MoviesSourcesAndServers(id),
|
|
356
233
|
getVidsrcSourcesAndServers(id),
|
|
357
234
|
]);
|
|
358
|
-
servers.push(...
|
|
235
|
+
servers.push(...oneoneoneServers, ...vidsrcServers);
|
|
359
236
|
|
|
360
237
|
return servers;
|
|
361
238
|
} catch (error) {
|
|
@@ -365,16 +242,16 @@ export async function getMultiServers(id: string): Promise<IEpisodeServer[]> {
|
|
|
365
242
|
|
|
366
243
|
export async function getMultiSources(id: string, server: string): Promise<ISource> {
|
|
367
244
|
try {
|
|
368
|
-
const [{ servers: _, ...
|
|
369
|
-
|
|
245
|
+
const [{ servers: _, ...oneoneoneSources }, { servers: __, ...vidsrcSources }] = await Promise.all([
|
|
246
|
+
get111MoviesSourcesAndServers(id),
|
|
370
247
|
getVidsrcSourcesAndServers(id),
|
|
371
248
|
]);
|
|
372
249
|
|
|
373
250
|
const allSources = {
|
|
374
|
-
...
|
|
251
|
+
...oneoneoneSources,
|
|
375
252
|
...vidsrcSources,
|
|
376
|
-
sources: [...(
|
|
377
|
-
subtitles: [...(
|
|
253
|
+
sources: [...(oneoneoneSources.sources || []), ...(vidsrcSources.sources || [])],
|
|
254
|
+
subtitles: [...(oneoneoneSources.subtitles || []), ...(vidsrcSources.subtitles || [])],
|
|
378
255
|
};
|
|
379
256
|
|
|
380
257
|
const matchedSources = allSources.sources?.filter((source: IVideo) => source.name === server) || [];
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-new-func */
|
|
2
|
-
|
|
3
1
|
import createProviderContext from './create-provider-context';
|
|
4
2
|
import type { ProviderContext } from '../models/provider-context';
|
|
5
3
|
import { type IAnimeResult, type IMovieResult, type ISearch, type ProviderContextConfig } from '../models';
|
|
@@ -225,6 +223,7 @@ export class ProviderManager {
|
|
|
225
223
|
},
|
|
226
224
|
'URL': this.providerContext.PolyURL,
|
|
227
225
|
'URLSearchParams': this.providerContext.PolyURLSearchParams,
|
|
226
|
+
'NativeConsumet': this.providerContext.NativeConsumet,
|
|
228
227
|
};
|
|
229
228
|
|
|
230
229
|
// Create fetch function using axios
|
|
@@ -3,6 +3,13 @@ import type { ExtractorContext } from '../models';
|
|
|
3
3
|
import { defaultAxios } from './extension-utils';
|
|
4
4
|
import { PolyURL, PolyURLSearchParams } from './url-polyfill';
|
|
5
5
|
import type { ExtractorContextConfig } from '../models/extractor-context';
|
|
6
|
+
import {
|
|
7
|
+
bypassDdosGuard,
|
|
8
|
+
getDdosGuardCookiesWithWebView,
|
|
9
|
+
makeGetRequestWithWebView,
|
|
10
|
+
multiply,
|
|
11
|
+
deobfuscateScript,
|
|
12
|
+
} from '../NativeConsumet';
|
|
6
13
|
|
|
7
14
|
/**
|
|
8
15
|
* Create extractor context for context-aware extractors
|
|
@@ -16,6 +23,13 @@ export function createExtractorContext(config: ExtractorContextConfig = {}): Ext
|
|
|
16
23
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
|
|
17
24
|
PolyURL: PolyURL,
|
|
18
25
|
PolyURLSearchParams: PolyURLSearchParams,
|
|
26
|
+
NativeConsumet: {
|
|
27
|
+
getDdosGuardCookiesWithWebView,
|
|
28
|
+
makeGetRequestWithWebView,
|
|
29
|
+
multiply,
|
|
30
|
+
bypassDdosGuard,
|
|
31
|
+
deobfuscateScript,
|
|
32
|
+
},
|
|
19
33
|
};
|
|
20
34
|
}
|
|
21
35
|
|
|
@@ -16,7 +16,13 @@ import {
|
|
|
16
16
|
|
|
17
17
|
import { defaultAxios, defaultExtractors, defaultExtractorContext } from './extension-utils';
|
|
18
18
|
import { PolyURL, PolyURLSearchParams } from './url-polyfill';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
getDdosGuardCookiesWithWebView,
|
|
21
|
+
makeGetRequestWithWebView,
|
|
22
|
+
multiply,
|
|
23
|
+
bypassDdosGuard,
|
|
24
|
+
deobfuscateScript,
|
|
25
|
+
} from '../NativeConsumet';
|
|
20
26
|
import extensionRegistry from '../extension-registry.json';
|
|
21
27
|
|
|
22
28
|
/**
|
|
@@ -101,6 +107,10 @@ export function createProviderContext(config: ProviderContextConfig = {}): Provi
|
|
|
101
107
|
},
|
|
102
108
|
NativeConsumet: {
|
|
103
109
|
getDdosGuardCookiesWithWebView,
|
|
110
|
+
makeGetRequestWithWebView,
|
|
111
|
+
multiply,
|
|
112
|
+
bypassDdosGuard,
|
|
113
|
+
deobfuscateScript,
|
|
104
114
|
},
|
|
105
115
|
};
|
|
106
116
|
}
|
|
@@ -26,6 +26,13 @@ import { load } from 'cheerio';
|
|
|
26
26
|
import { USER_AGENT } from './utils';
|
|
27
27
|
import type { ExtractorContext } from '../models';
|
|
28
28
|
import { PolyURL, PolyURLSearchParams } from './url-polyfill';
|
|
29
|
+
import {
|
|
30
|
+
getDdosGuardCookiesWithWebView,
|
|
31
|
+
makeGetRequestWithWebView,
|
|
32
|
+
multiply,
|
|
33
|
+
bypassDdosGuard,
|
|
34
|
+
deobfuscateScript,
|
|
35
|
+
} from '../NativeConsumet';
|
|
29
36
|
// Default axios instance with optimized settings for scraping
|
|
30
37
|
export const defaultAxios = axios.create({
|
|
31
38
|
timeout: 15000,
|
|
@@ -46,6 +53,13 @@ export const defaultExtractorContext: ExtractorContext = {
|
|
|
46
53
|
USER_AGENT: USER_AGENT,
|
|
47
54
|
PolyURL: PolyURL,
|
|
48
55
|
PolyURLSearchParams: PolyURLSearchParams,
|
|
56
|
+
NativeConsumet: {
|
|
57
|
+
getDdosGuardCookiesWithWebView,
|
|
58
|
+
makeGetRequestWithWebView,
|
|
59
|
+
multiply,
|
|
60
|
+
bypassDdosGuard,
|
|
61
|
+
deobfuscateScript,
|
|
62
|
+
},
|
|
49
63
|
};
|
|
50
64
|
|
|
51
65
|
// Default static extractors (for backward compatibility)
|