react-native-consumet 4.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/androidTest/java/com/consumet/TestSupport.kt +12 -6
- package/android/src/androidTest/java/com/consumet/WebViewContractTest.kt +30 -2
- package/android/src/main/java/com/consumet/HttpRequestModule.kt +27 -13
- package/ios/Consumet.mm +42 -19
- package/lib/commonjs/NativeConsumet.ts +13 -8
- package/lib/commonjs/extension-registry.json +35 -64
- package/lib/commonjs/extension-registry.json.sig +1 -1
- package/lib/commonjs/extractors/gofile.js +47 -10
- package/lib/commonjs/extractors/gofile.js.map +1 -1
- package/lib/commonjs/extractors/hubcloud.js +49 -42
- package/lib/commonjs/extractors/hubcloud.js.map +1 -1
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/index.js +9 -1
- package/lib/commonjs/models/index.js.map +1 -1
- package/lib/commonjs/models/meta-error.js +6 -3
- package/lib/commonjs/models/meta-error.js.map +1 -1
- package/lib/commonjs/models/provider-error.js +54 -0
- package/lib/commonjs/models/provider-error.js.map +1 -0
- package/lib/commonjs/models/types.js +3 -2
- package/lib/commonjs/models/types.js.map +1 -1
- package/lib/commonjs/providers/anime/anikoto/create-anikoto.js +90 -25
- package/lib/commonjs/providers/anime/anikoto/create-anikoto.js.map +1 -1
- package/lib/commonjs/providers/anime/{hianime.js → anikoto/hianime.js} +4 -4
- package/lib/commonjs/providers/anime/anikoto/hianime.js.map +1 -0
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +110 -18
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/commonjs/providers/anime/index.js +1 -9
- package/lib/commonjs/providers/anime/index.js.map +1 -1
- package/lib/commonjs/providers/anime/reanime/create-reanime.js +6 -2
- package/lib/commonjs/providers/anime/reanime/create-reanime.js.map +1 -1
- package/lib/commonjs/providers/common/concurrency.js +38 -0
- package/lib/commonjs/providers/common/concurrency.js.map +1 -0
- package/lib/commonjs/providers/common/errors.js +77 -0
- package/lib/commonjs/providers/common/errors.js.map +1 -0
- package/lib/commonjs/providers/common/servers.js +9 -3
- package/lib/commonjs/providers/common/servers.js.map +1 -1
- package/lib/commonjs/providers/common/ttl-cache.js +59 -0
- package/lib/commonjs/providers/common/ttl-cache.js.map +1 -0
- package/lib/commonjs/providers/manga/asurascans.js +29 -7
- package/lib/commonjs/providers/manga/asurascans.js.map +1 -1
- package/lib/commonjs/providers/meta/anilist-media.js +23 -13
- package/lib/commonjs/providers/meta/anilist-media.js.map +1 -1
- package/lib/commonjs/providers/meta/anilist.js +63 -18
- package/lib/commonjs/providers/meta/anilist.js.map +1 -1
- package/lib/commonjs/providers/meta/mal.js +3 -3
- package/lib/commonjs/providers/meta/mal.js.map +1 -1
- package/lib/commonjs/providers/meta/shared.js +7 -2
- package/lib/commonjs/providers/meta/shared.js.map +1 -1
- package/lib/commonjs/providers/meta/tmdb.js +151 -45
- package/lib/commonjs/providers/meta/tmdb.js.map +1 -1
- package/lib/commonjs/providers/movies/index.js +0 -4
- package/lib/commonjs/providers/movies/index.js.map +1 -1
- package/lib/commonjs/providers/movies/multimovies/create-multimovies.js +2 -1
- package/lib/commonjs/providers/movies/multimovies/create-multimovies.js.map +1 -1
- package/lib/commonjs/providers/movies/multistream/create-multistream.js +1 -1
- package/lib/commonjs/providers/movies/multistream/create-multistream.js.map +1 -1
- package/lib/commonjs/providers/movies/netflixmirror/create-netflixmirror.js +44 -11
- package/lib/commonjs/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -1
- package/lib/commonjs/providers/movies/site-paths.js +3 -2
- package/lib/commonjs/providers/movies/site-paths.js.map +1 -1
- package/lib/commonjs/providers/movies/vegamovies/create-vegamovies.js +95 -44
- package/lib/commonjs/providers/movies/vegamovies/create-vegamovies.js.map +1 -1
- package/lib/commonjs/providers/provider-class.js +1 -1
- package/lib/commonjs/utils/ExtractorManager.js +90 -11
- package/lib/commonjs/utils/ExtractorManager.js.map +1 -1
- package/lib/commonjs/utils/ProviderManager.js +54 -18
- package/lib/commonjs/utils/ProviderManager.js.map +1 -1
- package/lib/commonjs/utils/extension-modules.js +136 -24
- package/lib/commonjs/utils/extension-modules.js.map +1 -1
- package/lib/commonjs/utils/registry-schema.js +3 -2
- package/lib/commonjs/utils/registry-schema.js.map +1 -1
- package/lib/commonjs/utils/tmdb.js +53 -8
- package/lib/commonjs/utils/tmdb.js.map +1 -1
- package/lib/module/NativeConsumet.ts +13 -8
- package/lib/module/extension-registry.json +35 -64
- package/lib/module/extension-registry.json.sig +1 -1
- package/lib/module/extractors/gofile.js +47 -10
- package/lib/module/extractors/gofile.js.map +1 -1
- package/lib/module/extractors/hubcloud.js +49 -42
- package/lib/module/extractors/hubcloud.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/index.js +1 -0
- package/lib/module/models/index.js.map +1 -1
- package/lib/module/models/meta-error.js +7 -3
- package/lib/module/models/meta-error.js.map +1 -1
- package/lib/module/models/provider-error.js +49 -0
- package/lib/module/models/provider-error.js.map +1 -0
- package/lib/module/models/types.js +3 -2
- package/lib/module/models/types.js.map +1 -1
- package/lib/module/providers/anime/anikoto/create-anikoto.js +91 -25
- package/lib/module/providers/anime/anikoto/create-anikoto.js.map +1 -1
- package/lib/module/providers/anime/{hianime.js → anikoto/hianime.js} +4 -4
- package/lib/module/providers/anime/anikoto/hianime.js.map +1 -0
- package/lib/module/providers/anime/animepahe/create-animepahe.js +111 -18
- package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/module/providers/anime/index.js +1 -9
- package/lib/module/providers/anime/index.js.map +1 -1
- package/lib/module/providers/anime/reanime/create-reanime.js +6 -2
- package/lib/module/providers/anime/reanime/create-reanime.js.map +1 -1
- package/lib/module/providers/common/concurrency.js +34 -0
- package/lib/module/providers/common/concurrency.js.map +1 -0
- package/lib/module/providers/common/errors.js +70 -0
- package/lib/module/providers/common/errors.js.map +1 -0
- package/lib/module/providers/common/servers.js +10 -3
- package/lib/module/providers/common/servers.js.map +1 -1
- package/lib/module/providers/common/ttl-cache.js +54 -0
- package/lib/module/providers/common/ttl-cache.js.map +1 -0
- package/lib/module/providers/manga/asurascans.js +29 -7
- package/lib/module/providers/manga/asurascans.js.map +1 -1
- package/lib/module/providers/meta/anilist-media.js +23 -13
- package/lib/module/providers/meta/anilist-media.js.map +1 -1
- package/lib/module/providers/meta/anilist.js +64 -19
- package/lib/module/providers/meta/anilist.js.map +1 -1
- package/lib/module/providers/meta/mal.js +3 -3
- package/lib/module/providers/meta/mal.js.map +1 -1
- package/lib/module/providers/meta/shared.js +8 -3
- package/lib/module/providers/meta/shared.js.map +1 -1
- package/lib/module/providers/meta/tmdb.js +153 -47
- package/lib/module/providers/meta/tmdb.js.map +1 -1
- package/lib/module/providers/movies/index.js +0 -4
- package/lib/module/providers/movies/index.js.map +1 -1
- package/lib/module/providers/movies/multimovies/create-multimovies.js +2 -1
- package/lib/module/providers/movies/multimovies/create-multimovies.js.map +1 -1
- package/lib/module/providers/movies/multistream/create-multistream.js +1 -1
- package/lib/module/providers/movies/multistream/create-multistream.js.map +1 -1
- package/lib/module/providers/movies/netflixmirror/create-netflixmirror.js +44 -11
- package/lib/module/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -1
- package/lib/module/providers/movies/site-paths.js +3 -2
- package/lib/module/providers/movies/site-paths.js.map +1 -1
- package/lib/module/providers/movies/vegamovies/create-vegamovies.js +95 -44
- package/lib/module/providers/movies/vegamovies/create-vegamovies.js.map +1 -1
- package/lib/module/providers/provider-class.js +1 -1
- package/lib/module/utils/ExtractorManager.js +89 -11
- package/lib/module/utils/ExtractorManager.js.map +1 -1
- package/lib/module/utils/ProviderManager.js +54 -18
- package/lib/module/utils/ProviderManager.js.map +1 -1
- package/lib/module/utils/extension-modules.js +136 -24
- package/lib/module/utils/extension-modules.js.map +1 -1
- package/lib/module/utils/registry-schema.js +3 -2
- package/lib/module/utils/registry-schema.js.map +1 -1
- package/lib/module/utils/tmdb.js +51 -7
- package/lib/module/utils/tmdb.js.map +1 -1
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts +13 -8
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/gofile.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/hubcloud.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +4 -3
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/extension-manifest.d.ts +2 -0
- package/lib/typescript/commonjs/src/models/extension-manifest.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/models/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/meta-error.d.ts +4 -1
- package/lib/typescript/commonjs/src/models/meta-error.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/provider-error.d.ts +32 -0
- package/lib/typescript/commonjs/src/models/provider-error.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/types.d.ts +31 -3
- package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/anikoto/create-anikoto.d.ts.map +1 -1
- package/lib/typescript/{module/src/providers/anime → commonjs/src/providers/anime/anikoto}/hianime.d.ts +2 -2
- package/lib/typescript/commonjs/src/providers/anime/anikoto/hianime.d.ts.map +1 -0
- 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 +0 -6
- package/lib/typescript/commonjs/src/providers/anime/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/reanime/create-reanime.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/common/concurrency.d.ts +8 -0
- package/lib/typescript/commonjs/src/providers/common/concurrency.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/common/errors.d.ts +36 -0
- package/lib/typescript/commonjs/src/providers/common/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/common/servers.d.ts +2 -1
- package/lib/typescript/commonjs/src/providers/common/servers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/common/ttl-cache.d.ts +21 -0
- package/lib/typescript/commonjs/src/providers/common/ttl-cache.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/manga/asurascans.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/anilist-media.d.ts +19 -7
- package/lib/typescript/commonjs/src/providers/meta/anilist-media.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts +15 -7
- package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/mal.d.ts +1 -1
- package/lib/typescript/commonjs/src/providers/meta/shared.d.ts +4 -1
- package/lib/typescript/commonjs/src/providers/meta/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/tmdb.d.ts +65 -6
- package/lib/typescript/commonjs/src/providers/meta/tmdb.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/index.d.ts +0 -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.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/create-netflixmirror.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/site-paths.d.ts +3 -2
- package/lib/typescript/commonjs/src/providers/movies/site-paths.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/vegamovies/create-vegamovies.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/provider-class.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/ExtractorManager.d.ts +29 -1
- package/lib/typescript/commonjs/src/utils/ExtractorManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts +19 -5
- package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/extension-modules.d.ts +33 -8
- package/lib/typescript/commonjs/src/utils/extension-modules.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/registry-schema.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/registry-schema.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/tmdb.d.ts +18 -3
- package/lib/typescript/commonjs/src/utils/tmdb.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeConsumet.d.ts +13 -8
- package/lib/typescript/module/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/gofile.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/hubcloud.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +4 -3
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/extension-manifest.d.ts +2 -0
- package/lib/typescript/module/src/models/extension-manifest.d.ts.map +1 -1
- package/lib/typescript/module/src/models/index.d.ts +1 -0
- package/lib/typescript/module/src/models/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/meta-error.d.ts +4 -1
- package/lib/typescript/module/src/models/meta-error.d.ts.map +1 -1
- package/lib/typescript/module/src/models/provider-error.d.ts +32 -0
- package/lib/typescript/module/src/models/provider-error.d.ts.map +1 -0
- package/lib/typescript/module/src/models/types.d.ts +31 -3
- package/lib/typescript/module/src/models/types.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/anikoto/create-anikoto.d.ts.map +1 -1
- package/lib/typescript/{commonjs/src/providers/anime → module/src/providers/anime/anikoto}/hianime.d.ts +2 -2
- package/lib/typescript/module/src/providers/anime/anikoto/hianime.d.ts.map +1 -0
- 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 +0 -6
- package/lib/typescript/module/src/providers/anime/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/reanime/create-reanime.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/common/concurrency.d.ts +8 -0
- package/lib/typescript/module/src/providers/common/concurrency.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/common/errors.d.ts +36 -0
- package/lib/typescript/module/src/providers/common/errors.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/common/servers.d.ts +2 -1
- package/lib/typescript/module/src/providers/common/servers.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/common/ttl-cache.d.ts +21 -0
- package/lib/typescript/module/src/providers/common/ttl-cache.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/manga/asurascans.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/anilist-media.d.ts +19 -7
- package/lib/typescript/module/src/providers/meta/anilist-media.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/anilist.d.ts +15 -7
- package/lib/typescript/module/src/providers/meta/anilist.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/mal.d.ts +1 -1
- package/lib/typescript/module/src/providers/meta/shared.d.ts +4 -1
- package/lib/typescript/module/src/providers/meta/shared.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/tmdb.d.ts +65 -6
- package/lib/typescript/module/src/providers/meta/tmdb.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/index.d.ts +0 -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.map +1 -1
- package/lib/typescript/module/src/providers/movies/netflixmirror/create-netflixmirror.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/site-paths.d.ts +3 -2
- package/lib/typescript/module/src/providers/movies/site-paths.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/vegamovies/create-vegamovies.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/provider-class.d.ts +1 -1
- package/lib/typescript/module/src/utils/ExtractorManager.d.ts +29 -1
- package/lib/typescript/module/src/utils/ExtractorManager.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/ProviderManager.d.ts +19 -5
- package/lib/typescript/module/src/utils/ProviderManager.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/extension-modules.d.ts +33 -8
- package/lib/typescript/module/src/utils/extension-modules.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/registry-schema.d.ts +1 -1
- package/lib/typescript/module/src/utils/registry-schema.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/tmdb.d.ts +18 -3
- package/lib/typescript/module/src/utils/tmdb.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/NativeConsumet.ts +13 -8
- package/src/extension-registry.json +35 -64
- package/src/extension-registry.json.sig +1 -1
- package/src/extractors/gofile.ts +52 -11
- package/src/extractors/hubcloud.ts +62 -49
- package/src/index.tsx +4 -1
- package/src/models/extension-manifest.ts +3 -0
- package/src/models/index.ts +1 -0
- package/src/models/meta-error.ts +7 -3
- package/src/models/provider-error.ts +57 -0
- package/src/models/types.ts +27 -3
- package/src/providers/anime/anikoto/create-anikoto.ts +75 -27
- package/src/providers/anime/{hianime.ts → anikoto/hianime.ts} +5 -5
- package/src/providers/anime/animepahe/create-animepahe.ts +101 -19
- package/src/providers/anime/index.ts +0 -8
- package/src/providers/anime/reanime/create-reanime.ts +8 -1
- package/src/providers/common/concurrency.ts +32 -0
- package/src/providers/common/errors.ts +84 -0
- package/src/providers/common/servers.ts +7 -3
- package/src/providers/common/ttl-cache.ts +65 -0
- package/src/providers/manga/asurascans.ts +31 -7
- package/src/providers/meta/anilist-media.ts +20 -15
- package/src/providers/meta/anilist.ts +59 -17
- package/src/providers/meta/mal.ts +3 -3
- package/src/providers/meta/shared.ts +10 -3
- package/src/providers/meta/tmdb.ts +173 -38
- package/src/providers/movies/index.ts +0 -4
- package/src/providers/movies/multimovies/create-multimovies.ts +1 -0
- package/src/providers/movies/multistream/create-multistream.ts +1 -1
- package/src/providers/movies/netflixmirror/create-netflixmirror.ts +49 -11
- package/src/providers/movies/site-paths.ts +3 -2
- package/src/providers/movies/vegamovies/create-vegamovies.ts +93 -42
- package/src/providers/provider-class.ts +1 -1
- package/src/utils/ExtractorManager.ts +97 -11
- package/src/utils/ProviderManager.ts +74 -22
- package/src/utils/extension-modules.ts +145 -32
- package/src/utils/registry-schema.ts +2 -1
- package/src/utils/tmdb.ts +53 -7
- package/lib/commonjs/providers/anime/anineko/anineko.js +0 -11
- package/lib/commonjs/providers/anime/anineko/anineko.js.map +0 -1
- package/lib/commonjs/providers/anime/anineko/create-anineko.js +0 -358
- package/lib/commonjs/providers/anime/anineko/create-anineko.js.map +0 -1
- package/lib/commonjs/providers/anime/hianime.js.map +0 -1
- package/lib/commonjs/providers/anime/zoro/create-zoro.js +0 -362
- package/lib/commonjs/providers/anime/zoro/create-zoro.js.map +0 -1
- package/lib/commonjs/providers/anime/zoro/zoro.js +0 -11
- package/lib/commonjs/providers/anime/zoro/zoro.js.map +0 -1
- package/lib/commonjs/providers/movies/himovies/create-himovies.js +0 -231
- package/lib/commonjs/providers/movies/himovies/create-himovies.js.map +0 -1
- package/lib/commonjs/providers/movies/himovies/himovies.js +0 -11
- package/lib/commonjs/providers/movies/himovies/himovies.js.map +0 -1
- package/lib/module/providers/anime/anineko/anineko.js +0 -7
- package/lib/module/providers/anime/anineko/anineko.js.map +0 -1
- package/lib/module/providers/anime/anineko/create-anineko.js +0 -354
- package/lib/module/providers/anime/anineko/create-anineko.js.map +0 -1
- package/lib/module/providers/anime/hianime.js.map +0 -1
- package/lib/module/providers/anime/zoro/create-zoro.js +0 -358
- package/lib/module/providers/anime/zoro/create-zoro.js.map +0 -1
- package/lib/module/providers/anime/zoro/zoro.js +0 -7
- package/lib/module/providers/anime/zoro/zoro.js.map +0 -1
- package/lib/module/providers/movies/himovies/create-himovies.js +0 -227
- package/lib/module/providers/movies/himovies/create-himovies.js.map +0 -1
- package/lib/module/providers/movies/himovies/himovies.js +0 -7
- package/lib/module/providers/movies/himovies/himovies.js.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/anineko/anineko.d.ts +0 -5
- package/lib/typescript/commonjs/src/providers/anime/anineko/anineko.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/anineko/create-anineko.d.ts +0 -52
- package/lib/typescript/commonjs/src/providers/anime/anineko/create-anineko.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/hianime.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts +0 -49
- package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/zoro/zoro.d.ts +0 -5
- package/lib/typescript/commonjs/src/providers/anime/zoro/zoro.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/himovies/create-himovies.d.ts +0 -28
- package/lib/typescript/commonjs/src/providers/movies/himovies/create-himovies.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/himovies/himovies.d.ts +0 -5
- package/lib/typescript/commonjs/src/providers/movies/himovies/himovies.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/anineko/anineko.d.ts +0 -5
- package/lib/typescript/module/src/providers/anime/anineko/anineko.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/anineko/create-anineko.d.ts +0 -52
- package/lib/typescript/module/src/providers/anime/anineko/create-anineko.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/hianime.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts +0 -49
- package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/zoro/zoro.d.ts +0 -5
- package/lib/typescript/module/src/providers/anime/zoro/zoro.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/himovies/create-himovies.d.ts +0 -28
- package/lib/typescript/module/src/providers/movies/himovies/create-himovies.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/himovies/himovies.d.ts +0 -5
- package/lib/typescript/module/src/providers/movies/himovies/himovies.d.ts.map +0 -1
- package/src/providers/anime/anineko/anineko.ts +0 -6
- package/src/providers/anime/anineko/create-anineko.ts +0 -394
- package/src/providers/anime/zoro/create-zoro.ts +0 -398
- package/src/providers/anime/zoro/zoro.ts +0 -6
- package/src/providers/movies/himovies/create-himovies.ts +0 -252
- package/src/providers/movies/himovies/himovies.ts +0 -6
|
@@ -7,18 +7,21 @@ import {
|
|
|
7
7
|
type IEpisodeServer,
|
|
8
8
|
MovieParser,
|
|
9
9
|
MetaError,
|
|
10
|
+
ProviderError,
|
|
10
11
|
TvType,
|
|
11
12
|
type IMovieResult,
|
|
12
13
|
type IMovieInfo,
|
|
13
14
|
type ProxyConfig,
|
|
14
15
|
type IMovieEpisode,
|
|
15
16
|
type IMovieSeason,
|
|
17
|
+
type MediaStatus,
|
|
16
18
|
} from '../../models';
|
|
17
19
|
import type { IMovieProvider, IPeopleResult } from '../../models/types';
|
|
18
20
|
import type { AxiosAdapter } from 'axios';
|
|
19
21
|
import {
|
|
20
22
|
TMDB_INFO_APPEND,
|
|
21
23
|
TMDB_LOGO,
|
|
24
|
+
TMDB_SHOW_STATUS_FILTERS,
|
|
22
25
|
mapTmdbInfo,
|
|
23
26
|
mapTmdbResult,
|
|
24
27
|
mapTmdbResults,
|
|
@@ -32,7 +35,7 @@ import {
|
|
|
32
35
|
type TmdbMediaType,
|
|
33
36
|
} from '../../utils/tmdb';
|
|
34
37
|
import { searchTerm } from '../../utils/utils';
|
|
35
|
-
import {
|
|
38
|
+
import { NetflixMirror } from '../movies/netflixmirror/netflixmirror';
|
|
36
39
|
import { bestTitleMatch, callProvider } from './shared';
|
|
37
40
|
|
|
38
41
|
/** What TMDB knows about a title, used to pick the matching provider result. */
|
|
@@ -43,6 +46,41 @@ type TitleHints = {
|
|
|
43
46
|
totalEpisodes?: number;
|
|
44
47
|
};
|
|
45
48
|
|
|
49
|
+
/** Options of META.TMDB.advancedSearch. */
|
|
50
|
+
export interface TmdbSearchOptions {
|
|
51
|
+
/** Only movies, or only shows; both when omitted */
|
|
52
|
+
type?: TmdbMediaType;
|
|
53
|
+
/** The year a movie was released, or a show first aired */
|
|
54
|
+
year?: number;
|
|
55
|
+
page?: number;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Options of META.TMDB.discover. TMDB's discover has no status for movies, so only shows take `status`. */
|
|
59
|
+
export type TmdbDiscoverOptions = {
|
|
60
|
+
/**
|
|
61
|
+
* TMDB's `sort_by`: `popularity.desc` (the default), `vote_average.desc`, `vote_count.desc`, and
|
|
62
|
+
* `primary_release_date.desc` for movies or `first_air_date.desc` for shows (`.asc` too)
|
|
63
|
+
*/
|
|
64
|
+
sort?: string;
|
|
65
|
+
/** The year a movie was released, or a show first aired */
|
|
66
|
+
year?: number;
|
|
67
|
+
/** TMDB genre ids (`/genre/movie/list`, `/genre/tv/list`); a title has all of them */
|
|
68
|
+
genres?: number[];
|
|
69
|
+
page?: number;
|
|
70
|
+
} & (
|
|
71
|
+
| { type: 'movie' }
|
|
72
|
+
| {
|
|
73
|
+
type: 'tv';
|
|
74
|
+
/** `ONGOING`, `COMPLETED` or `NOT_YET_AIRED`, as fetchMediaInfo reports a show's status */
|
|
75
|
+
status?: MediaStatus;
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const isMediaType = (type: unknown): type is TmdbMediaType => type === 'movie' || type === 'tv';
|
|
80
|
+
|
|
81
|
+
/** The query parameter of TMDB's search and discover that filters by year. */
|
|
82
|
+
const yearParam = (type: TmdbMediaType) => (type === 'movie' ? 'primary_release_year' : 'first_air_date_year');
|
|
83
|
+
|
|
46
84
|
/** Provider results less similar than this to TMDB's title are not the title. */
|
|
47
85
|
const MIN_TITLE_SIMILARITY = 0.5;
|
|
48
86
|
|
|
@@ -66,7 +104,7 @@ class TMDB extends MovieParser {
|
|
|
66
104
|
/**
|
|
67
105
|
* @param apiKey your TMDB API key. Without one, a key shared by every app that passes none is
|
|
68
106
|
* used, and a warning is logged once; TMDB can rate-limit or revoke that key at any time.
|
|
69
|
-
* @param provider movie provider to find the title on (default
|
|
107
|
+
* @param provider movie provider to find the title on (default NetflixMirror)
|
|
70
108
|
* @param _proxyConfig ignored: requests go through the library's own client. Kept so existing calls compile.
|
|
71
109
|
* @param _adapter ignored, for the same reason
|
|
72
110
|
*/
|
|
@@ -78,7 +116,7 @@ class TMDB extends MovieParser {
|
|
|
78
116
|
) {
|
|
79
117
|
super();
|
|
80
118
|
this.apiKey = resolveTmdbApiKey(apiKey, 'META.TMDB');
|
|
81
|
-
this.provider = provider || new
|
|
119
|
+
this.provider = provider || new NetflixMirror();
|
|
82
120
|
}
|
|
83
121
|
|
|
84
122
|
/**
|
|
@@ -101,7 +139,7 @@ class TMDB extends MovieParser {
|
|
|
101
139
|
id: String(result.id),
|
|
102
140
|
name: result.name,
|
|
103
141
|
rating: result.popularity,
|
|
104
|
-
image: tmdbImage(result.profile_path),
|
|
142
|
+
image: tmdbImage(result.profile_path, 'w185'),
|
|
105
143
|
// TMDB's trending people no longer come with known_for
|
|
106
144
|
movies: (result.known_for ?? []).map((movie: any) => mapTmdbResult(movie)),
|
|
107
145
|
} as IPeopleResult)
|
|
@@ -120,14 +158,90 @@ class TMDB extends MovieParser {
|
|
|
120
158
|
);
|
|
121
159
|
};
|
|
122
160
|
|
|
161
|
+
/**
|
|
162
|
+
* Movies and shows TMDB finds for `query`, of one type and year when asked. Without a type it
|
|
163
|
+
* searches as `search` does (people left out), and a year keeps only that year's titles, so a page
|
|
164
|
+
* may hold fewer results than TMDB's.
|
|
165
|
+
* @throws Error before any request when `type` isn't `movie` or `tv`
|
|
166
|
+
*/
|
|
167
|
+
advancedSearch = async (query: string, options: TmdbSearchOptions = {}): Promise<ISearch<IMovieResult>> => {
|
|
168
|
+
const { type, year, page = 1 } = options;
|
|
169
|
+
if (type !== undefined && !isMediaType(type)) throw new Error(`advancedSearch: type must be 'movie' or 'tv'`);
|
|
170
|
+
if (!type) {
|
|
171
|
+
const { data, results } = await tmdbMultiSearch(this.get, query, page);
|
|
172
|
+
const ofYear = year ? results.filter((result) => releaseYear(result) === String(year)) : results;
|
|
173
|
+
return tmdbPage(
|
|
174
|
+
data,
|
|
175
|
+
page,
|
|
176
|
+
ofYear.map((result) => mapTmdbResult(result))
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
const data = await this.get(
|
|
180
|
+
`/search/${type}?language=en-US&page=${page}&include_adult=false&query=${encodeURIComponent(query)}` +
|
|
181
|
+
(year ? `&${yearParam(type)}=${year}` : '')
|
|
182
|
+
);
|
|
183
|
+
return tmdbPage(
|
|
184
|
+
data,
|
|
185
|
+
page,
|
|
186
|
+
(data?.results ?? []).map((result: any) => mapTmdbResult(result, type))
|
|
187
|
+
);
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Movies or shows without a query, TMDB's discover: by `sort`, of a year, with `genres`, and for
|
|
192
|
+
* shows of a `status`.
|
|
193
|
+
* @throws Error before any request when `type` isn't `movie` or `tv`, a genre isn't a TMDB genre
|
|
194
|
+
* id, or a `status` can't be filtered by
|
|
195
|
+
*/
|
|
196
|
+
discover = async (options: TmdbDiscoverOptions): Promise<ISearch<IMovieResult>> => {
|
|
197
|
+
const { type, sort = 'popularity.desc', year, genres, page = 1 } = options;
|
|
198
|
+
if (!isMediaType(type)) throw new Error(`discover: type must be 'movie' or 'tv'`);
|
|
199
|
+
const params = [`language=en-US`, `page=${page}`, 'include_adult=false', `sort_by=${encodeURIComponent(sort)}`];
|
|
200
|
+
if (year) params.push(`${yearParam(type)}=${year}`);
|
|
201
|
+
if (genres?.length) {
|
|
202
|
+
if (!genres.every((genre) => Number.isInteger(genre))) throw new Error('discover: genres must be TMDB genre ids');
|
|
203
|
+
params.push(`with_genres=${genres.join(',')}`);
|
|
204
|
+
}
|
|
205
|
+
const status = 'status' in options ? options.status : undefined;
|
|
206
|
+
if (status !== undefined) {
|
|
207
|
+
const filter = type === 'tv' ? TMDB_SHOW_STATUS_FILTERS[status] : undefined;
|
|
208
|
+
if (!filter)
|
|
209
|
+
throw new Error(`discover: TMDB can't filter ${type === 'tv' ? 'shows' : 'movies'} by status ${status}`);
|
|
210
|
+
params.push(`with_status=${encodeURIComponent(filter)}`);
|
|
211
|
+
}
|
|
212
|
+
const data = await this.get(`/discover/${type}?${params.join('&')}`);
|
|
213
|
+
return tmdbPage(
|
|
214
|
+
data,
|
|
215
|
+
page,
|
|
216
|
+
(data?.results ?? []).map((result: any) => mapTmdbResult(result, type))
|
|
217
|
+
);
|
|
218
|
+
};
|
|
219
|
+
|
|
123
220
|
/**
|
|
124
221
|
* TMDB info with every season and episode. `id` is always the TMDB id. When the title is found on
|
|
125
222
|
* the provider, `providerId` is the provider's media id and episodes carry provider episode ids;
|
|
126
223
|
* with no match (or a failing provider) both are unset and the TMDB metadata is still returned.
|
|
224
|
+
* matchProviderEpisodes(fetchTmdbInfo(...)) in one call, without its provider errors: apps that
|
|
225
|
+
* need to tell a failing provider from a missing title call those two.
|
|
127
226
|
* @param mediaId TMDB id
|
|
128
227
|
* @param type `movie`, or anything else for a show
|
|
129
228
|
*/
|
|
130
229
|
override fetchMediaInfo = async (mediaId: string, type: string): Promise<IMovieInfo> => {
|
|
230
|
+
const info = await this.fetchTmdbInfo(mediaId, type);
|
|
231
|
+
return this.matchProviderEpisodes(info).catch((error: unknown) => {
|
|
232
|
+
if (error instanceof MetaError && error.source === 'provider') return info;
|
|
233
|
+
throw error;
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* TMDB info with every season and episode, without the provider: no search and no scrape, so an
|
|
239
|
+
* info page can show it as soon as TMDB answers. Episodes have no provider ids; pass the result to
|
|
240
|
+
* matchProviderEpisodes for them.
|
|
241
|
+
* @param mediaId TMDB id
|
|
242
|
+
* @param type `movie`, or anything else for a show
|
|
243
|
+
*/
|
|
244
|
+
fetchTmdbInfo = async (mediaId: string, type: string): Promise<IMovieInfo> => {
|
|
131
245
|
const mediaType: TmdbMediaType = type.toLowerCase() === 'movie' ? 'movie' : 'tv';
|
|
132
246
|
try {
|
|
133
247
|
const { data } = await metaHttp.get(
|
|
@@ -137,20 +251,9 @@ class TMDB extends MovieParser {
|
|
|
137
251
|
)
|
|
138
252
|
);
|
|
139
253
|
|
|
140
|
-
const match = await this.matchProvider(data?.title || data?.name, {
|
|
141
|
-
type: mediaType === 'movie' ? TvType.MOVIE : TvType.TVSERIES,
|
|
142
|
-
totalSeasons: data?.number_of_seasons,
|
|
143
|
-
totalEpisodes: data?.number_of_episodes,
|
|
144
|
-
year: Number(releaseYear(data)) || undefined,
|
|
145
|
-
});
|
|
146
|
-
// With no match there is nothing playable to map; the TMDB info and seasons are still returned.
|
|
147
|
-
const providerEpisodes = match?.info?.episodes as any[] | undefined;
|
|
148
|
-
|
|
149
254
|
const info: IMovieInfo = {
|
|
150
255
|
id: mediaId,
|
|
151
256
|
...mapTmdbInfo(data, mediaType),
|
|
152
|
-
...(match ? { providerId: match.id } : {}),
|
|
153
|
-
...(mediaType === 'movie' ? { episodeId: providerEpisodes?.[0]?.id } : {}),
|
|
154
257
|
directors: data?.credits?.crew
|
|
155
258
|
?.filter((crew: { job: string }) => crew.job === 'Director')
|
|
156
259
|
.map((crew: { name: string }) => crew.name),
|
|
@@ -174,7 +277,7 @@ class TMDB extends MovieParser {
|
|
|
174
277
|
runtime: data.next_episode_to_air?.runtime || undefined,
|
|
175
278
|
}
|
|
176
279
|
: undefined;
|
|
177
|
-
info.seasons = await this.fetchSeasons(mediaId, totalSeasons
|
|
280
|
+
info.seasons = await this.fetchSeasons(mediaId, totalSeasons);
|
|
178
281
|
} else {
|
|
179
282
|
info.seasons = [
|
|
180
283
|
{
|
|
@@ -182,7 +285,9 @@ class TMDB extends MovieParser {
|
|
|
182
285
|
image: tmdbImageSizes(data?.poster_path),
|
|
183
286
|
episodes: [
|
|
184
287
|
{
|
|
185
|
-
|
|
288
|
+
// Set by matchProviderEpisodes
|
|
289
|
+
id: undefined,
|
|
290
|
+
url: undefined,
|
|
186
291
|
uniqueId: `${mediaId}-${mediaType}-s1-e1`,
|
|
187
292
|
title: data.title || data.original_title,
|
|
188
293
|
number: 1,
|
|
@@ -190,7 +295,6 @@ class TMDB extends MovieParser {
|
|
|
190
295
|
season: 1,
|
|
191
296
|
releaseDate: data.release_date,
|
|
192
297
|
description: data.overview,
|
|
193
|
-
url: providerEpisodes?.[0]?.url,
|
|
194
298
|
image: tmdbImageSizes(data?.backdrop_path),
|
|
195
299
|
},
|
|
196
300
|
],
|
|
@@ -199,21 +303,51 @@ class TMDB extends MovieParser {
|
|
|
199
303
|
}
|
|
200
304
|
return info;
|
|
201
305
|
} catch (err) {
|
|
202
|
-
// matchProvider absorbs provider failures, so anything here comes from TMDB's requests or data
|
|
203
306
|
throw MetaError.from('tmdb', err);
|
|
204
307
|
}
|
|
205
308
|
};
|
|
206
309
|
|
|
207
310
|
/**
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
311
|
+
* `info` (fetchTmdbInfo's) with the provider's ids: finds the title on the provider, then gives
|
|
312
|
+
* each episode the provider's id and url for it. With no match, `info` comes back as it was. A
|
|
313
|
+
* failing provider rejects (see matchProvider); fetchTmdbInfo's info doesn't depend on it.
|
|
314
|
+
*/
|
|
315
|
+
matchProviderEpisodes = async (info: IMovieInfo): Promise<IMovieInfo> => {
|
|
316
|
+
const isMovie = info.type === TvType.MOVIE;
|
|
317
|
+
const match = await this.matchProvider(info.title as string, {
|
|
318
|
+
type: isMovie ? TvType.MOVIE : TvType.TVSERIES,
|
|
319
|
+
totalSeasons: info.totalSeasons,
|
|
320
|
+
totalEpisodes: info.totalEpisodes,
|
|
321
|
+
year: Number(/^\d{4}/.exec(info.releaseDate ?? '')?.[0]) || undefined,
|
|
322
|
+
});
|
|
323
|
+
if (!match) return info;
|
|
324
|
+
|
|
325
|
+
const providerEpisodes = match.info.episodes as any[] | undefined;
|
|
326
|
+
// A movie, or a show TMDB lists without seasons, is one episode: the provider's first
|
|
327
|
+
const single = isMovie || !info.totalSeasons;
|
|
328
|
+
const providerEpisode = (season: number, number?: number) =>
|
|
329
|
+
single
|
|
330
|
+
? providerEpisodes?.[0]
|
|
331
|
+
: providerEpisodes?.find((episode) => episode.season === season && episode.number === number);
|
|
332
|
+
return {
|
|
333
|
+
...info,
|
|
334
|
+
providerId: match.id,
|
|
335
|
+
...(isMovie ? { episodeId: providerEpisodes?.[0]?.id } : {}),
|
|
336
|
+
seasons: info.seasons?.map((season) => ({
|
|
337
|
+
...season,
|
|
338
|
+
episodes: season.episodes?.map((episode) => {
|
|
339
|
+
const fromProvider = providerEpisode(season.season, episode.number);
|
|
340
|
+
return { ...episode, id: fromProvider?.id, url: fromProvider?.url || undefined };
|
|
341
|
+
}),
|
|
342
|
+
})),
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Every season of a show, fetched together. A season whose request fails keeps its place, with no
|
|
348
|
+
* episodes and `failed` set, so the other seasons (and the season indexes apps store) survive it.
|
|
211
349
|
*/
|
|
212
|
-
private fetchSeasons = async (
|
|
213
|
-
mediaId: string,
|
|
214
|
-
totalSeasons: number,
|
|
215
|
-
providerEpisodes: any[] | undefined
|
|
216
|
-
): Promise<IMovieSeason[]> => {
|
|
350
|
+
private fetchSeasons = async (mediaId: string, totalSeasons: number): Promise<IMovieSeason[]> => {
|
|
217
351
|
const seasonNumbers = Array.from({ length: totalSeasons }, (_, index) => index + 1);
|
|
218
352
|
const responses = await Promise.allSettled(
|
|
219
353
|
seasonNumbers.map((season) => metaHttp.get(tmdbUrl(`/tv/${mediaId}/season/${season}`, this.apiKey)))
|
|
@@ -225,16 +359,16 @@ class TMDB extends MovieParser {
|
|
|
225
359
|
const season = index + 1;
|
|
226
360
|
if (response.status === 'rejected') return { season, episodes: [], failed: true };
|
|
227
361
|
const seasonData = response.value.data;
|
|
228
|
-
const seasonEpisodes = providerEpisodes?.filter((episode) => episode.season === season);
|
|
229
362
|
const tmdbEpisodes: any[] = seasonData?.episodes ?? [];
|
|
230
363
|
|
|
231
364
|
return {
|
|
232
365
|
season,
|
|
233
366
|
image: tmdbImageSizes(seasonData?.poster_path),
|
|
234
|
-
episodes: tmdbEpisodes.map(
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
id:
|
|
367
|
+
episodes: tmdbEpisodes.map(
|
|
368
|
+
(episode): IMovieEpisode => ({
|
|
369
|
+
// Set by matchProviderEpisodes
|
|
370
|
+
id: undefined,
|
|
371
|
+
url: undefined,
|
|
238
372
|
uniqueId: `${mediaId}-tv-s${episode.season_number}-e${episode.episode_number}`,
|
|
239
373
|
title: episode.name,
|
|
240
374
|
number: episode.episode_number,
|
|
@@ -242,10 +376,9 @@ class TMDB extends MovieParser {
|
|
|
242
376
|
season: episode.season_number,
|
|
243
377
|
releaseDate: episode.air_date,
|
|
244
378
|
description: episode.overview,
|
|
245
|
-
url: episodeFromProvider?.url || undefined,
|
|
246
379
|
image: tmdbImageSizes(episode?.still_path),
|
|
247
|
-
}
|
|
248
|
-
|
|
380
|
+
})
|
|
381
|
+
),
|
|
249
382
|
isReleased: !(tmdbEpisodes[0]?.air_date > new Date().toISOString()),
|
|
250
383
|
};
|
|
251
384
|
});
|
|
@@ -253,7 +386,9 @@ class TMDB extends MovieParser {
|
|
|
253
386
|
|
|
254
387
|
/**
|
|
255
388
|
* Find the title on the provider and fetch the provider's info for it. Returns nothing when no
|
|
256
|
-
* search result matches
|
|
389
|
+
* search result matches. A failing provider rejects with a provider MetaError whose cause is a
|
|
390
|
+
* ProviderError, so apps can tell "not on this provider" from "offline" or "provider broken"
|
|
391
|
+
* (and don't cache a failure as a missing title).
|
|
257
392
|
*/
|
|
258
393
|
private matchProvider = async (
|
|
259
394
|
title: string,
|
|
@@ -263,8 +398,8 @@ class TMDB extends MovieParser {
|
|
|
263
398
|
const id = await this.findIdFromTitle(title, extraData);
|
|
264
399
|
if (!id) return undefined;
|
|
265
400
|
return { id, info: await this.provider.fetchMediaInfo(id) };
|
|
266
|
-
} catch {
|
|
267
|
-
|
|
401
|
+
} catch (err) {
|
|
402
|
+
throw MetaError.from('provider', ProviderError.from(err, { provider: this.provider.name }));
|
|
268
403
|
}
|
|
269
404
|
};
|
|
270
405
|
|
|
@@ -4,8 +4,6 @@ import { NetflixMirror, PrimeMirror, DisneyMirror } from './netflixmirror/netfli
|
|
|
4
4
|
import { createNetflixMirror, createPrimeMirror, createDisneyMirror } from './netflixmirror/create-netflixmirror';
|
|
5
5
|
import { MultiStream } from './multistream/multistream';
|
|
6
6
|
import { createMultiStream } from './multistream/create-multistream';
|
|
7
|
-
import { HiMovies } from './himovies/himovies';
|
|
8
|
-
import { createHiMovies } from './himovies/create-himovies';
|
|
9
7
|
import { VegaMovies } from './vegamovies/vegamovies';
|
|
10
8
|
import { createVegaMovies } from './vegamovies/create-vegamovies';
|
|
11
9
|
|
|
@@ -14,10 +12,8 @@ export const MOVIES = {
|
|
|
14
12
|
NetflixMirror,
|
|
15
13
|
PrimeMirror,
|
|
16
14
|
DisneyMirror,
|
|
17
|
-
HiMovies,
|
|
18
15
|
VegaMovies,
|
|
19
16
|
MultiStream,
|
|
20
|
-
createHiMovies,
|
|
21
17
|
createMultiMovies,
|
|
22
18
|
createNetflixMirror,
|
|
23
19
|
createPrimeMirror,
|
|
@@ -220,6 +220,7 @@ export function createMultiMovies(ctx: ProviderContext, customBaseURL?: string)
|
|
|
220
220
|
return {
|
|
221
221
|
name: serverName(VIDHIDE_HOSTS.includes(host) ? 'vidhide' : 'streamwish', host),
|
|
222
222
|
url: mirrors.siteUrls[site] + paths[site],
|
|
223
|
+
label: host,
|
|
223
224
|
};
|
|
224
225
|
});
|
|
225
226
|
return { servers, fileId };
|
|
@@ -98,7 +98,7 @@ export function createMultiStream(ctx: ProviderContext, _customBaseURL?: string,
|
|
|
98
98
|
number: item.episode_number,
|
|
99
99
|
season: item.season_number || season,
|
|
100
100
|
description: item.overview,
|
|
101
|
-
image: tmdbImage(item.still_path),
|
|
101
|
+
image: tmdbImage(item.still_path, 'w300'),
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -10,6 +10,8 @@ import {
|
|
|
10
10
|
} from '../../../models';
|
|
11
11
|
import type { AxiosRequestConfig } from 'axios';
|
|
12
12
|
import { serverName } from '../../common/servers';
|
|
13
|
+
import { PAGE_TTL_MS, ttlCache } from '../../common/ttl-cache';
|
|
14
|
+
import { providerError } from '../../common/errors';
|
|
13
15
|
|
|
14
16
|
type NetMirrorOtt = 'nf' | 'pv' | 'hs';
|
|
15
17
|
|
|
@@ -80,11 +82,19 @@ const NEWTV_API = 'https://tv.imgcdn.kim';
|
|
|
80
82
|
const NEWTV_UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0 /OS.GatuNewTV v1.0';
|
|
81
83
|
|
|
82
84
|
// One verified session works for every catalog, so every instance made from this module shares it:
|
|
83
|
-
// in the library
|
|
84
|
-
//
|
|
85
|
+
// all three catalogs, in the library and in a registry load alike (a manager runs a bundle once per
|
|
86
|
+
// sha256, and the three entries share this one).
|
|
85
87
|
const sessions = new Map<string, { token: string; ts: number }>();
|
|
86
88
|
const pendingUnlocks = new Map<string, Promise<string>>();
|
|
87
89
|
|
|
90
|
+
// A title's NewTV post (post.php), kept when its status is ok, so a search, then that title's info,
|
|
91
|
+
// load it once. The answer depends on the catalog (the Ott header), so it is part of the key.
|
|
92
|
+
const newTvPosts = ttlCache<NewTvPost>({
|
|
93
|
+
ttlMs: PAGE_TTL_MS,
|
|
94
|
+
maxEntries: 32,
|
|
95
|
+
keep: (post) => post?.status === 'ok',
|
|
96
|
+
});
|
|
97
|
+
|
|
88
98
|
interface NetMirrorSearchResult {
|
|
89
99
|
status?: string;
|
|
90
100
|
searchResult?: Array<{ id: string | number; t: string; y?: string; r?: string }>;
|
|
@@ -228,7 +238,7 @@ function createNetMirror(ctx: ProviderContext, platform: NetMirrorPlatform, cust
|
|
|
228
238
|
.join('; ');
|
|
229
239
|
const host = baseUrl.replace(/^https?:\/\//, '').replace(/\/.*$/, '');
|
|
230
240
|
|
|
231
|
-
|
|
241
|
+
const adVisit = axios
|
|
232
242
|
.get(`https://userver.${host}/?hee5=${addhash}&a=y&t=${Math.random()}`, {
|
|
233
243
|
headers: { 'User-Agent': APP_UA, 'Referer': `${baseUrl}/mobile/home?app=1`, 'Cookie': initialCookie },
|
|
234
244
|
maxRedirects: 0,
|
|
@@ -236,6 +246,9 @@ function createNetMirror(ctx: ProviderContext, platform: NetMirrorPlatform, cust
|
|
|
236
246
|
timeout: 10000,
|
|
237
247
|
})
|
|
238
248
|
.catch(() => undefined);
|
|
249
|
+
// The 2 s before the first poll run while the ad visit loads, not after it.
|
|
250
|
+
let firstWait: Promise<unknown> | undefined = sleep(2000);
|
|
251
|
+
await adVisit;
|
|
239
252
|
|
|
240
253
|
// As the app does: ext_name is the id of the site's browser extension, which the poll reports.
|
|
241
254
|
const pollCookie = [
|
|
@@ -248,7 +261,8 @@ function createNetMirror(ctx: ProviderContext, platform: NetMirrorPlatform, cust
|
|
|
248
261
|
|
|
249
262
|
const deadline = Date.now() + UNLOCK_TIMEOUT_MS;
|
|
250
263
|
while (Date.now() < deadline) {
|
|
251
|
-
await sleep(2000);
|
|
264
|
+
await (firstWait || sleep(2000));
|
|
265
|
+
firstWait = undefined;
|
|
252
266
|
const res = await axios
|
|
253
267
|
.post(`${baseUrl}/mobile/verify2.php`, `verify=${encodeURIComponent(addhash)}`, {
|
|
254
268
|
headers: {
|
|
@@ -335,6 +349,12 @@ function createNetMirror(ctx: ProviderContext, platform: NetMirrorPlatform, cust
|
|
|
335
349
|
return data;
|
|
336
350
|
};
|
|
337
351
|
|
|
352
|
+
/** A title's NewTV post, which search and info share (see newTvPosts). */
|
|
353
|
+
const getNewTvPost = (id: string): Promise<NewTvPost> => {
|
|
354
|
+
const path = `post.php?id=${id}`;
|
|
355
|
+
return newTvPosts.get(`${platform.ott}|${NEWTV_API}/newtv/${path}`, () => getNewTv<NewTvPost>(path));
|
|
356
|
+
};
|
|
357
|
+
|
|
338
358
|
const postUrl = (id: string) => `${baseUrl}/mobile/${platform.path}post.php?id=${id}`;
|
|
339
359
|
const playlistUrl = (id: string) => `${baseUrl}/mobile/${platform.path}playlist.php?id=${id}`;
|
|
340
360
|
|
|
@@ -342,7 +362,7 @@ function createNetMirror(ctx: ProviderContext, platform: NetMirrorPlatform, cust
|
|
|
342
362
|
// season count, so fill those in from each title's (session-free) post data.
|
|
343
363
|
const withPostDetails = async (result: IMovieResult): Promise<IMovieResult> => {
|
|
344
364
|
try {
|
|
345
|
-
const post = await
|
|
365
|
+
const post = await getNewTvPost(result.id);
|
|
346
366
|
if (post?.status !== 'ok') return result;
|
|
347
367
|
const isSeries = post.type === 't';
|
|
348
368
|
return {
|
|
@@ -393,7 +413,10 @@ function createNetMirror(ctx: ProviderContext, platform: NetMirrorPlatform, cust
|
|
|
393
413
|
const results = await searchNewTv(query).catch(() => searchViaSession(query));
|
|
394
414
|
return { currentPage: page, hasNextPage: false, results };
|
|
395
415
|
} catch (err) {
|
|
396
|
-
throw
|
|
416
|
+
throw providerError(`${config.name} search failed: ${(err as Error).message}`, {
|
|
417
|
+
provider: config.name,
|
|
418
|
+
cause: err,
|
|
419
|
+
});
|
|
397
420
|
}
|
|
398
421
|
};
|
|
399
422
|
|
|
@@ -472,7 +495,7 @@ function createNetMirror(ctx: ProviderContext, platform: NetMirrorPlatform, cust
|
|
|
472
495
|
};
|
|
473
496
|
|
|
474
497
|
const fetchMediaInfoNewTv = async (mediaId: string): Promise<IMovieInfo> => {
|
|
475
|
-
const post = await
|
|
498
|
+
const post = await getNewTvPost(mediaId);
|
|
476
499
|
if (post?.status !== 'ok') throw new Error('NewTV title unavailable');
|
|
477
500
|
|
|
478
501
|
const detail = (key: string) => post.moredetails?.find((d) => d.k === key)?.v;
|
|
@@ -553,14 +576,23 @@ function createNetMirror(ctx: ProviderContext, platform: NetMirrorPlatform, cust
|
|
|
553
576
|
try {
|
|
554
577
|
return await fetchMediaInfoNewTv(mediaId).catch(() => fetchMediaInfoViaSession(mediaId));
|
|
555
578
|
} catch (err) {
|
|
556
|
-
throw
|
|
579
|
+
throw providerError(`${config.name} fetchMediaInfo failed: ${(err as Error).message}`, {
|
|
580
|
+
provider: config.name,
|
|
581
|
+
cause: err,
|
|
582
|
+
});
|
|
557
583
|
}
|
|
558
584
|
};
|
|
559
585
|
|
|
560
586
|
const playlistPath = (episodeId: string) => `/mobile/${platform.path}playlist.php?id=${episodeId}&t=x&tm=${now()}`;
|
|
561
587
|
|
|
562
588
|
const fetchEpisodeServers = async (episodeId: string, _mediaId?: string): Promise<IEpisodeServer[]> => {
|
|
563
|
-
return [
|
|
589
|
+
return [
|
|
590
|
+
{
|
|
591
|
+
name: serverName('netmirror', platform.label),
|
|
592
|
+
url: `${baseUrl}${playlistPath(episodeId)}`,
|
|
593
|
+
label: platform.label,
|
|
594
|
+
},
|
|
595
|
+
];
|
|
564
596
|
};
|
|
565
597
|
|
|
566
598
|
const qualityFromLabel = (label: string): string => {
|
|
@@ -625,7 +657,10 @@ function createNetMirror(ctx: ProviderContext, platform: NetMirrorPlatform, cust
|
|
|
625
657
|
subtitles,
|
|
626
658
|
};
|
|
627
659
|
} catch (err) {
|
|
628
|
-
throw
|
|
660
|
+
throw providerError(`${config.name} fetchEpisodeSources failed: ${(err as Error).message}`, {
|
|
661
|
+
provider: config.name,
|
|
662
|
+
cause: err,
|
|
663
|
+
});
|
|
629
664
|
}
|
|
630
665
|
};
|
|
631
666
|
|
|
@@ -637,7 +672,10 @@ function createNetMirror(ctx: ProviderContext, platform: NetMirrorPlatform, cust
|
|
|
637
672
|
const { data } = await axios.get<string>(master.url, { headers, responseType: 'text' });
|
|
638
673
|
return data;
|
|
639
674
|
} catch (err) {
|
|
640
|
-
throw
|
|
675
|
+
throw providerError(`${config.name} fetchHlsPlaylist failed: ${(err as Error).message}`, {
|
|
676
|
+
provider: config.name,
|
|
677
|
+
cause: err,
|
|
678
|
+
});
|
|
641
679
|
}
|
|
642
680
|
};
|
|
643
681
|
|
|
@@ -3,8 +3,9 @@ const pathOf = (url: string): string => url.replace(/^https?:\/\/[^/]+/i, '').re
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The id of a page on a movie site: its path below `baseUrl`, without slashes around it
|
|
6
|
-
* (`https://
|
|
7
|
-
* counts, so a custom base URL and links to the
|
|
6
|
+
* (`https://vegamovies.lease/download-breaking-bad-season-1-5/` ->
|
|
7
|
+
* `download-breaking-bad-season-1-5`). Only the path counts, so a custom base URL and links to the
|
|
8
|
+
* site's other domains give the same ids.
|
|
8
9
|
*/
|
|
9
10
|
export function pageId(url: string, baseUrl: string): string {
|
|
10
11
|
const path = pathOf(url);
|