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
|
@@ -1,398 +0,0 @@
|
|
|
1
|
-
import type { CheerioAPI } from 'cheerio';
|
|
2
|
-
import {
|
|
3
|
-
type ISearch,
|
|
4
|
-
type IAnimeInfo,
|
|
5
|
-
type IAnimeResult,
|
|
6
|
-
type ISource,
|
|
7
|
-
type IEpisodeServer,
|
|
8
|
-
type MediaFormat,
|
|
9
|
-
type SubOrDub,
|
|
10
|
-
type WatchListType,
|
|
11
|
-
type ProviderContext,
|
|
12
|
-
type ProviderConfig,
|
|
13
|
-
type ProviderCapabilities,
|
|
14
|
-
} from '../../../models';
|
|
15
|
-
import { toMediaStatus } from '../../common/media-status';
|
|
16
|
-
import { pickServer, serverName } from '../../common/servers';
|
|
17
|
-
import { IST_TZ_OFFSET, cardPage, linkedGenres, pageUrl, siteEpisodeId, toEpisodeId } from '../hianime';
|
|
18
|
-
|
|
19
|
-
const FILTERS = {
|
|
20
|
-
type: { movie: 1, tv: 2, ova: 3, ona: 4, special: 5, music: 6 },
|
|
21
|
-
status: { finished_airing: 1, currently_airing: 2, not_yet_aired: 3 },
|
|
22
|
-
rated: { g: 1, pg: 2, pg_13: 3, r: 4, r_plus: 5, rx: 6 },
|
|
23
|
-
season: { spring: 1, summer: 2, fall: 3, winter: 4 },
|
|
24
|
-
language: { sub: 1, dub: 2, sub_dub: 3 },
|
|
25
|
-
genre: {
|
|
26
|
-
action: 1,
|
|
27
|
-
adventure: 2,
|
|
28
|
-
cars: 3,
|
|
29
|
-
comedy: 4,
|
|
30
|
-
dementia: 5,
|
|
31
|
-
demons: 6,
|
|
32
|
-
mystery: 7,
|
|
33
|
-
drama: 8,
|
|
34
|
-
ecchi: 9,
|
|
35
|
-
fantasy: 10,
|
|
36
|
-
game: 11,
|
|
37
|
-
historical: 12,
|
|
38
|
-
horror: 13,
|
|
39
|
-
kids: 14,
|
|
40
|
-
magic: 15,
|
|
41
|
-
martial_arts: 16,
|
|
42
|
-
mecha: 17,
|
|
43
|
-
music: 18,
|
|
44
|
-
parody: 19,
|
|
45
|
-
samurai: 20,
|
|
46
|
-
romance: 21,
|
|
47
|
-
school: 22,
|
|
48
|
-
sci_fi: 23,
|
|
49
|
-
shoujo: 24,
|
|
50
|
-
shoujo_ai: 25,
|
|
51
|
-
shounen: 26,
|
|
52
|
-
shounen_ai: 27,
|
|
53
|
-
space: 28,
|
|
54
|
-
sports: 29,
|
|
55
|
-
super_power: 30,
|
|
56
|
-
vampire: 31,
|
|
57
|
-
harem: 32,
|
|
58
|
-
slice_of_life: 33,
|
|
59
|
-
supernatural: 34,
|
|
60
|
-
military: 35,
|
|
61
|
-
police: 36,
|
|
62
|
-
psychological: 37,
|
|
63
|
-
thriller: 38,
|
|
64
|
-
seinen: 39,
|
|
65
|
-
josei: 40,
|
|
66
|
-
isekai: 41,
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const filterId = (filter: Record<string, number>, value?: string): number | undefined =>
|
|
71
|
-
value ? filter[value] : undefined;
|
|
72
|
-
|
|
73
|
-
const isoDate = (date: { year: number; month: number; day: number }) =>
|
|
74
|
-
`${date.year}-${date.month.toString().padStart(2, '0')}-${date.day.toString().padStart(2, '0')}`;
|
|
75
|
-
|
|
76
|
-
export function createZoro(ctx: ProviderContext, customBaseURL?: string) {
|
|
77
|
-
const { axios, load, extractors, enums, createCustomBaseUrl, PolyURL, PolyURLSearchParams } = ctx;
|
|
78
|
-
const { MegaCloud } = extractors;
|
|
79
|
-
const { SubOrDub: SubOrDubEnum, WatchListType: WatchListTypeEnum } = enums;
|
|
80
|
-
|
|
81
|
-
const baseUrl = createCustomBaseUrl('https://hianime.to', customBaseURL);
|
|
82
|
-
|
|
83
|
-
const config: ProviderConfig = {
|
|
84
|
-
name: 'Zoro',
|
|
85
|
-
languages: 'en',
|
|
86
|
-
classPath: 'ANIME.Zoro',
|
|
87
|
-
logo: 'https://hianime.to/images/icons-512.png',
|
|
88
|
-
baseUrl,
|
|
89
|
-
isNSFW: false,
|
|
90
|
-
isWorking: true,
|
|
91
|
-
isDubAvailableSeparately: true,
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const scrapeCard = ($: CheerioAPI): IAnimeResult[] =>
|
|
95
|
-
$('.flw-item')
|
|
96
|
-
.toArray()
|
|
97
|
-
.map((ele) => {
|
|
98
|
-
const card = $(ele);
|
|
99
|
-
const atag = card.find('.film-name a');
|
|
100
|
-
const watchList = card.find('.dropdown-menu .added').text().trim() as WatchListType;
|
|
101
|
-
const type = card
|
|
102
|
-
.find('.fdi-item')
|
|
103
|
-
?.first()
|
|
104
|
-
?.text()
|
|
105
|
-
.replace(' (? eps)', '')
|
|
106
|
-
.replace(/\s\(\d+ eps\)/g, '');
|
|
107
|
-
return {
|
|
108
|
-
id: atag.attr('href')?.split('/')[1]!.split('?')[0]!,
|
|
109
|
-
title: atag.text(),
|
|
110
|
-
url: `${baseUrl}${atag.attr('href')}`,
|
|
111
|
-
image: card.find('img')?.attr('data-src'),
|
|
112
|
-
duration: card.find('.fdi-duration')?.text(),
|
|
113
|
-
watchList: watchList || WatchListTypeEnum.NONE,
|
|
114
|
-
japaneseTitle: atag.attr('data-jname'),
|
|
115
|
-
type: type as MediaFormat,
|
|
116
|
-
nsfw: card.find('.tick-rate')?.text() === '18+',
|
|
117
|
-
sub: parseInt(card.find('.tick-item.tick-sub')?.text()) || 0,
|
|
118
|
-
dub: parseInt(card.find('.tick-item.tick-dub')?.text()) || 0,
|
|
119
|
-
episodes: parseInt(card.find('.tick-item.tick-eps')?.text()) || 0,
|
|
120
|
-
};
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
/** Page `page` of the listing at `path` (`/top-airing`, `/search?keyword=…`). */
|
|
124
|
-
const scrapeCardPage = async (path: string, page: number): Promise<ISearch<IAnimeResult>> => {
|
|
125
|
-
const { data } = await axios.get(pageUrl(`${baseUrl}${path}`, page));
|
|
126
|
-
const $ = load(data);
|
|
127
|
-
return cardPage($, scrapeCard($), page);
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
/** The cards in the HTML an ajax endpoint answers with (`{ html }`). */
|
|
131
|
-
const scrapeAjaxCards = async (path: string): Promise<IAnimeResult[]> => {
|
|
132
|
-
const { data } = await axios.get(`${baseUrl}${path}`);
|
|
133
|
-
return scrapeCard(load(data.html));
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const search = async (query: string, page: number = 1): Promise<ISearch<IAnimeResult>> =>
|
|
137
|
-
scrapeCardPage(`/search?keyword=${encodeURIComponent(query)}`, page);
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Search with filters; each is optional.
|
|
141
|
-
*
|
|
142
|
-
* @param type one of: movie, tv, ova, ona, special, music
|
|
143
|
-
* @param status one of: finished_airing, currently_airing, not_yet_aired
|
|
144
|
-
* @param rated one of: g, pg, pg_13, r, r_plus, rx
|
|
145
|
-
* @param score a number from 1 to 10
|
|
146
|
-
* @param season one of: spring, summer, fall, winter
|
|
147
|
-
* @param language one of: sub, dub, sub_dub
|
|
148
|
-
* @param sort one of: recently_added, recently_updated, score, name_az, released_date, most_watched
|
|
149
|
-
* @param genres any of: action, adventure, cars, comedy, dementia, demons, mystery, drama, ecchi, fantasy, game,
|
|
150
|
-
* historical, horror, kids, magic, martial_arts, mecha, music, parody, samurai, romance, school, sci_fi, shoujo,
|
|
151
|
-
* shoujo_ai, shounen, shounen_ai, space, sports, super_power, vampire, harem, military, slice_of_life,
|
|
152
|
-
* supernatural, police, psychological, thriller, seinen, isekai, josei
|
|
153
|
-
*/
|
|
154
|
-
const fetchAdvancedSearch = async (
|
|
155
|
-
page: number = 1,
|
|
156
|
-
type?: string,
|
|
157
|
-
status?: string,
|
|
158
|
-
rated?: string,
|
|
159
|
-
score?: number,
|
|
160
|
-
season?: string,
|
|
161
|
-
language?: string,
|
|
162
|
-
startDate?: { year: number; month: number; day: number },
|
|
163
|
-
endDate?: { year: number; month: number; day: number },
|
|
164
|
-
sort?: string,
|
|
165
|
-
genres?: string[]
|
|
166
|
-
): Promise<ISearch<IAnimeResult>> => {
|
|
167
|
-
const genreIds = (genres ?? []).map((genre) => filterId(FILTERS.genre, genre)).filter(Boolean);
|
|
168
|
-
const filters: Array<[string, string | number | undefined]> = [
|
|
169
|
-
['type', filterId(FILTERS.type, type)],
|
|
170
|
-
['status', filterId(FILTERS.status, status)],
|
|
171
|
-
['rated', filterId(FILTERS.rated, rated)],
|
|
172
|
-
['score', score],
|
|
173
|
-
['season', filterId(FILTERS.season, season)],
|
|
174
|
-
['language', filterId(FILTERS.language, language)],
|
|
175
|
-
['sort', sort],
|
|
176
|
-
['start_date', startDate && isoDate(startDate)],
|
|
177
|
-
['end_date', endDate && isoDate(endDate)],
|
|
178
|
-
['genres', genreIds.join(',')],
|
|
179
|
-
];
|
|
180
|
-
const params = new PolyURLSearchParams();
|
|
181
|
-
for (const [key, value] of filters) if (value) params.append(key, String(value));
|
|
182
|
-
|
|
183
|
-
const query = params.toString();
|
|
184
|
-
return scrapeCardPage(query ? `/filter?${query}` : '/filter', page);
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
const fetchTopAiring = async (page: number = 1) => scrapeCardPage('/top-airing', page);
|
|
188
|
-
const fetchMostPopular = async (page: number = 1) => scrapeCardPage('/most-popular', page);
|
|
189
|
-
const fetchMostFavorite = async (page: number = 1) => scrapeCardPage('/most-favorite', page);
|
|
190
|
-
const fetchLatestCompleted = async (page: number = 1) => scrapeCardPage('/completed', page);
|
|
191
|
-
const fetchRecentlyUpdated = async (page: number = 1) => scrapeCardPage('/recently-updated', page);
|
|
192
|
-
const fetchRecentlyAdded = async (page: number = 1) => scrapeCardPage('/recently-added', page);
|
|
193
|
-
const fetchTopUpcoming = async (page: number = 1) => scrapeCardPage('/top-upcoming', page);
|
|
194
|
-
/** @param studio the studio's id, e.g. "toei-animation" */
|
|
195
|
-
const fetchStudio = async (studio: string, page: number = 1) => scrapeCardPage(`/producer/${studio}`, page);
|
|
196
|
-
const fetchSubbedAnime = async (page: number = 1) => scrapeCardPage('/subbed-anime', page);
|
|
197
|
-
const fetchDubbedAnime = async (page: number = 1) => scrapeCardPage('/dubbed-anime', page);
|
|
198
|
-
const fetchMovie = async (page: number = 1) => scrapeCardPage('/movie', page);
|
|
199
|
-
const fetchTV = async (page: number = 1) => scrapeCardPage('/tv', page);
|
|
200
|
-
const fetchOVA = async (page: number = 1) => scrapeCardPage('/ova', page);
|
|
201
|
-
const fetchONA = async (page: number = 1) => scrapeCardPage('/ona', page);
|
|
202
|
-
const fetchSpecial = async (page: number = 1) => scrapeCardPage('/special', page);
|
|
203
|
-
/** The genres the home page links to, by name; genreSearch takes their slugs. */
|
|
204
|
-
const fetchGenres = async (): Promise<string[]> => linkedGenres(load((await axios.get(`${baseUrl}/home`)).data));
|
|
205
|
-
const genreSearch = async (genre: string, page: number = 1) => scrapeCardPage(`/genre/${genre}`, page);
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* The anime airing on a day.
|
|
209
|
-
* @param date `YYYY-MM-DD`; airing times are in IST (UTC+5:30)
|
|
210
|
-
*/
|
|
211
|
-
const fetchSchedule = async (date: string): Promise<IAnimeResult[]> =>
|
|
212
|
-
scrapeAjaxCards(`/ajax/schedule/list?tzOffset=${IST_TZ_OFFSET}&date=${date}`);
|
|
213
|
-
|
|
214
|
-
const fetchSpotlight = async (): Promise<IAnimeResult[]> => {
|
|
215
|
-
const { data } = await axios.get(baseUrl);
|
|
216
|
-
const $ = load(data);
|
|
217
|
-
const results: IAnimeResult[] = [];
|
|
218
|
-
|
|
219
|
-
$('.deslide-item').each((_, element) => {
|
|
220
|
-
const id = $(element).find('a').attr('href')?.split('/')[1] || '';
|
|
221
|
-
const poster =
|
|
222
|
-
$(element)
|
|
223
|
-
.find('.desi-buttons-wrap .btn-secondary')
|
|
224
|
-
.attr('href')
|
|
225
|
-
?.match(/url=([^&]+)/)?.[1] || '';
|
|
226
|
-
if (id) {
|
|
227
|
-
results.push({
|
|
228
|
-
id,
|
|
229
|
-
title: $(element).find('.desi-head-title').text().trim(),
|
|
230
|
-
url: `${baseUrl}/${id}`,
|
|
231
|
-
image: decodeURIComponent(poster),
|
|
232
|
-
description: $(element).find('.desi-description').text().trim(),
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
return results;
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
const fetchSearchSuggestions = async (query: string): Promise<IAnimeResult[]> =>
|
|
241
|
-
scrapeAjaxCards(`/ajax/search/suggest?keyword=${encodeURIComponent(query)}`);
|
|
242
|
-
|
|
243
|
-
/** What the signed-in user is watching; the request needs the site's session cookie. */
|
|
244
|
-
const fetchContinueWatching = async (): Promise<IAnimeResult[]> =>
|
|
245
|
-
scrapeAjaxCards('/ajax/home/widget/continue-watching');
|
|
246
|
-
|
|
247
|
-
/** The signed-in user's watch list of that type; the request needs the site's session cookie. */
|
|
248
|
-
const fetchWatchList = async (watchListType: WatchListType): Promise<IAnimeResult[]> =>
|
|
249
|
-
scrapeAjaxCards(`/ajax/user/watchlist/${watchListType}`);
|
|
250
|
-
|
|
251
|
-
const fetchAnimeInfo = async (id: string): Promise<IAnimeInfo> => {
|
|
252
|
-
const animeUrl = `${baseUrl}/${id}`;
|
|
253
|
-
const { data } = await axios.get(animeUrl);
|
|
254
|
-
const $ = load(data);
|
|
255
|
-
|
|
256
|
-
const info: IAnimeInfo = {
|
|
257
|
-
id: id,
|
|
258
|
-
title: $('.anisc-detail h2.film-name').text().trim(),
|
|
259
|
-
url: animeUrl,
|
|
260
|
-
genres: [],
|
|
261
|
-
totalEpisodes: 0,
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
info.image = $('.film-poster img').attr('src');
|
|
265
|
-
info.description = $('.film-description .text').text().trim();
|
|
266
|
-
|
|
267
|
-
$('.item-list a[href*="/genre/"]').each((_, el) => {
|
|
268
|
-
info.genres?.push($(el).text().trim());
|
|
269
|
-
});
|
|
270
|
-
|
|
271
|
-
$('.anisc-info .item').each((_, item) => {
|
|
272
|
-
const label = $(item).find('.item-head').text().trim().toLowerCase();
|
|
273
|
-
const value =
|
|
274
|
-
$(item).find('.name').text().trim() || $(item).text().replace($(item).find('.item-head').text(), '').trim();
|
|
275
|
-
|
|
276
|
-
if (label.includes('studio')) info.studios = [value];
|
|
277
|
-
if (label.includes('duration')) info.duration = value;
|
|
278
|
-
if (label.includes('status')) info.status = toMediaStatus(value);
|
|
279
|
-
if (label.includes('type')) info.type = value as MediaFormat;
|
|
280
|
-
if (label.includes('score')) info.rating = parseFloat(value);
|
|
281
|
-
if (label.includes('premiered')) info.releaseDate = value;
|
|
282
|
-
if (label.includes('japanese')) info.japaneseTitle = value;
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
const subTick = $('div.film-stats div.tick div.tick-item.tick-sub');
|
|
286
|
-
const dubTick = $('div.film-stats div.tick div.tick-item.tick-dub');
|
|
287
|
-
info.hasSub = subTick.length > 0;
|
|
288
|
-
info.hasDub = dubTick.length > 0;
|
|
289
|
-
if (info.hasSub) info.subOrDub = info.hasDub ? SubOrDubEnum.BOTH : SubOrDubEnum.SUB;
|
|
290
|
-
else if (info.hasDub) info.subOrDub = SubOrDubEnum.DUB;
|
|
291
|
-
|
|
292
|
-
const { data: episodesData } = await axios.get(`${baseUrl}/ajax/v2/episode/list/${id.split('-').pop()}`, {
|
|
293
|
-
headers: {
|
|
294
|
-
'X-Requested-With': 'XMLHttpRequest',
|
|
295
|
-
'Referer': `${baseUrl}/watch/${id}`,
|
|
296
|
-
},
|
|
297
|
-
});
|
|
298
|
-
const $$ = load(episodesData.html);
|
|
299
|
-
|
|
300
|
-
const episodeElements = $$('div.detail-infor-content > div > a');
|
|
301
|
-
const subCount = parseInt(subTick.text().trim()) || 0;
|
|
302
|
-
const dubCount = parseInt(dubTick.text().trim()) || 0;
|
|
303
|
-
|
|
304
|
-
info.totalEpisodes = episodeElements.length;
|
|
305
|
-
info.episodes = episodeElements.toArray().map((el) => {
|
|
306
|
-
const $el = $$(el);
|
|
307
|
-
const href = $el.attr('href') || '';
|
|
308
|
-
const number = parseInt($el.attr('data-number') || '0');
|
|
309
|
-
// href: /watch/<anime id>?ep=<episode id>
|
|
310
|
-
const [animeId = '', episode] = (href.split('/')[2] ?? '').split('?ep=');
|
|
311
|
-
return {
|
|
312
|
-
id: episode ? toEpisodeId(animeId, episode) : animeId,
|
|
313
|
-
number: number,
|
|
314
|
-
title: $el.attr('title'),
|
|
315
|
-
isFiller: $el.hasClass('ssl-item-filler'),
|
|
316
|
-
isSubbed: number <= subCount,
|
|
317
|
-
isDubbed: number <= dubCount,
|
|
318
|
-
url: baseUrl + href,
|
|
319
|
-
};
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
return info;
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
const extractFrom = (embedUrl: string): Promise<ISource> => MegaCloud(ctx).extract(new PolyURL(embedUrl), baseUrl);
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* @param episodeId an episode id from fetchAnimeInfo, or a server's embed URL
|
|
329
|
-
* @param server a server name from fetchEpisodeServers, or the start of one; the first server when omitted
|
|
330
|
-
* @param subOrDub default `SubOrDub.SUB`
|
|
331
|
-
*/
|
|
332
|
-
const fetchEpisodeSources = async (
|
|
333
|
-
episodeId: string,
|
|
334
|
-
server?: string,
|
|
335
|
-
subOrDub: SubOrDub = SubOrDubEnum.SUB
|
|
336
|
-
): Promise<ISource> => {
|
|
337
|
-
if (episodeId.startsWith('http')) return extractFrom(episodeId);
|
|
338
|
-
if (!siteEpisodeId(episodeId)) throw new Error('Invalid episode id');
|
|
339
|
-
|
|
340
|
-
const servers = await fetchEpisodeServers(episodeId, subOrDub);
|
|
341
|
-
return extractFrom(pickServer(servers, server).url);
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
/** @param episodeId an episode id from fetchAnimeInfo, or the site's own episode id */
|
|
345
|
-
const fetchEpisodeServers = async (
|
|
346
|
-
episodeId: string,
|
|
347
|
-
subOrDub: SubOrDub = SubOrDubEnum.SUB
|
|
348
|
-
): Promise<IEpisodeServer[]> => {
|
|
349
|
-
const { data } = await axios.get(
|
|
350
|
-
`${baseUrl}/ajax/v2/episode/servers?episodeId=${siteEpisodeId(episodeId) ?? episodeId}`
|
|
351
|
-
);
|
|
352
|
-
const $ = load(data.html);
|
|
353
|
-
const items = $(`.ps_-block.ps_-block-sub.servers-${subOrDub} > .ps__-list .server-item`).toArray();
|
|
354
|
-
|
|
355
|
-
return Promise.all(
|
|
356
|
-
items.map(async (element) => {
|
|
357
|
-
const { data: source } = await axios.get(
|
|
358
|
-
`${baseUrl}/ajax/v2/episode/sources?id=${$(element).attr('data-id') || ''}`
|
|
359
|
-
);
|
|
360
|
-
return { name: serverName('megacloud', $(element).text()), url: source.link };
|
|
361
|
-
})
|
|
362
|
-
);
|
|
363
|
-
};
|
|
364
|
-
|
|
365
|
-
return {
|
|
366
|
-
...config,
|
|
367
|
-
capabilities: { aniZipEpisodes: true } as ProviderCapabilities,
|
|
368
|
-
search,
|
|
369
|
-
fetchAdvancedSearch,
|
|
370
|
-
fetchTopAiring,
|
|
371
|
-
fetchMostPopular,
|
|
372
|
-
fetchMostFavorite,
|
|
373
|
-
fetchLatestCompleted,
|
|
374
|
-
fetchRecentlyUpdated,
|
|
375
|
-
fetchRecentlyAdded,
|
|
376
|
-
fetchTopUpcoming,
|
|
377
|
-
fetchStudio,
|
|
378
|
-
fetchSubbedAnime,
|
|
379
|
-
fetchDubbedAnime,
|
|
380
|
-
fetchMovie,
|
|
381
|
-
fetchTV,
|
|
382
|
-
fetchOVA,
|
|
383
|
-
fetchONA,
|
|
384
|
-
fetchSpecial,
|
|
385
|
-
fetchGenres,
|
|
386
|
-
genreSearch,
|
|
387
|
-
fetchSchedule,
|
|
388
|
-
fetchSpotlight,
|
|
389
|
-
fetchSearchSuggestions,
|
|
390
|
-
fetchContinueWatching,
|
|
391
|
-
fetchWatchList,
|
|
392
|
-
fetchAnimeInfo,
|
|
393
|
-
fetchEpisodeSources,
|
|
394
|
-
fetchEpisodeServers,
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
export type ZoroProviderInstance = ReturnType<typeof createZoro>;
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import type { AnyNode, CheerioAPI } from 'cheerio';
|
|
2
|
-
import {
|
|
3
|
-
type IMovieInfo,
|
|
4
|
-
type IMovieEpisode,
|
|
5
|
-
type IEpisodeServer,
|
|
6
|
-
type ISource,
|
|
7
|
-
type IMovieResult,
|
|
8
|
-
type ISearch,
|
|
9
|
-
type ProviderContext,
|
|
10
|
-
type ProviderConfig,
|
|
11
|
-
} from '../../../models';
|
|
12
|
-
import { pickServer, serverName } from '../../common/servers';
|
|
13
|
-
import { pageId, pageUrl, querySlug } from '../site-paths';
|
|
14
|
-
|
|
15
|
-
const CARDS = '.film_list-wrap > div.flw-item';
|
|
16
|
-
const PAGINATION = 'div.pre-pagination > nav:nth-child(1) > ul:nth-child(1)';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Reads a card's year-or-season label: movie cards show the year (`2021`), series cards their
|
|
20
|
-
* latest season (`SS 2`), which is how many seasons the series has.
|
|
21
|
-
*/
|
|
22
|
-
const yearOrSeasons = (label: string): { releaseDate?: string; seasons?: number } => {
|
|
23
|
-
const text = label.trim();
|
|
24
|
-
if (text.includes('SS')) return { seasons: parseInt(text.split('SS')[1]!, 10) };
|
|
25
|
-
return isNaN(parseInt(text, 10)) ? {} : { releaseDate: text };
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* HiMovies (himovies.sx). Media ids are page paths such as `tv/watch-vincenzo-67955`.
|
|
30
|
-
* @param customBaseURL site URL to use instead of the default
|
|
31
|
-
*/
|
|
32
|
-
export function createHiMovies(ctx: ProviderContext, customBaseURL?: string) {
|
|
33
|
-
const { load, extractors, enums, axios, createCustomBaseUrl, PolyURL } = ctx;
|
|
34
|
-
const { MegaCloud } = extractors;
|
|
35
|
-
const { TvType: TvTypeEnum } = enums;
|
|
36
|
-
|
|
37
|
-
const baseUrl = createCustomBaseUrl('https://himovies.sx', customBaseURL);
|
|
38
|
-
|
|
39
|
-
const config: ProviderConfig = {
|
|
40
|
-
name: 'HiMovies',
|
|
41
|
-
languages: 'all',
|
|
42
|
-
classPath: 'MOVIES.HiMovies',
|
|
43
|
-
logo: 'https://himovies.sx/images/group_1/theme_1/favicon.png',
|
|
44
|
-
baseUrl,
|
|
45
|
-
isNSFW: false,
|
|
46
|
-
isWorking: true,
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const supportedTypes = new Set([TvTypeEnum.MOVIE, TvTypeEnum.TVSERIES]);
|
|
50
|
-
|
|
51
|
-
const getPage = async (url: string): Promise<CheerioAPI> => load((await axios.get(url)).data);
|
|
52
|
-
|
|
53
|
-
const parseCard = ($: CheerioAPI, el: AnyNode): IMovieResult => {
|
|
54
|
-
const card = $(el);
|
|
55
|
-
const id = pageId(card.find('div.film-poster > a').attr('href') ?? '', baseUrl);
|
|
56
|
-
const link = card.find('div.film-detail .film-name > a');
|
|
57
|
-
const details = card.find('div.film-detail > div.fd-infor');
|
|
58
|
-
// Movies: year, duration. Series: "SS 2", "EPS 16".
|
|
59
|
-
const label = details.find('span:nth-child(1)').text();
|
|
60
|
-
const extent = details.find('span:nth-child(3)').text().trim();
|
|
61
|
-
const type = details.find('span.float-right').text() === 'Movie' ? TvTypeEnum.MOVIE : TvTypeEnum.TVSERIES;
|
|
62
|
-
return {
|
|
63
|
-
id,
|
|
64
|
-
title: link.attr('title') ?? link.text().trim(),
|
|
65
|
-
url: pageUrl(id, baseUrl),
|
|
66
|
-
image: card.find('div.film-poster > img').attr('data-src'),
|
|
67
|
-
type,
|
|
68
|
-
...yearOrSeasons(label),
|
|
69
|
-
...(type === TvTypeEnum.TVSERIES
|
|
70
|
-
? { latestEpisode: extent.replace('EPS', '').trim() || undefined }
|
|
71
|
-
: { duration: extent || undefined }),
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const fetchCardPage = async (url: string, page: number): Promise<ISearch<IMovieResult>> => {
|
|
76
|
-
const $ = await getPage(url);
|
|
77
|
-
const pagination = $(PAGINATION);
|
|
78
|
-
return {
|
|
79
|
-
currentPage: page,
|
|
80
|
-
// The last page's link is the active one
|
|
81
|
-
hasNextPage: pagination.length > 0 && !pagination.children().last().hasClass('active'),
|
|
82
|
-
results: $(CARDS)
|
|
83
|
-
.toArray()
|
|
84
|
-
.map((el) => parseCard($, el)),
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const parseInfoPage = ($: CheerioAPI, url: string): IMovieInfo => {
|
|
89
|
-
const id = pageId(url, baseUrl);
|
|
90
|
-
return {
|
|
91
|
-
id,
|
|
92
|
-
title: $('.heading-name > a:nth-child(1)').text(),
|
|
93
|
-
url,
|
|
94
|
-
// style="background-image: url(https://...);"
|
|
95
|
-
cover: /url\(\s*['"]?([^'")]+)['"]?\s*\)/.exec($('div.cover_follow').attr('style') ?? '')?.[1],
|
|
96
|
-
image: $('.film-poster > img:nth-child(1)').attr('src'),
|
|
97
|
-
description: $('.description').text().trim(),
|
|
98
|
-
type: id.startsWith('tv/') ? TvTypeEnum.TVSERIES : TvTypeEnum.MOVIE,
|
|
99
|
-
releaseDate: $('div.row-line:contains(Released:)').text().replace('Released:', '').trim(),
|
|
100
|
-
genres: $('div.row-line:contains(Genre:) a')
|
|
101
|
-
.map((_, el) => $(el).text().split('&'))
|
|
102
|
-
.get()
|
|
103
|
-
.map((v) => v.trim()),
|
|
104
|
-
casts: $('.row-line:contains(Casts:) a')
|
|
105
|
-
.map((_, el) => $(el).text())
|
|
106
|
-
.get(),
|
|
107
|
-
production: $('.row-line:contains(Production:) a').text().trim(),
|
|
108
|
-
country: $('.row-line:contains(Country:) a').text().trim(),
|
|
109
|
-
duration: $('.row-line:contains(Duration:)').text().replace('Duration:', '').replace(/\s+/g, ' ').trim(),
|
|
110
|
-
rating: parseFloat($('.dp-i-stats > span.item:nth-child(3)').text().replace('IMDB:', '').trim()),
|
|
111
|
-
recommendations: $('section.block_area > div.block_area-content > div.film_list-wrap > div.flw-item')
|
|
112
|
-
.toArray()
|
|
113
|
-
.map((el) => parseCard($, el)),
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
// A series card shows its latest season, not its year. Meta providers (TMDB) match search results
|
|
118
|
-
// on the year, so take it from the title's page.
|
|
119
|
-
const withReleaseYear = async (result: IMovieResult): Promise<IMovieResult> => {
|
|
120
|
-
if (result.releaseDate) return result;
|
|
121
|
-
try {
|
|
122
|
-
const url = pageUrl(result.id, baseUrl);
|
|
123
|
-
const year = new Date(parseInfoPage(await getPage(url), url).releaseDate ?? '').getFullYear();
|
|
124
|
-
return isNaN(year) ? result : { ...result, releaseDate: String(year) };
|
|
125
|
-
} catch {
|
|
126
|
-
// A page that doesn't load leaves the result without a year rather than failing the search.
|
|
127
|
-
return result;
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const search = async (query: string, page: number = 1): Promise<ISearch<IMovieResult>> => {
|
|
132
|
-
const cards = await fetchCardPage(`${baseUrl}/search/${querySlug(query, '-')}?page=${page}`, page);
|
|
133
|
-
return { ...cards, results: await Promise.all(cards.results.map(withReleaseYear)) };
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const fetchSeriesEpisodes = async (uid: string): Promise<IMovieEpisode[]> => {
|
|
137
|
-
const seasonList = await getPage(`${baseUrl}/ajax/season/list/${uid}`);
|
|
138
|
-
const seasonIds = seasonList('.dropdown-menu > a')
|
|
139
|
-
.map((_, el) => seasonList(el).attr('data-id'))
|
|
140
|
-
.get();
|
|
141
|
-
|
|
142
|
-
const episodes: IMovieEpisode[] = [];
|
|
143
|
-
for (let i = 0; i < seasonIds.length; i++) {
|
|
144
|
-
const $ = await getPage(`${baseUrl}/ajax/season/episodes/${seasonIds[i]}`);
|
|
145
|
-
$('.nav > li').each((_, el) => {
|
|
146
|
-
const link = $(el).find('a');
|
|
147
|
-
const id = link.attr('id')!.split('-')[1]!;
|
|
148
|
-
const title = link.attr('title')!;
|
|
149
|
-
episodes.push({
|
|
150
|
-
id,
|
|
151
|
-
title,
|
|
152
|
-
// "Eps 1: Pilot"
|
|
153
|
-
number: parseInt(title.split(':')[0]!.slice(3).trim()),
|
|
154
|
-
season: i + 1,
|
|
155
|
-
url: `${baseUrl}/ajax/episode/servers/${id}`,
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
return episodes;
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
/** @param mediaId media id or page URL */
|
|
163
|
-
const fetchMediaInfo = async (mediaId: string): Promise<IMovieInfo> => {
|
|
164
|
-
const url = pageUrl(mediaId, baseUrl);
|
|
165
|
-
const $ = await getPage(url);
|
|
166
|
-
const info = parseInfoPage($, url);
|
|
167
|
-
const uid = $('.detail_page-watch').attr('data-id')!;
|
|
168
|
-
info.episodes =
|
|
169
|
-
info.type === TvTypeEnum.TVSERIES
|
|
170
|
-
? await fetchSeriesEpisodes(uid)
|
|
171
|
-
: [{ id: uid, title: info.title as string, url: `${baseUrl}/ajax/episode/list/${uid}` }];
|
|
172
|
-
return info;
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* @param episodeId episode id, or the episode's `url` from fetchMediaInfo
|
|
177
|
-
* @param mediaId media id or page URL (found on the movie info object)
|
|
178
|
-
*/
|
|
179
|
-
const fetchEpisodeServers = async (episodeId: string, mediaId: string): Promise<IEpisodeServer[]> => {
|
|
180
|
-
// The site lists a movie's servers under the movie's id, a series episode's under the episode's.
|
|
181
|
-
const list = pageId(mediaId, baseUrl).startsWith('movie/') ? 'list' : 'servers';
|
|
182
|
-
const $ = await getPage(episodeId.startsWith('http') ? episodeId : `${baseUrl}/ajax/episode/${list}/${episodeId}`);
|
|
183
|
-
return Promise.all(
|
|
184
|
-
$('ul.nav > li')
|
|
185
|
-
.toArray()
|
|
186
|
-
.map(async (el) => {
|
|
187
|
-
const link = $(el).find('a');
|
|
188
|
-
const { data } = await axios.get(`${baseUrl}/ajax/episode/sources/${link.attr('data-id')}`);
|
|
189
|
-
// Every server runs the MegaCloud player: "Server UpCloud" -> "megacloud-upcloud"
|
|
190
|
-
return { name: serverName('megacloud', link.attr('title')!.replace(/^\s*server\s+/i, '')), url: data.link };
|
|
191
|
-
})
|
|
192
|
-
);
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* @param episodeId episode id, or a server's embed URL from fetchEpisodeServers
|
|
197
|
-
* @param mediaId media id or page URL
|
|
198
|
-
* @param server a server name from fetchEpisodeServers, or the start of one; the first server when omitted
|
|
199
|
-
*/
|
|
200
|
-
const fetchEpisodeSources = async (episodeId: string, mediaId: string, server?: string): Promise<ISource> => {
|
|
201
|
-
const embedUrl = episodeId.startsWith('http')
|
|
202
|
-
? episodeId
|
|
203
|
-
: pickServer(await fetchEpisodeServers(episodeId, mediaId), server).url;
|
|
204
|
-
return MegaCloud(ctx).extract(new PolyURL(embedUrl), baseUrl);
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
const fetchHomeSection = async (cards: string): Promise<IMovieResult[]> => {
|
|
208
|
-
const $ = await getPage(`${baseUrl}/home`);
|
|
209
|
-
return $(cards)
|
|
210
|
-
.toArray()
|
|
211
|
-
.map((el) => parseCard($, el));
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
const fetchRecentMovies = () =>
|
|
215
|
-
fetchHomeSection(
|
|
216
|
-
'section.block_area:contains("Latest Movies") > div:nth-child(2) > div:nth-child(1) > div.flw-item'
|
|
217
|
-
);
|
|
218
|
-
|
|
219
|
-
const fetchRecentTvShows = () =>
|
|
220
|
-
fetchHomeSection(
|
|
221
|
-
'section.block_area:contains("Latest TV Shows") > div:nth-child(2) > div:nth-child(1) > div.flw-item'
|
|
222
|
-
);
|
|
223
|
-
|
|
224
|
-
const fetchTrendingMovies = () => fetchHomeSection('div#trending-movies div.film_list-wrap div.flw-item');
|
|
225
|
-
|
|
226
|
-
const fetchTrendingTvShows = () => fetchHomeSection('div#trending-tv div.film_list-wrap div.flw-item');
|
|
227
|
-
|
|
228
|
-
/** @param country country code, e.g. `KR` */
|
|
229
|
-
const fetchByCountry = (country: string, page: number = 1) =>
|
|
230
|
-
fetchCardPage(`${baseUrl}/country/${country}/?page=${page}`, page);
|
|
231
|
-
|
|
232
|
-
/** @param genre genre slug, e.g. `drama` */
|
|
233
|
-
const fetchByGenre = (genre: string, page: number = 1) =>
|
|
234
|
-
fetchCardPage(`${baseUrl}/genre/${genre}?page=${page}`, page);
|
|
235
|
-
|
|
236
|
-
return {
|
|
237
|
-
...config,
|
|
238
|
-
supportedTypes,
|
|
239
|
-
search,
|
|
240
|
-
fetchMediaInfo,
|
|
241
|
-
fetchEpisodeSources,
|
|
242
|
-
fetchEpisodeServers,
|
|
243
|
-
fetchRecentMovies,
|
|
244
|
-
fetchRecentTvShows,
|
|
245
|
-
fetchTrendingMovies,
|
|
246
|
-
fetchTrendingTvShows,
|
|
247
|
-
fetchByCountry,
|
|
248
|
-
fetchByGenre,
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
export type HiMoviesProviderInstance = ReturnType<typeof createHiMovies>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { MovieParser } from '../../../models';
|
|
2
|
-
import { providerClass } from '../../provider-class';
|
|
3
|
-
import { createHiMovies } from './create-himovies';
|
|
4
|
-
|
|
5
|
-
export const HiMovies = providerClass(MovieParser, createHiMovies);
|
|
6
|
-
export type HiMovies = InstanceType<typeof HiMovies>;
|