react-native-consumet 1.2.0 → 1.2.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 +8 -0
- package/android/generated/jni/RNConsumetSpec-generated.cpp +12 -0
- package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI-generated.cpp +18 -0
- package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI.h +18 -0
- package/android/src/main/java/com/consumet/ConsumetModule.kt +12 -1
- package/android/src/main/java/com/consumet/DdosGuardModule.kt +1 -132
- package/android/src/main/java/com/consumet/HttpRequestModule.kt +417 -0
- package/ios/generated/RNConsumetSpec/RNConsumetSpec-generated.mm +14 -0
- package/ios/generated/RNConsumetSpec/RNConsumetSpec.h +10 -0
- package/ios/generated/RNConsumetSpecJSI-generated.cpp +18 -0
- package/ios/generated/RNConsumetSpecJSI.h +18 -0
- package/lib/commonjs/NativeConsumet.ts +22 -0
- package/lib/commonjs/extension-registry.json +46 -2
- package/lib/commonjs/extractors/index.js +4 -4
- package/lib/commonjs/extractors/index.js.map +1 -1
- package/lib/commonjs/extractors/megaup.js +14 -5
- package/lib/commonjs/extractors/megaup.js.map +1 -1
- package/lib/commonjs/extractors/{StreamP2P.js → streamp2p.js} +1 -1
- package/lib/commonjs/extractors/{StreamP2P.js.map → streamp2p.js.map} +1 -1
- package/lib/commonjs/extractors/streamwish.js +31 -25
- package/lib/commonjs/extractors/streamwish.js.map +1 -1
- package/lib/commonjs/extractors/vidhide.js +35 -20
- package/lib/commonjs/extractors/vidhide.js.map +1 -1
- package/lib/commonjs/providers/anime/animekai/animekai.js +6 -12
- package/lib/commonjs/providers/anime/animekai/animekai.js.map +1 -1
- package/lib/commonjs/providers/anime/animekai/create-animekai.js +1 -9
- package/lib/commonjs/providers/anime/animekai/create-animekai.js.map +1 -1
- package/lib/commonjs/providers/anime/animepahe/animepahe.js +6 -13
- package/lib/commonjs/providers/anime/animepahe/animepahe.js.map +1 -1
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +1 -10
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/commonjs/providers/anime/zoro/create-zoro.js +1 -10
- package/lib/commonjs/providers/anime/zoro/create-zoro.js.map +1 -1
- package/lib/commonjs/providers/anime/zoro/zoro.js +6 -13
- package/lib/commonjs/providers/anime/zoro/zoro.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/dramacool.js +395 -331
- package/lib/commonjs/providers/movies/dramacool.js.map +1 -1
- package/lib/commonjs/providers/movies/himovies/create-himovies.js +1 -12
- package/lib/commonjs/providers/movies/himovies/create-himovies.js.map +1 -1
- package/lib/commonjs/providers/movies/himovies/himovies.js +6 -16
- package/lib/commonjs/providers/movies/himovies/himovies.js.map +1 -1
- package/lib/commonjs/providers/movies/index.js +10 -4
- package/lib/commonjs/providers/movies/index.js.map +1 -1
- package/lib/{module/providers/movies/multimovies.js → commonjs/providers/movies/multimovies/create-multimovies.js} +183 -149
- package/lib/commonjs/providers/movies/multimovies/create-multimovies.js.map +1 -0
- package/lib/commonjs/providers/movies/multimovies/multimovies.js +46 -0
- package/lib/commonjs/providers/movies/multimovies/multimovies.js.map +1 -0
- package/lib/commonjs/providers/movies/yflix/create-yflix.js +418 -0
- package/lib/commonjs/providers/movies/yflix/create-yflix.js.map +1 -0
- package/lib/commonjs/providers/movies/yflix/yflix.js +59 -0
- package/lib/commonjs/providers/movies/yflix/yflix.js.map +1 -0
- package/lib/commonjs/providers/movies/yflix.js +561 -0
- package/lib/commonjs/providers/movies/yflix.js.map +1 -0
- package/lib/commonjs/utils/create-extractor-context.js +2 -0
- package/lib/commonjs/utils/create-extractor-context.js.map +1 -1
- package/lib/commonjs/utils/create-provider-context.js +2 -0
- package/lib/commonjs/utils/create-provider-context.js.map +1 -1
- package/lib/commonjs/utils/extension-utils.js +4 -2
- package/lib/commonjs/utils/extension-utils.js.map +1 -1
- package/lib/commonjs/utils/provider-maps.js +4 -1
- package/lib/commonjs/utils/provider-maps.js.map +1 -1
- package/lib/module/NativeConsumet.ts +22 -0
- package/lib/module/extension-registry.json +46 -2
- package/lib/module/extractors/index.js +2 -2
- package/lib/module/extractors/index.js.map +1 -1
- package/lib/module/extractors/megaup.js +14 -5
- package/lib/module/extractors/megaup.js.map +1 -1
- package/lib/module/extractors/{StreamP2P.js → streamp2p.js} +1 -1
- package/lib/module/extractors/{StreamP2P.js.map → streamp2p.js.map} +1 -1
- package/lib/module/extractors/streamwish.js +28 -21
- package/lib/module/extractors/streamwish.js.map +1 -1
- package/lib/module/extractors/vidhide.js +33 -17
- package/lib/module/extractors/vidhide.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/providers/anime/animekai/animekai.js +6 -12
- package/lib/module/providers/anime/animekai/animekai.js.map +1 -1
- package/lib/module/providers/anime/animekai/create-animekai.js +1 -9
- package/lib/module/providers/anime/animekai/create-animekai.js.map +1 -1
- package/lib/module/providers/anime/animepahe/animepahe.js +6 -13
- package/lib/module/providers/anime/animepahe/animepahe.js.map +1 -1
- package/lib/module/providers/anime/animepahe/create-animepahe.js +1 -10
- package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/module/providers/anime/zoro/create-zoro.js +1 -10
- package/lib/module/providers/anime/zoro/create-zoro.js.map +1 -1
- package/lib/module/providers/anime/zoro/zoro.js +6 -13
- package/lib/module/providers/anime/zoro/zoro.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/dramacool.js +395 -327
- package/lib/module/providers/movies/dramacool.js.map +1 -1
- package/lib/module/providers/movies/himovies/create-himovies.js +1 -11
- package/lib/module/providers/movies/himovies/create-himovies.js.map +1 -1
- package/lib/module/providers/movies/himovies/himovies.js +6 -16
- package/lib/module/providers/movies/himovies/himovies.js.map +1 -1
- package/lib/module/providers/movies/index.js +10 -4
- package/lib/module/providers/movies/index.js.map +1 -1
- package/lib/{commonjs/providers/movies/multimovies.js → module/providers/movies/multimovies/create-multimovies.js} +187 -161
- package/lib/module/providers/movies/multimovies/create-multimovies.js.map +1 -0
- package/lib/module/providers/movies/multimovies/multimovies.js +43 -0
- package/lib/module/providers/movies/multimovies/multimovies.js.map +1 -0
- package/lib/module/providers/movies/yflix/create-yflix.js +414 -0
- package/lib/module/providers/movies/yflix/create-yflix.js.map +1 -0
- package/lib/module/providers/movies/yflix/yflix.js +55 -0
- package/lib/module/providers/movies/yflix/yflix.js.map +1 -0
- package/lib/module/providers/movies/yflix.js +561 -0
- package/lib/module/providers/movies/yflix.js.map +1 -0
- package/lib/module/utils/create-extractor-context.js +3 -1
- package/lib/module/utils/create-extractor-context.js.map +1 -1
- package/lib/module/utils/create-provider-context.js +3 -1
- package/lib/module/utils/create-provider-context.js.map +1 -1
- package/lib/module/utils/extension-utils.js +5 -3
- package/lib/module/utils/extension-utils.js.map +1 -1
- package/lib/module/utils/provider-maps.js +4 -1
- package/lib/module/utils/provider-maps.js.map +1 -1
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts +36 -0
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/index.d.ts +2 -2
- package/lib/typescript/commonjs/src/extractors/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/megaup.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/{StreamP2P.d.ts → streamp2p.d.ts} +1 -1
- package/lib/typescript/commonjs/src/extractors/{StreamP2P.d.ts.map → streamp2p.d.ts.map} +1 -1
- package/lib/typescript/commonjs/src/extractors/streamwish.d.ts +7 -11
- package/lib/typescript/commonjs/src/extractors/streamwish.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/vidhide.d.ts +7 -7
- package/lib/typescript/commonjs/src/extractors/vidhide.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 +3 -1
- package/lib/typescript/commonjs/src/models/extractor-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/provider-context.d.ts +7 -5
- package/lib/typescript/commonjs/src/models/provider-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animekai/animekai.d.ts +6 -4
- package/lib/typescript/commonjs/src/providers/anime/animekai/animekai.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animekai/create-animekai.d.ts +8 -4
- package/lib/typescript/commonjs/src/providers/anime/animekai/create-animekai.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animepahe/animepahe.d.ts +6 -4
- package/lib/typescript/commonjs/src/providers/anime/animepahe/animepahe.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts +8 -4
- package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts +8 -4
- package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/zoro/zoro.d.ts +6 -4
- package/lib/typescript/commonjs/src/providers/anime/zoro/zoro.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/dramacool.d.ts +0 -21
- package/lib/typescript/commonjs/src/providers/movies/dramacool.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/himovies/create-himovies.d.ts +8 -5
- package/lib/typescript/commonjs/src/providers/movies/himovies/create-himovies.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/himovies/himovies.d.ts +6 -5
- package/lib/typescript/commonjs/src/providers/movies/himovies/himovies.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/index.d.ts +7 -3
- 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 +20 -0
- package/lib/typescript/commonjs/src/providers/movies/multimovies/create-multimovies.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/multimovies/multimovies.d.ts +21 -0
- package/lib/typescript/commonjs/src/providers/movies/multimovies/multimovies.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/yflix/create-yflix.d.ts +25 -0
- package/lib/typescript/commonjs/src/providers/movies/yflix/create-yflix.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/yflix/yflix.d.ts +44 -0
- package/lib/typescript/commonjs/src/providers/movies/yflix/yflix.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/yflix.d.ts +1 -0
- package/lib/typescript/commonjs/src/providers/movies/yflix.d.ts.map +1 -0
- 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 +4 -4
- package/lib/typescript/commonjs/src/utils/extension-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/provider-maps.d.ts +1 -0
- package/lib/typescript/commonjs/src/utils/provider-maps.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeConsumet.d.ts +36 -0
- package/lib/typescript/module/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/index.d.ts +2 -2
- package/lib/typescript/module/src/extractors/index.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/megaup.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/{StreamP2P.d.ts → streamp2p.d.ts} +1 -1
- package/lib/typescript/module/src/extractors/{StreamP2P.d.ts.map → streamp2p.d.ts.map} +1 -1
- package/lib/typescript/module/src/extractors/streamwish.d.ts +7 -11
- package/lib/typescript/module/src/extractors/streamwish.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/vidhide.d.ts +7 -7
- package/lib/typescript/module/src/extractors/vidhide.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 +3 -1
- package/lib/typescript/module/src/models/extractor-context.d.ts.map +1 -1
- package/lib/typescript/module/src/models/provider-context.d.ts +7 -5
- package/lib/typescript/module/src/models/provider-context.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animekai/animekai.d.ts +6 -4
- package/lib/typescript/module/src/providers/anime/animekai/animekai.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animekai/create-animekai.d.ts +8 -4
- package/lib/typescript/module/src/providers/anime/animekai/create-animekai.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animepahe/animepahe.d.ts +6 -4
- package/lib/typescript/module/src/providers/anime/animepahe/animepahe.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts +8 -4
- package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts +8 -4
- package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/zoro/zoro.d.ts +6 -4
- package/lib/typescript/module/src/providers/anime/zoro/zoro.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/dramacool.d.ts +0 -21
- package/lib/typescript/module/src/providers/movies/dramacool.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/himovies/create-himovies.d.ts +8 -5
- package/lib/typescript/module/src/providers/movies/himovies/create-himovies.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/himovies/himovies.d.ts +6 -5
- package/lib/typescript/module/src/providers/movies/himovies/himovies.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/index.d.ts +7 -3
- 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 +20 -0
- package/lib/typescript/module/src/providers/movies/multimovies/create-multimovies.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/multimovies/multimovies.d.ts +21 -0
- package/lib/typescript/module/src/providers/movies/multimovies/multimovies.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/yflix/create-yflix.d.ts +25 -0
- package/lib/typescript/module/src/providers/movies/yflix/create-yflix.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/yflix/yflix.d.ts +44 -0
- package/lib/typescript/module/src/providers/movies/yflix/yflix.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/yflix.d.ts +1 -0
- package/lib/typescript/module/src/providers/movies/yflix.d.ts.map +1 -0
- 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 +4 -4
- package/lib/typescript/module/src/utils/extension-utils.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/provider-maps.d.ts +1 -0
- package/lib/typescript/module/src/utils/provider-maps.d.ts.map +1 -1
- package/package.json +17 -6
- package/src/NativeConsumet.ts +22 -0
- package/src/extension-registry.json +46 -2
- package/src/extractors/index.ts +2 -2
- package/src/extractors/megaup.ts +27 -10
- package/src/extractors/streamwish.ts +36 -27
- package/src/extractors/vidhide.ts +42 -23
- package/src/index.tsx +2 -2
- package/src/models/extractor-context.ts +4 -0
- package/src/models/provider-context.ts +8 -10
- package/src/providers/anime/animekai/animekai.ts +14 -14
- package/src/providers/anime/animekai/create-animekai.ts +1 -10
- package/src/providers/anime/animepahe/animepahe.ts +14 -14
- package/src/providers/anime/animepahe/create-animepahe.ts +1 -11
- package/src/providers/anime/zoro/create-zoro.ts +1 -11
- package/src/providers/anime/zoro/zoro.ts +14 -14
- package/src/providers/meta/tmdb.ts +1 -2
- package/src/providers/movies/dramacool.ts +395 -394
- package/src/providers/movies/himovies/create-himovies.ts +1 -12
- package/src/providers/movies/himovies/himovies.ts +14 -17
- package/src/providers/movies/index.ts +9 -3
- package/src/providers/movies/{multimovies.ts → multimovies/create-multimovies.ts} +520 -495
- package/src/providers/movies/multimovies/multimovies.ts +57 -0
- package/src/providers/movies/yflix/create-yflix.ts +496 -0
- package/src/providers/movies/yflix/yflix.ts +82 -0
- package/src/providers/movies/yflix.ts +559 -0
- package/src/utils/create-extractor-context.ts +4 -0
- package/src/utils/create-provider-context.ts +4 -0
- package/src/utils/extension-utils.ts +6 -2
- package/src/utils/provider-maps.ts +4 -1
- package/lib/commonjs/providers/movies/multimovies.js.map +0 -1
- package/lib/module/providers/movies/multimovies.js.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/multimovies.d.ts +0 -40
- package/lib/typescript/commonjs/src/providers/movies/multimovies.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/multimovies.d.ts +0 -40
- package/lib/typescript/module/src/providers/movies/multimovies.d.ts.map +0 -1
- /package/src/extractors/{StreamP2P.ts → streamp2p.ts} +0 -0
|
@@ -1,495 +1,520 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
mediaId
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
$('
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
movieInfo.
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
movieInfo.
|
|
162
|
-
$('
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
return {
|
|
239
|
-
headers: { Referer:
|
|
240
|
-
|
|
241
|
-
download:
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
.
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
1
|
+
import {
|
|
2
|
+
type IMovieInfo,
|
|
3
|
+
type IEpisodeServer,
|
|
4
|
+
type StreamingServers,
|
|
5
|
+
type ISource,
|
|
6
|
+
type IMovieResult,
|
|
7
|
+
type ISearch,
|
|
8
|
+
type ProviderContext,
|
|
9
|
+
type ProviderConfig,
|
|
10
|
+
} from '../../../models';
|
|
11
|
+
|
|
12
|
+
export function createMultiMovies(ctx: ProviderContext, customBaseURL?: string) {
|
|
13
|
+
const { load, extractors, enums, axios, createCustomBaseUrl, PolyURL, USER_AGENT, NativeConsumet } = ctx;
|
|
14
|
+
const { StreamWish, VidHide } = extractors;
|
|
15
|
+
const { StreamingServers: StreamingServersEnum, TvType: TvTypeEnum } = enums;
|
|
16
|
+
const { makePostRequest } = NativeConsumet;
|
|
17
|
+
|
|
18
|
+
const baseUrl = createCustomBaseUrl('https://multimovies.center', customBaseURL);
|
|
19
|
+
|
|
20
|
+
const config: ProviderConfig = {
|
|
21
|
+
name: 'MultiMovies',
|
|
22
|
+
languages: 'all',
|
|
23
|
+
classPath: 'MOVIES.MultiMovies',
|
|
24
|
+
logo: `${baseUrl}/wp-content/uploads/2024/01/cropped-CompressJPEG.online_512x512_image.png`,
|
|
25
|
+
baseUrl,
|
|
26
|
+
isNSFW: false,
|
|
27
|
+
isWorking: true,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const supportedTypes = new Set([TvTypeEnum.MOVIE, TvTypeEnum.TVSERIES]);
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Search for movies/TV shows
|
|
34
|
+
* @param query search query string
|
|
35
|
+
* @param page page number (default 1) (optional)
|
|
36
|
+
*/
|
|
37
|
+
const search = async (query: string, page: number = 1): Promise<ISearch<IMovieResult>> => {
|
|
38
|
+
const searchResult: ISearch<IMovieResult> = {
|
|
39
|
+
currentPage: page,
|
|
40
|
+
hasNextPage: false,
|
|
41
|
+
results: [],
|
|
42
|
+
};
|
|
43
|
+
try {
|
|
44
|
+
let url;
|
|
45
|
+
if (page === 1) {
|
|
46
|
+
url = `${config.baseUrl}/?s=${query.replace(/[\W_]+/g, '+')}`;
|
|
47
|
+
} else {
|
|
48
|
+
url = `${config.baseUrl}/page/${page}/?s=${query.replace(/[\W_]+/g, '+')}`;
|
|
49
|
+
}
|
|
50
|
+
const { data } = await axios.get(url);
|
|
51
|
+
const $ = load(data);
|
|
52
|
+
|
|
53
|
+
const navSelector = 'div.pagination';
|
|
54
|
+
searchResult.hasNextPage = $(navSelector).find('#nextpagination').length > 0;
|
|
55
|
+
const articles = $('.search-page .result-item article').toArray();
|
|
56
|
+
|
|
57
|
+
await Promise.all(
|
|
58
|
+
articles.map(async (el) => {
|
|
59
|
+
const seasonSet = new Set<number>();
|
|
60
|
+
|
|
61
|
+
const href =
|
|
62
|
+
$(el)
|
|
63
|
+
.find('.thumbnail a')
|
|
64
|
+
.attr('href')
|
|
65
|
+
?.replace(/^https?:\/\/[^/]+\//, '')
|
|
66
|
+
.replace(/^\/|\/$/g, '') ?? '';
|
|
67
|
+
|
|
68
|
+
const episodesInfo = await fetchMediaInfo(href);
|
|
69
|
+
const episodes = episodesInfo?.episodes || [];
|
|
70
|
+
|
|
71
|
+
for (const episode of episodes) {
|
|
72
|
+
if (episode.season != null) {
|
|
73
|
+
seasonSet.add(episode.season);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
searchResult.results.push({
|
|
77
|
+
id: href,
|
|
78
|
+
title: $(el).find('.details .title a').text().trim(),
|
|
79
|
+
url: $(el).find('.thumbnail a').attr('href') ?? '',
|
|
80
|
+
image: $(el).find('.thumbnail img').attr('src') ?? '',
|
|
81
|
+
rating: parseFloat($(el).find('.meta .rating').text().replace('IMDb ', '')) || 0,
|
|
82
|
+
releaseDate: $(el).find('.meta .year').text().trim(),
|
|
83
|
+
seasons: seasonSet.size,
|
|
84
|
+
description: $(el).find('.contenido p').text().trim(),
|
|
85
|
+
type: $(el).find('.thumbnail a').attr('href')?.includes('/movies/')
|
|
86
|
+
? TvTypeEnum.MOVIE
|
|
87
|
+
: TvTypeEnum.TVSERIES,
|
|
88
|
+
});
|
|
89
|
+
})
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
return searchResult;
|
|
93
|
+
} catch (err) {
|
|
94
|
+
throw new Error((err as Error).message);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Fetch media information
|
|
100
|
+
* @param mediaId media link or id
|
|
101
|
+
*/
|
|
102
|
+
const fetchMediaInfo = async (mediaId: string): Promise<IMovieInfo> => {
|
|
103
|
+
if (!mediaId.startsWith(config.baseUrl)) {
|
|
104
|
+
mediaId = `${config.baseUrl}/${mediaId}`;
|
|
105
|
+
}
|
|
106
|
+
const movieInfo: IMovieInfo = {
|
|
107
|
+
id: mediaId.replace(/^https?:\/\/[^/]+\//, '').replace(/^\/|\/$/g, '')!,
|
|
108
|
+
title: '',
|
|
109
|
+
url: mediaId,
|
|
110
|
+
};
|
|
111
|
+
try {
|
|
112
|
+
const { data } = await axios.get(mediaId);
|
|
113
|
+
const $ = load(data);
|
|
114
|
+
const recommendationsArray: IMovieResult[] = [];
|
|
115
|
+
|
|
116
|
+
$('div#single_relacionados article').each((i, el) => {
|
|
117
|
+
recommendationsArray.push({
|
|
118
|
+
id: $(el)
|
|
119
|
+
.find('a')
|
|
120
|
+
.attr('href')
|
|
121
|
+
?.replace(/^https?:\/\/[^/]+\//, '')
|
|
122
|
+
.replace(/^\/|\/$/g, '')!,
|
|
123
|
+
title: $(el).find('a img').attr('alt')!,
|
|
124
|
+
image: $(el).find('a img').attr('data-src') ?? $(el).find('a img').attr('src'),
|
|
125
|
+
type: $(el).find('.thumbnail a').attr('href')?.includes('/movies/')
|
|
126
|
+
? TvTypeEnum.TVSERIES
|
|
127
|
+
: (TvTypeEnum.MOVIE ?? null),
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
movieInfo.cover = $('div#info .galeria').first().find('.g-item a').attr('href')?.trim() ?? '';
|
|
131
|
+
movieInfo.title = $('.sheader > .data > h1').text();
|
|
132
|
+
movieInfo.image = $('.sheader > .poster > img').attr('src') ?? $('.sheader > .poster > img').attr('data-src');
|
|
133
|
+
movieInfo.description = $('div#info div[itemprop="description"] p').text();
|
|
134
|
+
movieInfo.type = movieInfo.id.split('/')[0] === 'tvshows' ? TvTypeEnum.TVSERIES : TvTypeEnum.MOVIE;
|
|
135
|
+
movieInfo.releaseDate = $('.sheader > .data > .extra > span.date').text().trim();
|
|
136
|
+
movieInfo.trailer = {
|
|
137
|
+
id:
|
|
138
|
+
$('div#trailer .embed iframe').attr('data-litespeed-src')?.split('embed/')[1]?.split('?')[0] ??
|
|
139
|
+
$('div#trailer .embed iframe').attr('src')?.split('embed/')[1]?.split('?')[0]!,
|
|
140
|
+
url: $('div#trailer .embed iframe').attr('data-litespeed-src') ?? $('div#trailer .embed iframe').attr('src'),
|
|
141
|
+
};
|
|
142
|
+
movieInfo.genres = $('.sgeneros a')
|
|
143
|
+
.map((i, el) => $(el).text())
|
|
144
|
+
.get()
|
|
145
|
+
.map((v) => v.trim());
|
|
146
|
+
movieInfo.characters = [];
|
|
147
|
+
$('div#cast .persons .person').each((i, el) => {
|
|
148
|
+
const url = $(el).find('.img > a').attr('href');
|
|
149
|
+
const image = $(el).find('.img > a > img').attr('data-src') ?? $(el).find('.img > a > img').attr('src');
|
|
150
|
+
const name = $(el).find('.data > .name > a').text();
|
|
151
|
+
const character = $(el).find('.data > .caracter').text();
|
|
152
|
+
|
|
153
|
+
(movieInfo.characters as any[]).push({
|
|
154
|
+
url,
|
|
155
|
+
image,
|
|
156
|
+
name,
|
|
157
|
+
character,
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
movieInfo.country = $('.sheader > .data > .extra > span.country').text();
|
|
161
|
+
movieInfo.duration = $('.sheader > .data > .extra > span.runtime').text();
|
|
162
|
+
movieInfo.rating = parseFloat($('.starstruck-rating span.dt_rating_vgs[itemprop="ratingValue"]').text());
|
|
163
|
+
movieInfo.recommendations = recommendationsArray as any;
|
|
164
|
+
|
|
165
|
+
if (movieInfo.type === TvTypeEnum.TVSERIES) {
|
|
166
|
+
movieInfo.episodes = [];
|
|
167
|
+
$('#seasons .se-c').each((i, el) => {
|
|
168
|
+
const seasonNumber = parseInt($(el).find('.se-t').text().trim());
|
|
169
|
+
$(el)
|
|
170
|
+
.find('.episodios li')
|
|
171
|
+
.each((j, ep) => {
|
|
172
|
+
const episode = {
|
|
173
|
+
id: $(ep)
|
|
174
|
+
.find('.episodiotitle a')
|
|
175
|
+
.attr('href')
|
|
176
|
+
?.replace(/^https?:\/\/[^/]+\//, '')
|
|
177
|
+
.replace(/^\/|\/$/g, '')!,
|
|
178
|
+
season: seasonNumber,
|
|
179
|
+
number: parseInt($(ep).find('.numerando').text().trim().split('-')[1]!),
|
|
180
|
+
title: $(ep).find('.episodiotitle a').text().trim(),
|
|
181
|
+
url: $(ep).find('.episodiotitle a').attr('href')?.trim() ?? '',
|
|
182
|
+
releaseDate: String(new Date($(ep).find('.episodiotitle .date').text().trim()).getFullYear()),
|
|
183
|
+
image:
|
|
184
|
+
$(ep).find('.imagen img').attr('data-src')?.trim() ?? $(ep).find('.imagen img').attr('src')?.trim(),
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
movieInfo.episodes?.push(episode);
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
} else {
|
|
191
|
+
movieInfo.episodes = [
|
|
192
|
+
{
|
|
193
|
+
id: movieInfo.id,
|
|
194
|
+
title: movieInfo.title,
|
|
195
|
+
url: movieInfo.url,
|
|
196
|
+
image: movieInfo.cover || movieInfo.image,
|
|
197
|
+
},
|
|
198
|
+
];
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return movieInfo;
|
|
202
|
+
} catch (err) {
|
|
203
|
+
throw new Error((err as Error).message);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Fetch episode sources
|
|
209
|
+
* @param episodeId episode id
|
|
210
|
+
* @param mediaId media id
|
|
211
|
+
* @param server server type (default `StreamWish`) (optional)
|
|
212
|
+
*/
|
|
213
|
+
const fetchEpisodeSources = async (
|
|
214
|
+
episodeId: string,
|
|
215
|
+
mediaId?: string,
|
|
216
|
+
server: StreamingServers = StreamingServersEnum.StreamWish,
|
|
217
|
+
fileId?: string
|
|
218
|
+
): Promise<ISource> => {
|
|
219
|
+
if (episodeId.startsWith('http')) {
|
|
220
|
+
const serverUrl = new PolyURL(episodeId);
|
|
221
|
+
const referer = serverUrl.origin;
|
|
222
|
+
const downloadUrl = fileId ? `${serverUrl.href.toString().replace('/e/', '/f/')}/${fileId}` : '';
|
|
223
|
+
|
|
224
|
+
switch (server) {
|
|
225
|
+
case StreamingServersEnum.StreamWish:
|
|
226
|
+
return {
|
|
227
|
+
headers: { Referer: referer },
|
|
228
|
+
...(await StreamWish().extract(serverUrl, referer)),
|
|
229
|
+
download: downloadUrl,
|
|
230
|
+
};
|
|
231
|
+
case StreamingServersEnum.VidHide:
|
|
232
|
+
return {
|
|
233
|
+
headers: { Referer: referer },
|
|
234
|
+
...(await VidHide().extract(serverUrl)),
|
|
235
|
+
download: fileId ? `https://gdmirrorbot.nl/file/${fileId}` : '',
|
|
236
|
+
};
|
|
237
|
+
default:
|
|
238
|
+
return {
|
|
239
|
+
headers: { Referer: referer },
|
|
240
|
+
...(await StreamWish().extract(serverUrl, referer)),
|
|
241
|
+
download: downloadUrl,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
try {
|
|
247
|
+
const servers = await fetchEpisodeServers(episodeId, episodeId);
|
|
248
|
+
const i = servers.findIndex((s) => s.name.toLowerCase() === server.toLowerCase());
|
|
249
|
+
if (i === -1) {
|
|
250
|
+
throw new Error(`Server ${server} not found`);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
const serverUrl: URL = new URL(servers[i]!.url);
|
|
254
|
+
let fId = '';
|
|
255
|
+
|
|
256
|
+
if (!episodeId.startsWith('http')) {
|
|
257
|
+
const { fileId: id } = await getServer(`${config.baseUrl}/${episodeId}`);
|
|
258
|
+
fId = id ?? '';
|
|
259
|
+
}
|
|
260
|
+
// fileId to be used for download link
|
|
261
|
+
return await fetchEpisodeSources(serverUrl.href, mediaId, server, fId);
|
|
262
|
+
} catch (err) {
|
|
263
|
+
throw new Error((err as Error).message);
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Fetch episode servers
|
|
269
|
+
* @param episodeId takes episode link or movie id
|
|
270
|
+
* @param mediaId takes movie link or id (found on movie info object, this is just a placeholder for compatibility)
|
|
271
|
+
*/
|
|
272
|
+
const fetchEpisodeServers = async (episodeId: string, mediaId: string): Promise<IEpisodeServer[]> => {
|
|
273
|
+
if (!episodeId.startsWith(config.baseUrl)) {
|
|
274
|
+
episodeId = `${config.baseUrl}/${episodeId}`;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
try {
|
|
278
|
+
const { servers } = await getServer(episodeId);
|
|
279
|
+
return servers;
|
|
280
|
+
} catch (err) {
|
|
281
|
+
throw new Error((err as Error).message);
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Fetch popular movies
|
|
287
|
+
* @param page page number (default 1)
|
|
288
|
+
*/
|
|
289
|
+
const fetchPopular = async (page: number = 1): Promise<ISearch<IMovieResult>> => {
|
|
290
|
+
const result: ISearch<IMovieResult> = {
|
|
291
|
+
currentPage: page,
|
|
292
|
+
hasNextPage: false,
|
|
293
|
+
results: [],
|
|
294
|
+
};
|
|
295
|
+
try {
|
|
296
|
+
const { data } = await axios.get(`${config.baseUrl}/trending/page/${page}/`);
|
|
297
|
+
const $ = load(data);
|
|
298
|
+
const navSelector = 'div.pagination';
|
|
299
|
+
|
|
300
|
+
result.hasNextPage = $(navSelector).find('#nextpagination').length > 0;
|
|
301
|
+
$('.items > article')
|
|
302
|
+
.each((i, el) => {
|
|
303
|
+
const resultItem: IMovieResult = {
|
|
304
|
+
id: $(el).attr('id')!,
|
|
305
|
+
title: $(el).find('div.data > h3').text() ?? '',
|
|
306
|
+
url: $(el).find('div.poster > a').attr('href'),
|
|
307
|
+
image: $(el).find('div.poster > img').attr('data-src') ?? '',
|
|
308
|
+
type: $(el).find('div.poster > a').attr('href')?.includes('/movies/')
|
|
309
|
+
? TvTypeEnum.MOVIE
|
|
310
|
+
: TvTypeEnum.TVSERIES,
|
|
311
|
+
rating: $(el).find('div.poster > div.rating').text() ?? '',
|
|
312
|
+
releaseDate: $(el).find('div.data > span').text() ?? '',
|
|
313
|
+
};
|
|
314
|
+
result.results.push(resultItem);
|
|
315
|
+
})
|
|
316
|
+
.get();
|
|
317
|
+
|
|
318
|
+
return result;
|
|
319
|
+
} catch (err) {
|
|
320
|
+
throw new Error((err as Error).message);
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Fetch by genre
|
|
326
|
+
* @param genre genre name
|
|
327
|
+
* @param page page number (default 1)
|
|
328
|
+
*/
|
|
329
|
+
const fetchByGenre = async (genre: string, page: number = 1): Promise<ISearch<IMovieResult>> => {
|
|
330
|
+
const result: ISearch<IMovieResult> = {
|
|
331
|
+
currentPage: page,
|
|
332
|
+
hasNextPage: false,
|
|
333
|
+
results: [],
|
|
334
|
+
};
|
|
335
|
+
try {
|
|
336
|
+
const { data } = await axios.get(`${config.baseUrl}/genre/${genre}/page/${page}`);
|
|
337
|
+
|
|
338
|
+
const $ = load(data);
|
|
339
|
+
const navSelector = 'div.pagination';
|
|
340
|
+
|
|
341
|
+
result.hasNextPage = $(navSelector).find('#nextpagination').length > 0;
|
|
342
|
+
$('.items > article')
|
|
343
|
+
.each((i, el) => {
|
|
344
|
+
const resultItem: IMovieResult = {
|
|
345
|
+
id: $(el).attr('id')!,
|
|
346
|
+
title: $(el).find('div.data > h3').text() ?? '',
|
|
347
|
+
url: $(el).find('div.poster > a').attr('href'),
|
|
348
|
+
image: $(el).find('div.poster > img').attr('data-src') ?? '',
|
|
349
|
+
type: $(el).find('div.poster > a').attr('href')?.includes('/movies/')
|
|
350
|
+
? TvTypeEnum.MOVIE
|
|
351
|
+
: TvTypeEnum.TVSERIES,
|
|
352
|
+
rating: $(el).find('div.poster > div.rating').text() ?? '',
|
|
353
|
+
releaseDate: $(el).find('div.data > span').text() ?? '',
|
|
354
|
+
};
|
|
355
|
+
result.results.push(resultItem);
|
|
356
|
+
})
|
|
357
|
+
.get();
|
|
358
|
+
|
|
359
|
+
return result;
|
|
360
|
+
} catch (err) {
|
|
361
|
+
throw new Error((err as Error).message);
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Get server information
|
|
367
|
+
* @param url episode url
|
|
368
|
+
*/
|
|
369
|
+
const getServer = async (url: string): Promise<{ servers: IEpisodeServer[]; fileId: string }> => {
|
|
370
|
+
try {
|
|
371
|
+
const { data } = await axios.get(url);
|
|
372
|
+
const $ = load(data);
|
|
373
|
+
// Extract player config
|
|
374
|
+
const playerConfig = {
|
|
375
|
+
postId: $('#player-option-1').attr('data-post'),
|
|
376
|
+
nume: $('#player-option-1').attr('data-nume'),
|
|
377
|
+
type: $('#player-option-1').attr('data-type'),
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
if (!playerConfig.postId || !playerConfig.nume || !playerConfig.type) {
|
|
381
|
+
throw new Error('Missing player configuration');
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
const formData = new FormData();
|
|
385
|
+
formData.append('action', 'doo_player_ajax');
|
|
386
|
+
formData.append('post', playerConfig.postId);
|
|
387
|
+
formData.append('nume', playerConfig.nume);
|
|
388
|
+
formData.append('type', playerConfig.type);
|
|
389
|
+
|
|
390
|
+
const headers = {
|
|
391
|
+
'User-Agent': USER_AGENT,
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
// const { data: playerRes } = await axios.post(`${baseUrl}/wp-admin/admin-ajax.php`, formData, {
|
|
395
|
+
// headers,
|
|
396
|
+
// });
|
|
397
|
+
console.log(`${baseUrl}/wp-admin/admin-ajax.php`);
|
|
398
|
+
const res = await fetch(`${baseUrl}/wp-admin/admin-ajax.php`, {
|
|
399
|
+
method: 'POST',
|
|
400
|
+
headers: {
|
|
401
|
+
...headers,
|
|
402
|
+
//'Content-Type':'multipart/form-data',
|
|
403
|
+
},
|
|
404
|
+
body: formData as any,
|
|
405
|
+
});
|
|
406
|
+
const postTestOkHttp = await makePostRequest(
|
|
407
|
+
`${baseUrl}/wp-admin/admin-ajax.php`,
|
|
408
|
+
{
|
|
409
|
+
...headers,
|
|
410
|
+
//'Content-Type':'multipart/form-data',
|
|
411
|
+
},
|
|
412
|
+
formData as any
|
|
413
|
+
);
|
|
414
|
+
console.timeEnd('POST Request - OkHttp');
|
|
415
|
+
console.log('POST Response (OkHttp):', {
|
|
416
|
+
statusCode: postTestOkHttp.statusCode,
|
|
417
|
+
body: postTestOkHttp.body, // Full response body
|
|
418
|
+
headers: postTestOkHttp.headers,
|
|
419
|
+
});
|
|
420
|
+
const playerRes = await res.json();
|
|
421
|
+
console.log({ playerRes });
|
|
422
|
+
const iframeUrl = playerRes.embed_url?.match(/<iframe[^>]+src="([^"]+)"[^>]*>/i)?.[1] || playerRes.embed_url;
|
|
423
|
+
|
|
424
|
+
// Handle non-multimovies case
|
|
425
|
+
if (!iframeUrl.includes('multimovies')) {
|
|
426
|
+
if (iframeUrl.includes('dhcplay')) {
|
|
427
|
+
return {
|
|
428
|
+
servers: [{ name: 'StreamWish', url: iframeUrl }],
|
|
429
|
+
fileId: iframeUrl.split('/').pop() ?? '',
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
// let playerBaseUrl = iframeUrl.split('/').slice(0, 3).join('/');
|
|
433
|
+
// const redirectResponse = await axios.head(playerBaseUrl, {
|
|
434
|
+
// headers: headers,
|
|
435
|
+
// maxRedirects: 5,
|
|
436
|
+
// validateStatus: () => true,
|
|
437
|
+
// });
|
|
438
|
+
// const redirectResponse = await fetch(playerBaseUrl, {
|
|
439
|
+
// method: 'HEAD',
|
|
440
|
+
// headers: headers,
|
|
441
|
+
// redirect: 'follow',
|
|
442
|
+
// });
|
|
443
|
+
|
|
444
|
+
// const isRedirected = redirectResponse.request._redirectable._isRedirect ? redirectResponse : null;
|
|
445
|
+
// const finalResponse = true ? redirectResponse : null;
|
|
446
|
+
|
|
447
|
+
// // Update base URL if redirect occurred
|
|
448
|
+
// if (finalResponse) {
|
|
449
|
+
// playerBaseUrl = finalResponse?.url;
|
|
450
|
+
// }
|
|
451
|
+
|
|
452
|
+
const fileId = iframeUrl.split('/').pop();
|
|
453
|
+
if (!fileId) {
|
|
454
|
+
throw new Error('No player ID found');
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
const streamRequestData = new FormData();
|
|
458
|
+
streamRequestData.append('sid', fileId);
|
|
459
|
+
|
|
460
|
+
// const streamResponse = await axios.post(`https://pro.gtxgamer.site/embedhelper.php`, streamRequestData, {
|
|
461
|
+
// headers,
|
|
462
|
+
// });
|
|
463
|
+
const streamRes = await fetch(`https://pro.gtxgamer.site/embedhelper.php`, {
|
|
464
|
+
method: 'POST',
|
|
465
|
+
headers: {
|
|
466
|
+
...headers,
|
|
467
|
+
// 'Content-Type':'multipart/form-data',
|
|
468
|
+
},
|
|
469
|
+
body: streamRequestData as any,
|
|
470
|
+
});
|
|
471
|
+
const streamResponse = await streamRes.json();
|
|
472
|
+
if (!streamResponse) {
|
|
473
|
+
throw new Error('No stream data found');
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
// Decode and parse mresult
|
|
477
|
+
const decodedMresult = JSON.parse(atob(streamResponse.mresult));
|
|
478
|
+
const mresultKeys = Object.keys(decodedMresult);
|
|
479
|
+
// Find common keys
|
|
480
|
+
const commonKeys = mresultKeys.filter((key) => streamResponse.siteUrls.hasOwnProperty(key));
|
|
481
|
+
|
|
482
|
+
// Convert to a Set (if needed)
|
|
483
|
+
const commonStreamSites = new Set(commonKeys);
|
|
484
|
+
const servers = Array.from(commonStreamSites).map((site) => {
|
|
485
|
+
return {
|
|
486
|
+
name:
|
|
487
|
+
streamResponse.siteFriendlyNames[site] === 'StreamHG'
|
|
488
|
+
? 'StreamWish'
|
|
489
|
+
: streamResponse.siteFriendlyNames[site] === 'EarnVids'
|
|
490
|
+
? 'VidHide'
|
|
491
|
+
: streamResponse.siteFriendlyNames[site],
|
|
492
|
+
url: streamResponse.siteUrls[site] + JSON.parse(atob(streamResponse.mresult))[site],
|
|
493
|
+
};
|
|
494
|
+
});
|
|
495
|
+
return { servers, fileId };
|
|
496
|
+
} else {
|
|
497
|
+
return {
|
|
498
|
+
servers: [{ name: 'StreamWish', url: iframeUrl }],
|
|
499
|
+
fileId: iframeUrl.split('/').pop() ?? '',
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
} catch (err) {
|
|
503
|
+
console.log(err);
|
|
504
|
+
throw new Error((err as Error).message);
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
return {
|
|
509
|
+
...config,
|
|
510
|
+
supportedTypes,
|
|
511
|
+
search,
|
|
512
|
+
fetchMediaInfo,
|
|
513
|
+
fetchEpisodeSources,
|
|
514
|
+
fetchEpisodeServers,
|
|
515
|
+
fetchPopular,
|
|
516
|
+
fetchByGenre,
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export type MultiMoviesProviderInstance = ReturnType<typeof createMultiMovies>;
|