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