react-native-consumet 3.0.1 → 5.0.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/README.md +1 -1
- package/android/build.gradle +1 -18
- package/android/generated/java/com/consumet/NativeConsumetSpec.java +0 -8
- package/android/generated/jni/RNConsumetSpec-generated.cpp +0 -12
- package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI.h +0 -18
- package/android/src/androidTest/java/com/consumet/TestSupport.kt +12 -6
- package/android/src/androidTest/java/com/consumet/WebViewContractTest.kt +70 -22
- package/android/src/main/AndroidManifest.xml +2 -3
- package/android/src/main/java/com/consumet/ConsumetModule.kt +0 -11
- package/android/src/main/java/com/consumet/DeobfuscatorModule.kt +6 -11
- package/android/src/main/java/com/consumet/HttpClients.kt +26 -0
- package/android/src/main/java/com/consumet/HttpRequestModule.kt +134 -198
- package/android/src/main/java/com/consumet/RequestHeaders.kt +39 -0
- package/android/src/main/java/com/consumet/WebViewTask.kt +33 -23
- package/ios/Consumet.mm +340 -432
- package/ios/RCConsumetSynchronyCache.m +3 -1
- package/ios/generated/ReactCodegen/RNConsumetSpec/RNConsumetSpec-generated.mm +0 -14
- package/ios/generated/ReactCodegen/RNConsumetSpec/RNConsumetSpec.h +0 -6
- package/ios/generated/ReactCodegen/RNConsumetSpecJSI.h +0 -18
- package/lib/commonjs/NativeConsumet.ts +50 -52
- package/lib/commonjs/extension-registry.json +48 -188
- package/lib/commonjs/extension-registry.json.sig +1 -1
- package/lib/commonjs/extractors/file-hosts.js +42 -0
- package/lib/commonjs/extractors/file-hosts.js.map +1 -0
- package/lib/commonjs/extractors/flixcloud.js +25 -60
- package/lib/commonjs/extractors/flixcloud.js.map +1 -1
- package/lib/commonjs/extractors/gofile.js +123 -97
- package/lib/commonjs/extractors/gofile.js.map +1 -1
- package/lib/commonjs/extractors/hls.js +46 -0
- package/lib/commonjs/extractors/hls.js.map +1 -0
- package/lib/commonjs/extractors/hubcloud.js +131 -288
- package/lib/commonjs/extractors/hubcloud.js.map +1 -1
- package/lib/commonjs/extractors/index.js +4 -116
- package/lib/commonjs/extractors/index.js.map +1 -1
- package/lib/commonjs/extractors/kwik.js +15 -49
- package/lib/commonjs/extractors/kwik.js.map +1 -1
- package/lib/commonjs/extractors/megacloud.js +67 -140
- package/lib/commonjs/extractors/megacloud.js.map +1 -1
- package/lib/commonjs/extractors/megaplay.js +78 -128
- package/lib/commonjs/extractors/megaplay.js.map +1 -1
- package/lib/commonjs/extractors/packer.js +40 -0
- package/lib/commonjs/extractors/packer.js.map +1 -0
- package/lib/commonjs/extractors/streamwish.js +47 -103
- package/lib/commonjs/extractors/streamwish.js.map +1 -1
- package/lib/commonjs/extractors/url.js +11 -0
- package/lib/commonjs/extractors/url.js.map +1 -0
- package/lib/commonjs/extractors/vidhide.js +32 -59
- package/lib/commonjs/extractors/vidhide.js.map +1 -1
- package/lib/commonjs/index.js +123 -217
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/anime-parser.js +4 -17
- package/lib/commonjs/models/anime-parser.js.map +1 -1
- package/lib/commonjs/models/base-parser.js.map +1 -1
- package/lib/commonjs/models/base-provider.js +6 -33
- package/lib/commonjs/models/base-provider.js.map +1 -1
- package/lib/commonjs/models/index.js +25 -52
- package/lib/commonjs/models/index.js.map +1 -1
- package/lib/commonjs/models/lightnovel-parser.js.map +1 -1
- package/lib/commonjs/models/manga-parser.js.map +1 -1
- package/lib/commonjs/models/meta-error.js +10 -4
- package/lib/commonjs/models/meta-error.js.map +1 -1
- package/lib/commonjs/models/movie-parser.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 +13 -22
- package/lib/commonjs/models/types.js.map +1 -1
- package/lib/commonjs/models/video-extractor.js +0 -10
- package/lib/commonjs/models/video-extractor.js.map +1 -1
- package/lib/commonjs/providers/anime/anikoto/anikoto.js +3 -182
- package/lib/commonjs/providers/anime/anikoto/anikoto.js.map +1 -1
- package/lib/commonjs/providers/anime/anikoto/create-anikoto.js +319 -436
- package/lib/commonjs/providers/anime/anikoto/create-anikoto.js.map +1 -1
- package/lib/commonjs/providers/anime/anikoto/hianime.js +77 -0
- package/lib/commonjs/providers/anime/anikoto/hianime.js.map +1 -0
- package/lib/commonjs/providers/anime/animepahe/animepahe.js +2 -66
- package/lib/commonjs/providers/anime/animepahe/animepahe.js.map +1 -1
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +259 -190
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/commonjs/providers/anime/helpers.js +16 -0
- package/lib/commonjs/providers/anime/helpers.js.map +1 -0
- package/lib/commonjs/providers/anime/index.js +1 -13
- package/lib/commonjs/providers/anime/index.js.map +1 -1
- package/lib/commonjs/providers/anime/reanime/create-reanime.js +42 -62
- package/lib/commonjs/providers/anime/reanime/create-reanime.js.map +1 -1
- package/lib/commonjs/providers/anime/reanime/reanime.js +2 -27
- package/lib/commonjs/providers/anime/reanime/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/enc-dec.js +9 -0
- package/lib/commonjs/providers/common/enc-dec.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/media-status.js +20 -0
- package/lib/commonjs/providers/common/media-status.js.map +1 -0
- package/lib/commonjs/providers/common/search.js +15 -0
- package/lib/commonjs/providers/common/search.js.map +1 -0
- package/lib/commonjs/providers/common/servers.js +45 -0
- package/lib/commonjs/providers/common/servers.js.map +1 -0
- 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/index.js +2 -3
- package/lib/commonjs/providers/index.js.map +1 -1
- package/lib/commonjs/providers/light-novels/novelupdates.js +49 -98
- package/lib/commonjs/providers/light-novels/novelupdates.js.map +1 -1
- package/lib/commonjs/providers/light-novels/readlightnovels.js +51 -93
- package/lib/commonjs/providers/light-novels/readlightnovels.js.map +1 -1
- package/lib/commonjs/providers/manga/asurascans.js +43 -56
- package/lib/commonjs/providers/manga/asurascans.js.map +1 -1
- package/lib/commonjs/providers/manga/flamescans.js +11 -33
- package/lib/commonjs/providers/manga/flamescans.js.map +1 -1
- package/lib/commonjs/providers/manga/mangadex.js +18 -17
- package/lib/commonjs/providers/manga/mangadex.js.map +1 -1
- package/lib/commonjs/providers/manga/mangahere.js +107 -169
- package/lib/commonjs/providers/manga/mangahere.js.map +1 -1
- package/lib/commonjs/providers/manga/mangakakalot.js +26 -56
- package/lib/commonjs/providers/manga/mangakakalot.js.map +1 -1
- package/lib/commonjs/providers/manga/mangapill.js +82 -120
- package/lib/commonjs/providers/manga/mangapill.js.map +1 -1
- package/lib/commonjs/providers/manga/shared.js +72 -0
- package/lib/commonjs/providers/manga/shared.js.map +1 -0
- package/lib/commonjs/providers/meta/anilist-media.js +252 -0
- package/lib/commonjs/providers/meta/anilist-media.js.map +1 -0
- package/lib/commonjs/providers/meta/anilist.js +435 -842
- package/lib/commonjs/providers/meta/anilist.js.map +1 -1
- package/lib/commonjs/providers/meta/index.js +2 -2
- package/lib/commonjs/providers/meta/index.js.map +1 -1
- package/lib/commonjs/providers/meta/mal.js +139 -323
- package/lib/commonjs/providers/meta/mal.js.map +1 -1
- package/lib/commonjs/providers/meta/shared.js +132 -0
- package/lib/commonjs/providers/meta/shared.js.map +1 -0
- package/lib/commonjs/providers/meta/tmdb.js +251 -298
- package/lib/commonjs/providers/meta/tmdb.js.map +1 -1
- package/lib/commonjs/providers/movies/index.js +7 -15
- package/lib/commonjs/providers/movies/index.js.map +1 -1
- package/lib/commonjs/providers/movies/multimovies/create-multimovies.js +217 -409
- package/lib/commonjs/providers/movies/multimovies/create-multimovies.js.map +1 -1
- package/lib/commonjs/providers/movies/multimovies/multimovies.js +2 -42
- package/lib/commonjs/providers/movies/multimovies/multimovies.js.map +1 -1
- package/lib/commonjs/providers/movies/multistream/create-multistream.js +130 -0
- package/lib/commonjs/providers/movies/multistream/create-multistream.js.map +1 -0
- package/lib/commonjs/providers/movies/multistream/multistream.js +12 -0
- package/lib/commonjs/providers/movies/multistream/multistream.js.map +1 -0
- package/lib/commonjs/providers/movies/multistream/utils.js +330 -406
- package/lib/commonjs/providers/movies/multistream/utils.js.map +1 -1
- package/lib/commonjs/providers/movies/netflixmirror/create-netflixmirror.js +69 -15
- package/lib/commonjs/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -1
- package/lib/commonjs/providers/movies/netflixmirror/netflixmirror.js +6 -15
- package/lib/commonjs/providers/movies/netflixmirror/netflixmirror.js.map +1 -1
- package/lib/commonjs/providers/movies/site-paths.js +34 -0
- package/lib/commonjs/providers/movies/site-paths.js.map +1 -0
- package/lib/commonjs/providers/movies/vegamovies/create-vegamovies.js +474 -654
- package/lib/commonjs/providers/movies/vegamovies/create-vegamovies.js.map +1 -1
- package/lib/commonjs/providers/movies/vegamovies/vegamovies.js +2 -44
- package/lib/commonjs/providers/movies/vegamovies/vegamovies.js.map +1 -1
- package/lib/commonjs/providers/provider-class.js +28 -0
- package/lib/commonjs/providers/provider-class.js.map +1 -0
- package/lib/commonjs/registry-signing-keys.json +6 -0
- package/lib/commonjs/utils/ExtractorManager.js +156 -215
- package/lib/commonjs/utils/ExtractorManager.js.map +1 -1
- package/lib/commonjs/utils/ProviderManager.js +127 -241
- package/lib/commonjs/utils/ProviderManager.js.map +1 -1
- package/lib/commonjs/utils/constants.js +3 -9
- package/lib/commonjs/utils/constants.js.map +1 -1
- package/lib/commonjs/utils/create-extractor-context.js +29 -17
- package/lib/commonjs/utils/create-extractor-context.js.map +1 -1
- package/lib/commonjs/utils/create-provider-context.js +32 -98
- package/lib/commonjs/utils/create-provider-context.js.map +1 -1
- package/lib/commonjs/utils/extension-integrity.js +2 -2
- package/lib/commonjs/utils/extension-integrity.js.map +1 -1
- package/lib/commonjs/utils/extension-modules.js +274 -44
- package/lib/commonjs/utils/extension-modules.js.map +1 -1
- package/lib/commonjs/utils/fetch-with-timeout.js +3 -2
- package/lib/commonjs/utils/fetch-with-timeout.js.map +1 -1
- package/lib/commonjs/utils/meta-http.js +18 -28
- package/lib/commonjs/utils/meta-http.js.map +1 -1
- package/lib/commonjs/utils/registry-schema.js +50 -16
- package/lib/commonjs/utils/registry-schema.js.map +1 -1
- package/lib/commonjs/utils/registry-signature-format.js +43 -0
- package/lib/commonjs/utils/registry-signature-format.js.map +1 -0
- package/lib/commonjs/utils/registry-signature.js +27 -62
- package/lib/commonjs/utils/registry-signature.js.map +1 -1
- package/lib/commonjs/utils/runtime-modules.js +14 -0
- package/lib/commonjs/utils/runtime-modules.js.map +1 -0
- package/lib/commonjs/utils/tmdb.js +185 -0
- package/lib/commonjs/utils/tmdb.js.map +1 -0
- package/lib/commonjs/utils/url-polyfill.js +13 -59
- package/lib/commonjs/utils/url-polyfill.js.map +1 -1
- package/lib/commonjs/utils/utf8.js +52 -0
- package/lib/commonjs/utils/utf8.js.map +1 -0
- package/lib/commonjs/utils/utils.js +23 -326
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/NativeConsumet.ts +50 -52
- package/lib/module/extension-registry.json +48 -188
- package/lib/module/extension-registry.json.sig +1 -1
- package/lib/module/extractors/file-hosts.js +32 -0
- package/lib/module/extractors/file-hosts.js.map +1 -0
- package/lib/module/extractors/flixcloud.js +23 -57
- package/lib/module/extractors/flixcloud.js.map +1 -1
- package/lib/module/extractors/gofile.js +123 -97
- package/lib/module/extractors/gofile.js.map +1 -1
- package/lib/module/extractors/hls.js +41 -0
- package/lib/module/extractors/hls.js.map +1 -0
- package/lib/module/extractors/hubcloud.js +132 -288
- package/lib/module/extractors/hubcloud.js.map +1 -1
- package/lib/module/extractors/index.js +4 -20
- package/lib/module/extractors/index.js.map +1 -1
- package/lib/module/extractors/kwik.js +16 -49
- package/lib/module/extractors/kwik.js.map +1 -1
- package/lib/module/extractors/megacloud.js +68 -140
- package/lib/module/extractors/megacloud.js.map +1 -1
- package/lib/module/extractors/megaplay.js +78 -128
- package/lib/module/extractors/megaplay.js.map +1 -1
- package/lib/module/extractors/packer.js +36 -0
- package/lib/module/extractors/packer.js.map +1 -0
- package/lib/module/extractors/streamwish.js +47 -103
- package/lib/module/extractors/streamwish.js.map +1 -1
- package/lib/module/extractors/url.js +7 -0
- package/lib/module/extractors/url.js.map +1 -0
- package/lib/module/extractors/vidhide.js +32 -59
- package/lib/module/extractors/vidhide.js.map +1 -1
- package/lib/module/index.js +20 -49
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/anime-parser.js +4 -17
- package/lib/module/models/anime-parser.js.map +1 -1
- package/lib/module/models/base-parser.js.map +1 -1
- package/lib/module/models/base-provider.js +6 -33
- package/lib/module/models/base-provider.js.map +1 -1
- package/lib/module/models/index.js +9 -10
- package/lib/module/models/index.js.map +1 -1
- package/lib/module/models/lightnovel-parser.js.map +1 -1
- package/lib/module/models/manga-parser.js.map +1 -1
- package/lib/module/models/meta-error.js +11 -4
- package/lib/module/models/meta-error.js.map +1 -1
- package/lib/module/models/movie-parser.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 +12 -21
- package/lib/module/models/types.js.map +1 -1
- package/lib/module/models/video-extractor.js +1 -9
- package/lib/module/models/video-extractor.js.map +1 -1
- package/lib/module/providers/anime/anikoto/anikoto.js +2 -181
- package/lib/module/providers/anime/anikoto/anikoto.js.map +1 -1
- package/lib/module/providers/anime/anikoto/create-anikoto.js +320 -436
- package/lib/module/providers/anime/anikoto/create-anikoto.js.map +1 -1
- package/lib/module/providers/anime/anikoto/hianime.js +69 -0
- package/lib/module/providers/anime/anikoto/hianime.js.map +1 -0
- package/lib/module/providers/anime/animepahe/animepahe.js +2 -66
- package/lib/module/providers/anime/animepahe/animepahe.js.map +1 -1
- package/lib/module/providers/anime/animepahe/create-animepahe.js +260 -190
- package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/module/providers/anime/helpers.js +12 -0
- package/lib/module/providers/anime/helpers.js.map +1 -0
- package/lib/module/providers/anime/index.js +1 -13
- package/lib/module/providers/anime/index.js.map +1 -1
- package/lib/module/providers/anime/reanime/create-reanime.js +40 -60
- package/lib/module/providers/anime/reanime/create-reanime.js.map +1 -1
- package/lib/module/providers/anime/reanime/reanime.js +2 -26
- package/lib/module/providers/anime/reanime/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/enc-dec.js +5 -0
- package/lib/module/providers/common/enc-dec.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/media-status.js +17 -0
- package/lib/module/providers/common/media-status.js.map +1 -0
- package/lib/module/providers/common/search.js +11 -0
- package/lib/module/providers/common/search.js.map +1 -0
- package/lib/module/providers/common/servers.js +40 -0
- package/lib/module/providers/common/servers.js.map +1 -0
- 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/index.js +5 -6
- package/lib/module/providers/index.js.map +1 -1
- package/lib/module/providers/light-novels/novelupdates.js +51 -99
- package/lib/module/providers/light-novels/novelupdates.js.map +1 -1
- package/lib/module/providers/light-novels/readlightnovels.js +52 -93
- package/lib/module/providers/light-novels/readlightnovels.js.map +1 -1
- package/lib/module/providers/manga/asurascans.js +43 -56
- package/lib/module/providers/manga/asurascans.js.map +1 -1
- package/lib/module/providers/manga/flamescans.js +12 -34
- package/lib/module/providers/manga/flamescans.js.map +1 -1
- package/lib/module/providers/manga/mangadex.js +19 -18
- package/lib/module/providers/manga/mangadex.js.map +1 -1
- package/lib/module/providers/manga/mangahere.js +108 -170
- package/lib/module/providers/manga/mangahere.js.map +1 -1
- package/lib/module/providers/manga/mangakakalot.js +27 -57
- package/lib/module/providers/manga/mangakakalot.js.map +1 -1
- package/lib/module/providers/manga/mangapill.js +83 -122
- package/lib/module/providers/manga/mangapill.js.map +1 -1
- package/lib/module/providers/manga/shared.js +63 -0
- package/lib/module/providers/manga/shared.js.map +1 -0
- package/lib/module/providers/meta/anilist-media.js +239 -0
- package/lib/module/providers/meta/anilist-media.js.map +1 -0
- package/lib/module/providers/meta/anilist.js +429 -837
- package/lib/module/providers/meta/anilist.js.map +1 -1
- package/lib/module/providers/meta/index.js +1 -1
- package/lib/module/providers/meta/index.js.map +1 -1
- package/lib/module/providers/meta/mal.js +136 -322
- package/lib/module/providers/meta/mal.js.map +1 -1
- package/lib/module/providers/meta/shared.js +124 -0
- package/lib/module/providers/meta/shared.js.map +1 -0
- package/lib/module/providers/meta/tmdb.js +251 -299
- package/lib/module/providers/meta/tmdb.js.map +1 -1
- package/lib/module/providers/movies/index.js +5 -13
- package/lib/module/providers/movies/index.js.map +1 -1
- package/lib/module/providers/movies/multimovies/create-multimovies.js +218 -409
- package/lib/module/providers/movies/multimovies/create-multimovies.js.map +1 -1
- package/lib/module/providers/movies/multimovies/multimovies.js +2 -42
- package/lib/module/providers/movies/multimovies/multimovies.js.map +1 -1
- package/lib/module/providers/movies/multistream/create-multistream.js +127 -0
- package/lib/module/providers/movies/multistream/create-multistream.js.map +1 -0
- package/lib/module/providers/movies/multistream/multistream.js +9 -0
- package/lib/module/providers/movies/multistream/multistream.js.map +1 -0
- package/lib/module/providers/movies/multistream/utils.js +325 -397
- package/lib/module/providers/movies/multistream/utils.js.map +1 -1
- package/lib/module/providers/movies/netflixmirror/create-netflixmirror.js +69 -15
- package/lib/module/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -1
- package/lib/module/providers/movies/netflixmirror/netflixmirror.js +6 -14
- package/lib/module/providers/movies/netflixmirror/netflixmirror.js.map +1 -1
- package/lib/module/providers/movies/site-paths.js +28 -0
- package/lib/module/providers/movies/site-paths.js.map +1 -0
- package/lib/module/providers/movies/vegamovies/create-vegamovies.js +474 -654
- package/lib/module/providers/movies/vegamovies/create-vegamovies.js.map +1 -1
- package/lib/module/providers/movies/vegamovies/vegamovies.js +2 -44
- package/lib/module/providers/movies/vegamovies/vegamovies.js.map +1 -1
- package/lib/module/providers/provider-class.js +25 -0
- package/lib/module/providers/provider-class.js.map +1 -0
- package/lib/module/registry-signing-keys.json +6 -0
- package/lib/module/utils/ExtractorManager.js +155 -215
- package/lib/module/utils/ExtractorManager.js.map +1 -1
- package/lib/module/utils/ProviderManager.js +128 -241
- package/lib/module/utils/ProviderManager.js.map +1 -1
- package/lib/module/utils/constants.js +2 -8
- package/lib/module/utils/constants.js.map +1 -1
- package/lib/module/utils/create-extractor-context.js +28 -18
- package/lib/module/utils/create-extractor-context.js.map +1 -1
- package/lib/module/utils/create-provider-context.js +33 -98
- package/lib/module/utils/create-provider-context.js.map +1 -1
- package/lib/module/utils/extension-integrity.js +1 -1
- package/lib/module/utils/extension-integrity.js.map +1 -1
- package/lib/module/utils/extension-modules.js +270 -44
- package/lib/module/utils/extension-modules.js.map +1 -1
- package/lib/module/utils/fetch-with-timeout.js +3 -2
- package/lib/module/utils/fetch-with-timeout.js.map +1 -1
- package/lib/module/utils/meta-http.js +17 -26
- package/lib/module/utils/meta-http.js.map +1 -1
- package/lib/module/utils/registry-schema.js +48 -15
- package/lib/module/utils/registry-schema.js.map +1 -1
- package/lib/module/utils/registry-signature-format.js +37 -0
- package/lib/module/utils/registry-signature-format.js.map +1 -0
- package/lib/module/utils/registry-signature.js +23 -58
- package/lib/module/utils/registry-signature.js.map +1 -1
- package/lib/module/utils/runtime-modules.js +10 -0
- package/lib/module/utils/runtime-modules.js.map +1 -0
- package/lib/module/utils/tmdb.js +172 -0
- package/lib/module/utils/tmdb.js.map +1 -0
- package/lib/module/utils/url-polyfill.js +1 -47
- package/lib/module/utils/url-polyfill.js.map +1 -1
- package/lib/module/utils/utf8.js +45 -0
- package/lib/module/utils/utf8.js.map +1 -0
- package/lib/module/utils/utils.js +16 -281
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts +44 -79
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/file-hosts.d.ts +18 -0
- package/lib/typescript/commonjs/src/extractors/file-hosts.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/extractors/flixcloud.d.ts +9 -9
- package/lib/typescript/commonjs/src/extractors/flixcloud.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/gofile.d.ts +5 -6
- package/lib/typescript/commonjs/src/extractors/gofile.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/hls.d.ts +14 -0
- package/lib/typescript/commonjs/src/extractors/hls.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/extractors/hubcloud.d.ts +8 -4
- package/lib/typescript/commonjs/src/extractors/hubcloud.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/index.d.ts +4 -20
- package/lib/typescript/commonjs/src/extractors/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/kwik.d.ts +6 -7
- package/lib/typescript/commonjs/src/extractors/kwik.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/megacloud.d.ts +7 -5
- package/lib/typescript/commonjs/src/extractors/megacloud.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/megaplay.d.ts +6 -7
- package/lib/typescript/commonjs/src/extractors/megaplay.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/packer.d.ts +3 -0
- package/lib/typescript/commonjs/src/extractors/packer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/extractors/streamwish.d.ts +5 -7
- package/lib/typescript/commonjs/src/extractors/streamwish.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/url.d.ts +4 -0
- package/lib/typescript/commonjs/src/extractors/url.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/extractors/vidhide.d.ts +5 -7
- package/lib/typescript/commonjs/src/extractors/vidhide.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +17 -20
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/anime-parser.d.ts +10 -21
- package/lib/typescript/commonjs/src/models/anime-parser.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/base-parser.d.ts +0 -5
- package/lib/typescript/commonjs/src/models/base-parser.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/base-provider.d.ts +7 -31
- package/lib/typescript/commonjs/src/models/base-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/extension-manifest.d.ts +5 -1
- package/lib/typescript/commonjs/src/models/extension-manifest.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/extractor-context.d.ts +5 -34
- package/lib/typescript/commonjs/src/models/extractor-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/index.d.ts +13 -15
- package/lib/typescript/commonjs/src/models/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/lightnovel-parser.d.ts +5 -12
- package/lib/typescript/commonjs/src/models/lightnovel-parser.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/manga-parser.d.ts +2 -10
- package/lib/typescript/commonjs/src/models/manga-parser.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/meta-error.d.ts +9 -3
- package/lib/typescript/commonjs/src/models/meta-error.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/movie-parser.d.ts +8 -24
- package/lib/typescript/commonjs/src/models/movie-parser.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/provider-context.d.ts +11 -138
- package/lib/typescript/commonjs/src/models/provider-context.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 +43 -39
- package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/video-extractor.d.ts +7 -38
- package/lib/typescript/commonjs/src/models/video-extractor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/anikoto/anikoto.d.ts +4 -148
- package/lib/typescript/commonjs/src/providers/anime/anikoto/anikoto.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/anikoto/create-anikoto.d.ts +2 -2
- package/lib/typescript/commonjs/src/providers/anime/anikoto/create-anikoto.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/anikoto/hianime.d.ts +24 -0
- package/lib/typescript/commonjs/src/providers/anime/anikoto/hianime.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/anime/animepahe/animepahe.d.ts +4 -40
- package/lib/typescript/commonjs/src/providers/anime/animepahe/animepahe.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts +4 -4
- package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/helpers.d.ts +6 -0
- package/lib/typescript/commonjs/src/providers/anime/helpers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/anime/index.d.ts +3 -18
- 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 +2 -2
- package/lib/typescript/commonjs/src/providers/anime/reanime/create-reanime.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/reanime/reanime.d.ts +4 -23
- package/lib/typescript/commonjs/src/providers/anime/reanime/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/enc-dec.d.ts +3 -0
- package/lib/typescript/commonjs/src/providers/common/enc-dec.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/media-status.d.ts +7 -0
- package/lib/typescript/commonjs/src/providers/common/media-status.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/common/search.d.ts +4 -0
- package/lib/typescript/commonjs/src/providers/common/search.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/common/servers.d.ts +17 -0
- package/lib/typescript/commonjs/src/providers/common/servers.d.ts.map +1 -0
- 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/index.d.ts +5 -6
- package/lib/typescript/commonjs/src/providers/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/light-novels/novelupdates.d.ts +11 -12
- package/lib/typescript/commonjs/src/providers/light-novels/novelupdates.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/light-novels/readlightnovels.d.ts +3 -11
- package/lib/typescript/commonjs/src/providers/light-novels/readlightnovels.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/asurascans.d.ts +1 -5
- package/lib/typescript/commonjs/src/providers/manga/asurascans.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/flamescans.d.ts +2 -4
- package/lib/typescript/commonjs/src/providers/manga/flamescans.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangadex.d.ts +6 -4
- package/lib/typescript/commonjs/src/providers/manga/mangadex.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangahere.d.ts +4 -4
- package/lib/typescript/commonjs/src/providers/manga/mangahere.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangakakalot.d.ts +4 -13
- package/lib/typescript/commonjs/src/providers/manga/mangakakalot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangapill.d.ts +1 -8
- package/lib/typescript/commonjs/src/providers/manga/mangapill.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/shared.d.ts +28 -0
- package/lib/typescript/commonjs/src/providers/manga/shared.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/meta/anilist-media.d.ts +188 -0
- package/lib/typescript/commonjs/src/providers/meta/anilist-media.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts +90 -131
- package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/index.d.ts +1 -2
- package/lib/typescript/commonjs/src/providers/meta/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/mal.d.ts +12 -18
- package/lib/typescript/commonjs/src/providers/meta/mal.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/shared.d.ts +48 -0
- package/lib/typescript/commonjs/src/providers/meta/shared.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/meta/tmdb.d.ts +77 -26
- package/lib/typescript/commonjs/src/providers/meta/tmdb.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/index.d.ts +8 -20
- 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 +8 -3
- package/lib/typescript/commonjs/src/providers/movies/multimovies/create-multimovies.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/multimovies/multimovies.d.ts +4 -25
- package/lib/typescript/commonjs/src/providers/movies/multimovies/multimovies.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/multistream/create-multistream.d.ts +26 -0
- package/lib/typescript/commonjs/src/providers/movies/multistream/create-multistream.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/multistream/multistream.d.ts +6 -0
- package/lib/typescript/commonjs/src/providers/movies/multistream/multistream.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts +21 -19
- package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/create-netflixmirror.d.ts +40 -8
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/create-netflixmirror.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/netflixmirror.d.ts +8 -11
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/netflixmirror.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/site-paths.d.ts +12 -0
- package/lib/typescript/commonjs/src/providers/movies/site-paths.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/vegamovies/create-vegamovies.d.ts +9 -3
- package/lib/typescript/commonjs/src/providers/movies/vegamovies/create-vegamovies.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/vegamovies/vegamovies.d.ts +4 -27
- package/lib/typescript/commonjs/src/providers/movies/vegamovies/vegamovies.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/provider-class.d.ts +23 -0
- package/lib/typescript/commonjs/src/providers/provider-class.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/ExtractorManager.d.ts +57 -49
- package/lib/typescript/commonjs/src/utils/ExtractorManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts +50 -69
- package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/constants.d.ts +2 -7
- package/lib/typescript/commonjs/src/utils/constants.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/create-extractor-context.d.ts +17 -5
- package/lib/typescript/commonjs/src/utils/create-extractor-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/create-provider-context.d.ts +12 -8
- package/lib/typescript/commonjs/src/utils/create-provider-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/extension-integrity.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/extension-modules.d.ts +74 -24
- package/lib/typescript/commonjs/src/utils/extension-modules.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/fetch-with-timeout.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/fetch-with-timeout.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/meta-http.d.ts +2 -13
- package/lib/typescript/commonjs/src/utils/meta-http.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/registry-schema.d.ts +27 -1
- package/lib/typescript/commonjs/src/utils/registry-schema.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/registry-signature-format.d.ts +15 -0
- package/lib/typescript/commonjs/src/utils/registry-signature-format.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/registry-signature.d.ts +10 -4
- package/lib/typescript/commonjs/src/utils/registry-signature.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/runtime-modules.d.ts +8 -0
- package/lib/typescript/commonjs/src/utils/runtime-modules.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/tmdb.d.ts +86 -0
- package/lib/typescript/commonjs/src/utils/tmdb.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/url-polyfill.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/utf8.d.ts +7 -0
- package/lib/typescript/commonjs/src/utils/utf8.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/utils.d.ts +12 -36
- package/lib/typescript/commonjs/src/utils/utils.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeConsumet.d.ts +44 -79
- package/lib/typescript/module/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/file-hosts.d.ts +18 -0
- package/lib/typescript/module/src/extractors/file-hosts.d.ts.map +1 -0
- package/lib/typescript/module/src/extractors/flixcloud.d.ts +9 -9
- package/lib/typescript/module/src/extractors/flixcloud.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/gofile.d.ts +5 -6
- package/lib/typescript/module/src/extractors/gofile.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/hls.d.ts +14 -0
- package/lib/typescript/module/src/extractors/hls.d.ts.map +1 -0
- package/lib/typescript/module/src/extractors/hubcloud.d.ts +8 -4
- package/lib/typescript/module/src/extractors/hubcloud.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/index.d.ts +4 -20
- package/lib/typescript/module/src/extractors/index.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/kwik.d.ts +6 -7
- package/lib/typescript/module/src/extractors/kwik.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/megacloud.d.ts +7 -5
- package/lib/typescript/module/src/extractors/megacloud.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/megaplay.d.ts +6 -7
- package/lib/typescript/module/src/extractors/megaplay.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/packer.d.ts +3 -0
- package/lib/typescript/module/src/extractors/packer.d.ts.map +1 -0
- package/lib/typescript/module/src/extractors/streamwish.d.ts +5 -7
- package/lib/typescript/module/src/extractors/streamwish.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/url.d.ts +4 -0
- package/lib/typescript/module/src/extractors/url.d.ts.map +1 -0
- package/lib/typescript/module/src/extractors/vidhide.d.ts +5 -7
- package/lib/typescript/module/src/extractors/vidhide.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +17 -20
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/anime-parser.d.ts +10 -21
- package/lib/typescript/module/src/models/anime-parser.d.ts.map +1 -1
- package/lib/typescript/module/src/models/base-parser.d.ts +0 -5
- package/lib/typescript/module/src/models/base-parser.d.ts.map +1 -1
- package/lib/typescript/module/src/models/base-provider.d.ts +7 -31
- package/lib/typescript/module/src/models/base-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/models/extension-manifest.d.ts +5 -1
- package/lib/typescript/module/src/models/extension-manifest.d.ts.map +1 -1
- package/lib/typescript/module/src/models/extractor-context.d.ts +5 -34
- package/lib/typescript/module/src/models/extractor-context.d.ts.map +1 -1
- package/lib/typescript/module/src/models/index.d.ts +13 -15
- package/lib/typescript/module/src/models/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/lightnovel-parser.d.ts +5 -12
- package/lib/typescript/module/src/models/lightnovel-parser.d.ts.map +1 -1
- package/lib/typescript/module/src/models/manga-parser.d.ts +2 -10
- package/lib/typescript/module/src/models/manga-parser.d.ts.map +1 -1
- package/lib/typescript/module/src/models/meta-error.d.ts +9 -3
- package/lib/typescript/module/src/models/meta-error.d.ts.map +1 -1
- package/lib/typescript/module/src/models/movie-parser.d.ts +8 -24
- package/lib/typescript/module/src/models/movie-parser.d.ts.map +1 -1
- package/lib/typescript/module/src/models/provider-context.d.ts +11 -138
- package/lib/typescript/module/src/models/provider-context.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 +43 -39
- package/lib/typescript/module/src/models/types.d.ts.map +1 -1
- package/lib/typescript/module/src/models/video-extractor.d.ts +7 -38
- package/lib/typescript/module/src/models/video-extractor.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/anikoto/anikoto.d.ts +4 -148
- package/lib/typescript/module/src/providers/anime/anikoto/anikoto.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/anikoto/create-anikoto.d.ts +2 -2
- package/lib/typescript/module/src/providers/anime/anikoto/create-anikoto.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/anikoto/hianime.d.ts +24 -0
- package/lib/typescript/module/src/providers/anime/anikoto/hianime.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/anime/animepahe/animepahe.d.ts +4 -40
- package/lib/typescript/module/src/providers/anime/animepahe/animepahe.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts +4 -4
- package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/helpers.d.ts +6 -0
- package/lib/typescript/module/src/providers/anime/helpers.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/anime/index.d.ts +3 -18
- 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 +2 -2
- package/lib/typescript/module/src/providers/anime/reanime/create-reanime.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/reanime/reanime.d.ts +4 -23
- package/lib/typescript/module/src/providers/anime/reanime/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/enc-dec.d.ts +3 -0
- package/lib/typescript/module/src/providers/common/enc-dec.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/media-status.d.ts +7 -0
- package/lib/typescript/module/src/providers/common/media-status.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/common/search.d.ts +4 -0
- package/lib/typescript/module/src/providers/common/search.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/common/servers.d.ts +17 -0
- package/lib/typescript/module/src/providers/common/servers.d.ts.map +1 -0
- 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/index.d.ts +5 -6
- package/lib/typescript/module/src/providers/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/light-novels/novelupdates.d.ts +11 -12
- package/lib/typescript/module/src/providers/light-novels/novelupdates.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/light-novels/readlightnovels.d.ts +3 -11
- package/lib/typescript/module/src/providers/light-novels/readlightnovels.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/asurascans.d.ts +1 -5
- package/lib/typescript/module/src/providers/manga/asurascans.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/flamescans.d.ts +2 -4
- package/lib/typescript/module/src/providers/manga/flamescans.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangadex.d.ts +6 -4
- package/lib/typescript/module/src/providers/manga/mangadex.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangahere.d.ts +4 -4
- package/lib/typescript/module/src/providers/manga/mangahere.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangakakalot.d.ts +4 -13
- package/lib/typescript/module/src/providers/manga/mangakakalot.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangapill.d.ts +1 -8
- package/lib/typescript/module/src/providers/manga/mangapill.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/shared.d.ts +28 -0
- package/lib/typescript/module/src/providers/manga/shared.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/meta/anilist-media.d.ts +188 -0
- package/lib/typescript/module/src/providers/meta/anilist-media.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/meta/anilist.d.ts +90 -131
- package/lib/typescript/module/src/providers/meta/anilist.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/index.d.ts +1 -2
- package/lib/typescript/module/src/providers/meta/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/mal.d.ts +12 -18
- package/lib/typescript/module/src/providers/meta/mal.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/shared.d.ts +48 -0
- package/lib/typescript/module/src/providers/meta/shared.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/meta/tmdb.d.ts +77 -26
- package/lib/typescript/module/src/providers/meta/tmdb.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/index.d.ts +8 -20
- 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 +8 -3
- package/lib/typescript/module/src/providers/movies/multimovies/create-multimovies.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/multimovies/multimovies.d.ts +4 -25
- package/lib/typescript/module/src/providers/movies/multimovies/multimovies.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/multistream/create-multistream.d.ts +26 -0
- package/lib/typescript/module/src/providers/movies/multistream/create-multistream.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/multistream/multistream.d.ts +6 -0
- package/lib/typescript/module/src/providers/movies/multistream/multistream.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts +21 -19
- package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/netflixmirror/create-netflixmirror.d.ts +40 -8
- package/lib/typescript/module/src/providers/movies/netflixmirror/create-netflixmirror.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/netflixmirror/netflixmirror.d.ts +8 -11
- package/lib/typescript/module/src/providers/movies/netflixmirror/netflixmirror.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/site-paths.d.ts +12 -0
- package/lib/typescript/module/src/providers/movies/site-paths.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/vegamovies/create-vegamovies.d.ts +9 -3
- package/lib/typescript/module/src/providers/movies/vegamovies/create-vegamovies.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/vegamovies/vegamovies.d.ts +4 -27
- package/lib/typescript/module/src/providers/movies/vegamovies/vegamovies.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/provider-class.d.ts +23 -0
- package/lib/typescript/module/src/providers/provider-class.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/ExtractorManager.d.ts +57 -49
- package/lib/typescript/module/src/utils/ExtractorManager.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/ProviderManager.d.ts +50 -69
- package/lib/typescript/module/src/utils/ProviderManager.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/constants.d.ts +2 -7
- package/lib/typescript/module/src/utils/constants.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/create-extractor-context.d.ts +17 -5
- package/lib/typescript/module/src/utils/create-extractor-context.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/create-provider-context.d.ts +12 -8
- package/lib/typescript/module/src/utils/create-provider-context.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/extension-integrity.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/extension-modules.d.ts +74 -24
- package/lib/typescript/module/src/utils/extension-modules.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/fetch-with-timeout.d.ts +1 -1
- package/lib/typescript/module/src/utils/fetch-with-timeout.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/meta-http.d.ts +2 -13
- package/lib/typescript/module/src/utils/meta-http.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/registry-schema.d.ts +27 -1
- package/lib/typescript/module/src/utils/registry-schema.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/registry-signature-format.d.ts +15 -0
- package/lib/typescript/module/src/utils/registry-signature-format.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/registry-signature.d.ts +10 -4
- package/lib/typescript/module/src/utils/registry-signature.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/runtime-modules.d.ts +8 -0
- package/lib/typescript/module/src/utils/runtime-modules.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/tmdb.d.ts +86 -0
- package/lib/typescript/module/src/utils/tmdb.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/url-polyfill.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/utf8.d.ts +7 -0
- package/lib/typescript/module/src/utils/utf8.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/utils.d.ts +12 -36
- package/lib/typescript/module/src/utils/utils.d.ts.map +1 -1
- package/package.json +8 -10
- package/src/NativeConsumet.ts +50 -52
- package/src/extension-registry.json +48 -188
- package/src/extension-registry.json.sig +1 -1
- package/src/extractors/file-hosts.ts +29 -0
- package/src/extractors/flixcloud.ts +23 -53
- package/src/extractors/gofile.ts +140 -128
- package/src/extractors/hls.ts +43 -0
- package/src/extractors/hubcloud.ts +147 -331
- package/src/extractors/index.ts +4 -20
- package/src/extractors/kwik.ts +17 -56
- package/src/extractors/megacloud.ts +50 -153
- package/src/extractors/megaplay.ts +77 -147
- package/src/extractors/packer.ts +40 -0
- package/src/extractors/streamwish.ts +50 -122
- package/src/extractors/url.ts +6 -0
- package/src/extractors/vidhide.ts +29 -81
- package/src/index.tsx +51 -228
- package/src/models/anime-parser.ts +12 -21
- package/src/models/base-parser.ts +0 -5
- package/src/models/base-provider.ts +7 -31
- package/src/models/extension-manifest.ts +7 -1
- package/src/models/extractor-context.ts +5 -46
- package/src/models/index.ts +13 -119
- package/src/models/lightnovel-parser.ts +5 -12
- package/src/models/manga-parser.ts +2 -10
- package/src/models/meta-error.ts +12 -5
- package/src/models/movie-parser.ts +9 -24
- package/src/models/provider-context.ts +11 -149
- package/src/models/provider-error.ts +57 -0
- package/src/models/types.ts +40 -41
- package/src/models/video-extractor.ts +7 -43
- package/src/providers/anime/anikoto/anikoto.ts +5 -218
- package/src/providers/anime/anikoto/create-anikoto.ts +321 -510
- package/src/providers/anime/anikoto/hianime.ts +67 -0
- package/src/providers/anime/animepahe/animepahe.ts +5 -78
- package/src/providers/anime/animepahe/create-animepahe.ts +253 -212
- package/src/providers/anime/helpers.ts +9 -0
- package/src/providers/anime/index.ts +0 -12
- package/src/providers/anime/reanime/create-reanime.ts +37 -62
- package/src/providers/anime/reanime/reanime.ts +5 -44
- package/src/providers/common/concurrency.ts +32 -0
- package/src/providers/common/enc-dec.ts +2 -0
- package/src/providers/common/errors.ts +84 -0
- package/src/providers/common/media-status.ts +20 -0
- package/src/providers/common/search.ts +6 -0
- package/src/providers/common/servers.ts +40 -0
- package/src/providers/common/ttl-cache.ts +65 -0
- package/src/providers/index.ts +5 -7
- package/src/providers/light-novels/novelupdates.ts +55 -125
- package/src/providers/light-novels/readlightnovels.ts +81 -117
- package/src/providers/manga/asurascans.ts +46 -64
- package/src/providers/manga/flamescans.ts +11 -44
- package/src/providers/manga/mangadex.ts +15 -23
- package/src/providers/manga/mangahere.ts +112 -188
- package/src/providers/manga/mangakakalot.ts +25 -66
- package/src/providers/manga/mangapill.ts +105 -149
- package/src/providers/manga/shared.ts +71 -0
- package/src/providers/meta/anilist-media.ts +235 -0
- package/src/providers/meta/anilist.ts +460 -892
- package/src/providers/meta/index.ts +1 -1
- package/src/providers/meta/mal.ts +156 -416
- package/src/providers/meta/shared.ts +136 -0
- package/src/providers/meta/tmdb.ts +334 -358
- package/src/providers/movies/index.ts +4 -12
- package/src/providers/movies/multimovies/create-multimovies.ts +215 -452
- package/src/providers/movies/multimovies/multimovies.ts +5 -58
- package/src/providers/movies/multistream/create-multistream.ts +141 -0
- package/src/providers/movies/multistream/multistream.ts +7 -0
- package/src/providers/movies/multistream/utils.ts +234 -410
- package/src/providers/movies/netflixmirror/create-netflixmirror.ts +72 -34
- package/src/providers/movies/netflixmirror/netflixmirror.ts +9 -15
- package/src/providers/movies/site-paths.ts +25 -0
- package/src/providers/movies/vegamovies/create-vegamovies.ts +450 -725
- package/src/providers/movies/vegamovies/vegamovies.ts +5 -62
- package/src/providers/provider-class.ts +39 -0
- package/src/registry-signing-keys.json +6 -0
- package/src/utils/ExtractorManager.ts +177 -237
- package/src/utils/ProviderManager.ts +170 -278
- package/src/utils/constants.ts +2 -10
- package/src/utils/create-extractor-context.ts +36 -28
- package/src/utils/create-provider-context.ts +51 -121
- package/src/utils/extension-integrity.ts +1 -2
- package/src/utils/extension-modules.ts +281 -61
- package/src/utils/fetch-with-timeout.ts +4 -2
- package/src/utils/meta-http.ts +20 -27
- package/src/utils/registry-schema.ts +48 -15
- package/src/utils/registry-signature-format.ts +37 -0
- package/src/utils/registry-signature.ts +26 -67
- package/src/utils/runtime-modules.ts +7 -0
- package/src/utils/tmdb.ts +186 -0
- package/src/utils/url-polyfill.ts +2 -46
- package/src/utils/utf8.ts +44 -0
- package/src/utils/utils.ts +16 -362
- package/android/src/main/AndroidManifestNew.xml +0 -3
- package/android/src/main/java/com/consumet/DdosGuardModule.kt +0 -179
- package/lib/commonjs/extractors/asianload.js +0 -75
- package/lib/commonjs/extractors/asianload.js.map +0 -1
- package/lib/commonjs/extractors/filemoon.js +0 -66
- package/lib/commonjs/extractors/filemoon.js.map +0 -1
- package/lib/commonjs/extractors/gdflix.js +0 -165
- package/lib/commonjs/extractors/gdflix.js.map +0 -1
- package/lib/commonjs/extractors/gogocdn.js +0 -128
- package/lib/commonjs/extractors/gogocdn.js.map +0 -1
- package/lib/commonjs/extractors/megaup.js +0 -113
- package/lib/commonjs/extractors/megaup.js.map +0 -1
- package/lib/commonjs/extractors/mixdrop.js +0 -37
- package/lib/commonjs/extractors/mixdrop.js.map +0 -1
- package/lib/commonjs/extractors/mp4player.js +0 -57
- package/lib/commonjs/extractors/mp4player.js.map +0 -1
- package/lib/commonjs/extractors/mp4upload.js +0 -38
- package/lib/commonjs/extractors/mp4upload.js.map +0 -1
- package/lib/commonjs/extractors/rapidcloud.js +0 -180
- package/lib/commonjs/extractors/rapidcloud.js.map +0 -1
- package/lib/commonjs/extractors/streamhub.js +0 -61
- package/lib/commonjs/extractors/streamhub.js.map +0 -1
- package/lib/commonjs/extractors/streamlare.js +0 -55
- package/lib/commonjs/extractors/streamlare.js.map +0 -1
- package/lib/commonjs/extractors/streamsb.js +0 -69
- package/lib/commonjs/extractors/streamsb.js.map +0 -1
- package/lib/commonjs/extractors/streamtape.js +0 -42
- package/lib/commonjs/extractors/streamtape.js.map +0 -1
- package/lib/commonjs/extractors/vidmoly.js +0 -54
- package/lib/commonjs/extractors/vidmoly.js.map +0 -1
- package/lib/commonjs/extractors/vizcloud.js +0 -67
- package/lib/commonjs/extractors/vizcloud.js.map +0 -1
- package/lib/commonjs/extractors/voe.js +0 -100
- package/lib/commonjs/extractors/voe.js.map +0 -1
- package/lib/commonjs/models/base-types.js +0 -2
- package/lib/commonjs/models/base-types.js.map +0 -1
- package/lib/commonjs/providers/anime/animekai/animekai.js +0 -118
- package/lib/commonjs/providers/anime/animekai/animekai.js.map +0 -1
- package/lib/commonjs/providers/anime/animekai/create-animekai.js +0 -518
- package/lib/commonjs/providers/anime/animekai/create-animekai.js.map +0 -1
- package/lib/commonjs/providers/anime/animeunity.js +0 -187
- package/lib/commonjs/providers/anime/animeunity.js.map +0 -1
- package/lib/commonjs/providers/anime/anineko/anineko.js +0 -41
- package/lib/commonjs/providers/anime/anineko/anineko.js.map +0 -1
- package/lib/commonjs/providers/anime/anineko/create-anineko.js +0 -449
- package/lib/commonjs/providers/anime/anineko/create-anineko.js.map +0 -1
- package/lib/commonjs/providers/anime/zoro/create-zoro.js +0 -586
- package/lib/commonjs/providers/anime/zoro/create-zoro.js.map +0 -1
- package/lib/commonjs/providers/anime/zoro/zoro.js +0 -193
- package/lib/commonjs/providers/anime/zoro/zoro.js.map +0 -1
- package/lib/commonjs/providers/meta/tmdb-api-key.js +0 -29
- package/lib/commonjs/providers/meta/tmdb-api-key.js.map +0 -1
- package/lib/commonjs/providers/movies/himovies/create-himovies.js +0 -436
- package/lib/commonjs/providers/movies/himovies/create-himovies.js.map +0 -1
- package/lib/commonjs/providers/movies/himovies/himovies.js +0 -79
- package/lib/commonjs/providers/movies/himovies/himovies.js.map +0 -1
- package/lib/commonjs/providers/movies/multistream/index.js +0 -222
- package/lib/commonjs/providers/movies/multistream/index.js.map +0 -1
- package/lib/commonjs/providers/movies/netflixmirror/disneymirror.js +0 -22
- package/lib/commonjs/providers/movies/netflixmirror/disneymirror.js.map +0 -1
- package/lib/commonjs/providers/movies/netflixmirror/netmirror-parser.js +0 -30
- package/lib/commonjs/providers/movies/netflixmirror/netmirror-parser.js.map +0 -1
- package/lib/commonjs/providers/movies/netflixmirror/primemirror.js +0 -22
- package/lib/commonjs/providers/movies/netflixmirror/primemirror.js.map +0 -1
- package/lib/commonjs/providers/movies/yflix/create-yflix.js +0 -418
- package/lib/commonjs/providers/movies/yflix/create-yflix.js.map +0 -1
- package/lib/commonjs/providers/movies/yflix/yflix.js +0 -66
- package/lib/commonjs/providers/movies/yflix/yflix.js.map +0 -1
- package/lib/commonjs/providers/provider-args.js +0 -17
- package/lib/commonjs/providers/provider-args.js.map +0 -1
- package/lib/commonjs/registry-signing-keys.js +0 -26
- package/lib/commonjs/registry-signing-keys.js.map +0 -1
- package/lib/commonjs/utils/extension-utils.js +0 -105
- package/lib/commonjs/utils/extension-utils.js.map +0 -1
- package/lib/commonjs/utils/index.js +0 -312
- package/lib/commonjs/utils/index.js.map +0 -1
- package/lib/commonjs/utils/provider-maps.js +0 -69
- package/lib/commonjs/utils/provider-maps.js.map +0 -1
- package/lib/commonjs/utils/queries.js +0 -45
- package/lib/commonjs/utils/queries.js.map +0 -1
- package/lib/module/extractors/asianload.js +0 -69
- package/lib/module/extractors/asianload.js.map +0 -1
- package/lib/module/extractors/filemoon.js +0 -62
- package/lib/module/extractors/filemoon.js.map +0 -1
- package/lib/module/extractors/gdflix.js +0 -161
- package/lib/module/extractors/gdflix.js.map +0 -1
- package/lib/module/extractors/gogocdn.js +0 -122
- package/lib/module/extractors/gogocdn.js.map +0 -1
- package/lib/module/extractors/megaup.js +0 -109
- package/lib/module/extractors/megaup.js.map +0 -1
- package/lib/module/extractors/mixdrop.js +0 -32
- package/lib/module/extractors/mixdrop.js.map +0 -1
- package/lib/module/extractors/mp4player.js +0 -52
- package/lib/module/extractors/mp4player.js.map +0 -1
- package/lib/module/extractors/mp4upload.js +0 -33
- package/lib/module/extractors/mp4upload.js.map +0 -1
- package/lib/module/extractors/rapidcloud.js +0 -174
- package/lib/module/extractors/rapidcloud.js.map +0 -1
- package/lib/module/extractors/streamhub.js +0 -56
- package/lib/module/extractors/streamhub.js.map +0 -1
- package/lib/module/extractors/streamlare.js +0 -50
- package/lib/module/extractors/streamlare.js.map +0 -1
- package/lib/module/extractors/streamsb.js +0 -64
- package/lib/module/extractors/streamsb.js.map +0 -1
- package/lib/module/extractors/streamtape.js +0 -37
- package/lib/module/extractors/streamtape.js.map +0 -1
- package/lib/module/extractors/vidmoly.js +0 -49
- package/lib/module/extractors/vidmoly.js.map +0 -1
- package/lib/module/extractors/vizcloud.js +0 -62
- package/lib/module/extractors/vizcloud.js.map +0 -1
- package/lib/module/extractors/voe.js +0 -95
- package/lib/module/extractors/voe.js.map +0 -1
- package/lib/module/models/base-types.js +0 -2
- package/lib/module/models/base-types.js.map +0 -1
- package/lib/module/providers/anime/animekai/animekai.js +0 -113
- package/lib/module/providers/anime/animekai/animekai.js.map +0 -1
- package/lib/module/providers/anime/animekai/create-animekai.js +0 -514
- package/lib/module/providers/anime/animekai/create-animekai.js.map +0 -1
- package/lib/module/providers/anime/animeunity.js +0 -183
- package/lib/module/providers/anime/animeunity.js.map +0 -1
- package/lib/module/providers/anime/anineko/anineko.js +0 -36
- package/lib/module/providers/anime/anineko/anineko.js.map +0 -1
- package/lib/module/providers/anime/anineko/create-anineko.js +0 -445
- package/lib/module/providers/anime/anineko/create-anineko.js.map +0 -1
- package/lib/module/providers/anime/zoro/create-zoro.js +0 -582
- package/lib/module/providers/anime/zoro/create-zoro.js.map +0 -1
- package/lib/module/providers/anime/zoro/zoro.js +0 -189
- package/lib/module/providers/anime/zoro/zoro.js.map +0 -1
- package/lib/module/providers/meta/tmdb-api-key.js +0 -24
- package/lib/module/providers/meta/tmdb-api-key.js.map +0 -1
- package/lib/module/providers/movies/himovies/create-himovies.js +0 -432
- package/lib/module/providers/movies/himovies/create-himovies.js.map +0 -1
- package/lib/module/providers/movies/himovies/himovies.js +0 -75
- package/lib/module/providers/movies/himovies/himovies.js.map +0 -1
- package/lib/module/providers/movies/multistream/index.js +0 -217
- package/lib/module/providers/movies/multistream/index.js.map +0 -1
- package/lib/module/providers/movies/netflixmirror/disneymirror.js +0 -17
- package/lib/module/providers/movies/netflixmirror/disneymirror.js.map +0 -1
- package/lib/module/providers/movies/netflixmirror/netmirror-parser.js +0 -25
- package/lib/module/providers/movies/netflixmirror/netmirror-parser.js.map +0 -1
- package/lib/module/providers/movies/netflixmirror/primemirror.js +0 -17
- package/lib/module/providers/movies/netflixmirror/primemirror.js.map +0 -1
- package/lib/module/providers/movies/yflix/create-yflix.js +0 -414
- package/lib/module/providers/movies/yflix/create-yflix.js.map +0 -1
- package/lib/module/providers/movies/yflix/yflix.js +0 -61
- package/lib/module/providers/movies/yflix/yflix.js.map +0 -1
- package/lib/module/providers/provider-args.js +0 -14
- package/lib/module/providers/provider-args.js.map +0 -1
- package/lib/module/registry-signing-keys.js +0 -22
- package/lib/module/registry-signing-keys.js.map +0 -1
- package/lib/module/utils/extension-utils.js +0 -100
- package/lib/module/utils/extension-utils.js.map +0 -1
- package/lib/module/utils/index.js +0 -21
- package/lib/module/utils/index.js.map +0 -1
- package/lib/module/utils/provider-maps.js +0 -65
- package/lib/module/utils/provider-maps.js.map +0 -1
- package/lib/module/utils/queries.js +0 -29
- package/lib/module/utils/queries.js.map +0 -1
- package/lib/typescript/commonjs/src/extractors/asianload.d.ts +0 -17
- package/lib/typescript/commonjs/src/extractors/asianload.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/filemoon.d.ts +0 -14
- package/lib/typescript/commonjs/src/extractors/filemoon.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/gdflix.d.ts +0 -7
- package/lib/typescript/commonjs/src/extractors/gdflix.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/gogocdn.d.ts +0 -19
- package/lib/typescript/commonjs/src/extractors/gogocdn.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/megaup.d.ts +0 -6
- package/lib/typescript/commonjs/src/extractors/megaup.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/mixdrop.d.ts +0 -10
- package/lib/typescript/commonjs/src/extractors/mixdrop.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/mp4player.d.ts +0 -15
- package/lib/typescript/commonjs/src/extractors/mp4player.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/mp4upload.d.ts +0 -10
- package/lib/typescript/commonjs/src/extractors/mp4upload.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/rapidcloud.d.ts +0 -17
- package/lib/typescript/commonjs/src/extractors/rapidcloud.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/streamhub.d.ts +0 -14
- package/lib/typescript/commonjs/src/extractors/streamhub.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/streamlare.d.ts +0 -13
- package/lib/typescript/commonjs/src/extractors/streamlare.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/streamsb.d.ts +0 -14
- package/lib/typescript/commonjs/src/extractors/streamsb.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/streamtape.d.ts +0 -10
- package/lib/typescript/commonjs/src/extractors/streamtape.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/vidmoly.d.ts +0 -10
- package/lib/typescript/commonjs/src/extractors/vidmoly.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/vizcloud.d.ts +0 -12
- package/lib/typescript/commonjs/src/extractors/vizcloud.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/voe.d.ts +0 -15
- package/lib/typescript/commonjs/src/extractors/voe.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/models/base-types.d.ts +0 -23
- package/lib/typescript/commonjs/src/models/base-types.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/animekai/animekai.d.ts +0 -90
- package/lib/typescript/commonjs/src/providers/anime/animekai/animekai.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/animekai/create-animekai.d.ts +0 -32
- package/lib/typescript/commonjs/src/providers/anime/animekai/create-animekai.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/animeunity.d.ts +0 -39
- package/lib/typescript/commonjs/src/providers/anime/animeunity.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/anineko/anineko.d.ts +0 -28
- 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/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 -139
- package/lib/typescript/commonjs/src/providers/anime/zoro/zoro.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/meta/tmdb-api-key.d.ts +0 -7
- package/lib/typescript/commonjs/src/providers/meta/tmdb-api-key.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/himovies/create-himovies.d.ts +0 -24
- 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 -50
- package/lib/typescript/commonjs/src/providers/movies/himovies/himovies.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/multistream/index.d.ts +0 -44
- package/lib/typescript/commonjs/src/providers/movies/multistream/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/disneymirror.d.ts +0 -12
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/disneymirror.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/netmirror-parser.d.ts +0 -21
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/netmirror-parser.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/primemirror.d.ts +0 -12
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/primemirror.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/yflix/create-yflix.d.ts +0 -25
- package/lib/typescript/commonjs/src/providers/movies/yflix/create-yflix.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/yflix/yflix.d.ts +0 -49
- package/lib/typescript/commonjs/src/providers/movies/yflix/yflix.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/provider-args.d.ts +0 -8
- package/lib/typescript/commonjs/src/providers/provider-args.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/registry-signing-keys.d.ts +0 -18
- package/lib/typescript/commonjs/src/registry-signing-keys.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/extension-utils.d.ts +0 -31
- package/lib/typescript/commonjs/src/utils/extension-utils.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/index.d.ts +0 -19
- package/lib/typescript/commonjs/src/utils/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/provider-maps.d.ts +0 -39
- package/lib/typescript/commonjs/src/utils/provider-maps.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/queries.d.ts +0 -22
- package/lib/typescript/commonjs/src/utils/queries.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/asianload.d.ts +0 -17
- package/lib/typescript/module/src/extractors/asianload.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/filemoon.d.ts +0 -14
- package/lib/typescript/module/src/extractors/filemoon.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/gdflix.d.ts +0 -7
- package/lib/typescript/module/src/extractors/gdflix.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/gogocdn.d.ts +0 -19
- package/lib/typescript/module/src/extractors/gogocdn.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/megaup.d.ts +0 -6
- package/lib/typescript/module/src/extractors/megaup.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/mixdrop.d.ts +0 -10
- package/lib/typescript/module/src/extractors/mixdrop.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/mp4player.d.ts +0 -15
- package/lib/typescript/module/src/extractors/mp4player.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/mp4upload.d.ts +0 -10
- package/lib/typescript/module/src/extractors/mp4upload.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/rapidcloud.d.ts +0 -17
- package/lib/typescript/module/src/extractors/rapidcloud.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/streamhub.d.ts +0 -14
- package/lib/typescript/module/src/extractors/streamhub.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/streamlare.d.ts +0 -13
- package/lib/typescript/module/src/extractors/streamlare.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/streamsb.d.ts +0 -14
- package/lib/typescript/module/src/extractors/streamsb.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/streamtape.d.ts +0 -10
- package/lib/typescript/module/src/extractors/streamtape.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/vidmoly.d.ts +0 -10
- package/lib/typescript/module/src/extractors/vidmoly.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/vizcloud.d.ts +0 -12
- package/lib/typescript/module/src/extractors/vizcloud.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/voe.d.ts +0 -15
- package/lib/typescript/module/src/extractors/voe.d.ts.map +0 -1
- package/lib/typescript/module/src/models/base-types.d.ts +0 -23
- package/lib/typescript/module/src/models/base-types.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/animekai/animekai.d.ts +0 -90
- package/lib/typescript/module/src/providers/anime/animekai/animekai.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/animekai/create-animekai.d.ts +0 -32
- package/lib/typescript/module/src/providers/anime/animekai/create-animekai.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/animeunity.d.ts +0 -39
- package/lib/typescript/module/src/providers/anime/animeunity.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/anineko/anineko.d.ts +0 -28
- 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/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 -139
- package/lib/typescript/module/src/providers/anime/zoro/zoro.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/meta/tmdb-api-key.d.ts +0 -7
- package/lib/typescript/module/src/providers/meta/tmdb-api-key.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/himovies/create-himovies.d.ts +0 -24
- 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 -50
- package/lib/typescript/module/src/providers/movies/himovies/himovies.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/multistream/index.d.ts +0 -44
- package/lib/typescript/module/src/providers/movies/multistream/index.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/netflixmirror/disneymirror.d.ts +0 -12
- package/lib/typescript/module/src/providers/movies/netflixmirror/disneymirror.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/netflixmirror/netmirror-parser.d.ts +0 -21
- package/lib/typescript/module/src/providers/movies/netflixmirror/netmirror-parser.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/netflixmirror/primemirror.d.ts +0 -12
- package/lib/typescript/module/src/providers/movies/netflixmirror/primemirror.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/yflix/create-yflix.d.ts +0 -25
- package/lib/typescript/module/src/providers/movies/yflix/create-yflix.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/yflix/yflix.d.ts +0 -49
- package/lib/typescript/module/src/providers/movies/yflix/yflix.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/provider-args.d.ts +0 -8
- package/lib/typescript/module/src/providers/provider-args.d.ts.map +0 -1
- package/lib/typescript/module/src/registry-signing-keys.d.ts +0 -18
- package/lib/typescript/module/src/registry-signing-keys.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/extension-utils.d.ts +0 -31
- package/lib/typescript/module/src/utils/extension-utils.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/index.d.ts +0 -19
- package/lib/typescript/module/src/utils/index.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/provider-maps.d.ts +0 -39
- package/lib/typescript/module/src/utils/provider-maps.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/queries.d.ts +0 -22
- package/lib/typescript/module/src/utils/queries.d.ts.map +0 -1
- package/src/extractors/asianload.ts +0 -89
- package/src/extractors/filemoon.ts +0 -60
- package/src/extractors/gdflix.ts +0 -165
- package/src/extractors/gogocdn.ts +0 -155
- package/src/extractors/megaup.ts +0 -125
- package/src/extractors/mixdrop.ts +0 -35
- package/src/extractors/mp4player.ts +0 -57
- package/src/extractors/mp4upload.ts +0 -35
- package/src/extractors/rapidcloud.ts +0 -200
- package/src/extractors/streamhub.ts +0 -62
- package/src/extractors/streamlare.ts +0 -65
- package/src/extractors/streamsb.ts +0 -77
- package/src/extractors/streamtape.ts +0 -42
- package/src/extractors/vidmoly.ts +0 -52
- package/src/extractors/vizcloud.ts +0 -70
- package/src/extractors/voe.ts +0 -107
- package/src/models/base-types.ts +0 -23
- package/src/providers/anime/animekai/animekai.ts +0 -126
- package/src/providers/anime/animekai/create-animekai.ts +0 -589
- package/src/providers/anime/animeunity.ts +0 -226
- package/src/providers/anime/anineko/anineko.ts +0 -54
- package/src/providers/anime/anineko/create-anineko.ts +0 -490
- package/src/providers/anime/zoro/create-zoro.ts +0 -645
- package/src/providers/anime/zoro/zoro.ts +0 -201
- package/src/providers/meta/tmdb-api-key.ts +0 -27
- package/src/providers/movies/himovies/create-himovies.ts +0 -518
- package/src/providers/movies/himovies/himovies.ts +0 -89
- package/src/providers/movies/multistream/index.ts +0 -244
- package/src/providers/movies/netflixmirror/disneymirror.ts +0 -16
- package/src/providers/movies/netflixmirror/netmirror-parser.ts +0 -43
- package/src/providers/movies/netflixmirror/primemirror.ts +0 -16
- package/src/providers/movies/yflix/create-yflix.ts +0 -496
- package/src/providers/movies/yflix/yflix.ts +0 -85
- package/src/providers/provider-args.ts +0 -15
- package/src/registry-signing-keys.ts +0 -20
- package/src/utils/extension-utils.ts +0 -130
- package/src/utils/index.ts +0 -96
- package/src/utils/provider-maps.ts +0 -80
- package/src/utils/queries.ts +0 -37
|
@@ -1,40 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import axios, { type AxiosInstance } from 'axios';
|
|
2
|
+
import { load, type CheerioAPI } from 'cheerio';
|
|
2
3
|
import CryptoJS from 'crypto-js';
|
|
3
4
|
import type { ExtractorContext } from '../models';
|
|
4
|
-
import
|
|
5
|
+
import * as BundledExtractors from '../extractors';
|
|
6
|
+
import { nativeMethods } from '../NativeConsumet';
|
|
7
|
+
import { USER_AGENT } from './constants';
|
|
5
8
|
import { PolyURL, PolyURLSearchParams } from './url-polyfill';
|
|
6
|
-
import type { ExtractorContextConfig } from '../models/extractor-context';
|
|
7
|
-
import {
|
|
8
|
-
bypassDdosGuard,
|
|
9
|
-
getDdosGuardCookiesWithWebView,
|
|
10
|
-
makeGetRequestWithWebView,
|
|
11
|
-
makePostRequestWithWebView,
|
|
12
|
-
makePostRequest,
|
|
13
|
-
deobfuscateScript,
|
|
14
|
-
} from '../NativeConsumet';
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
export interface ExtractorContextConfig {
|
|
11
|
+
/** HTTP client for every request; defaults to `defaultAxios` */
|
|
12
|
+
axios?: AxiosInstance;
|
|
13
|
+
/** Defaults to cheerio's `load` */
|
|
14
|
+
load?: (html: string) => CheerioAPI;
|
|
15
|
+
/** `USER_AGENT` of the context; defaults to the library's. Doesn't change the headers of `axios`. */
|
|
16
|
+
userAgent?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** The HTTP client contexts use unless the app passes its own: a 15 s timeout and browser-like headers. */
|
|
20
|
+
export const defaultAxios = axios.create({
|
|
21
|
+
timeout: 15000,
|
|
22
|
+
headers: {
|
|
23
|
+
'User-Agent': USER_AGENT,
|
|
24
|
+
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
|
|
25
|
+
'Accept-Language': 'en-US,en;q=0.5',
|
|
26
|
+
'Accept-Encoding': 'gzip, deflate',
|
|
27
|
+
'Cache-Control': 'no-cache',
|
|
28
|
+
'Pragma': 'no-cache',
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
19
32
|
export function createExtractorContext(config: ExtractorContextConfig = {}): ExtractorContext {
|
|
20
33
|
return {
|
|
21
34
|
axios: config.axios || defaultAxios,
|
|
22
35
|
load: config.load || load,
|
|
23
36
|
CryptoJS,
|
|
24
|
-
USER_AGENT:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
PolyURLSearchParams: PolyURLSearchParams,
|
|
29
|
-
NativeConsumet: {
|
|
30
|
-
getDdosGuardCookiesWithWebView,
|
|
31
|
-
makeGetRequestWithWebView,
|
|
32
|
-
makePostRequestWithWebView,
|
|
33
|
-
makePostRequest,
|
|
34
|
-
bypassDdosGuard,
|
|
35
|
-
deobfuscateScript,
|
|
36
|
-
},
|
|
37
|
+
USER_AGENT: config.userAgent || USER_AGENT,
|
|
38
|
+
PolyURL,
|
|
39
|
+
PolyURLSearchParams,
|
|
40
|
+
NativeConsumet: nativeMethods,
|
|
37
41
|
};
|
|
38
42
|
}
|
|
39
43
|
|
|
40
|
-
|
|
44
|
+
/** The extractors the library bundles, by name. */
|
|
45
|
+
export const defaultExtractors: typeof BundledExtractors = { ...BundledExtractors };
|
|
46
|
+
|
|
47
|
+
/** `createExtractorContext()`: the library's axios, cheerio and user agent. */
|
|
48
|
+
export const defaultExtractorContext: ExtractorContext = createExtractorContext();
|
|
@@ -1,139 +1,69 @@
|
|
|
1
|
-
import { load } from 'cheerio';
|
|
2
|
-
import CryptoJS from 'crypto-js';
|
|
3
|
-
import type { ProviderContext, ProviderContextConfig } from '../models/provider-context';
|
|
4
|
-
import type { ExtractorContext, IVideoExtractor } from '../models';
|
|
5
1
|
import {
|
|
6
2
|
AnimeParser,
|
|
7
3
|
MovieParser,
|
|
8
4
|
MangaParser,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
SubOrDub,
|
|
13
|
-
WatchListType,
|
|
14
|
-
TvType,
|
|
15
|
-
Genres,
|
|
16
|
-
Topics,
|
|
5
|
+
extensionEnums,
|
|
6
|
+
type ExtractorFactory,
|
|
7
|
+
type ProviderContext,
|
|
17
8
|
} from '../models';
|
|
9
|
+
import { createExtractorContext, defaultExtractors, type ExtractorContextConfig } from './create-extractor-context';
|
|
10
|
+
import type { ExtractorManager } from './ExtractorManager';
|
|
18
11
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
12
|
+
export interface ProviderContextConfig extends ExtractorContextConfig {
|
|
13
|
+
/** Extractors to use instead of the bundled and registry ones, by name. */
|
|
14
|
+
extractors?: Record<string, ExtractorFactory>;
|
|
15
|
+
/**
|
|
16
|
+
* Supplies registry versions of extractors: `ctx.extractors.X` runs X's hash-verified registry
|
|
17
|
+
* version when the manager's registry lists X, falling back to the bundled X.
|
|
18
|
+
*/
|
|
19
|
+
extractorManager?: ExtractorManager;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const createCustomBaseUrl = (defaultUrl: string, customUrl?: string): string => {
|
|
23
|
+
if (!customUrl) return defaultUrl;
|
|
24
|
+
return /^https?:\/\//.test(customUrl) ? customUrl : `http://${customUrl}`;
|
|
25
|
+
};
|
|
29
26
|
|
|
30
|
-
/**
|
|
31
|
-
* Creates a provider context with sensible defaults for extensions
|
|
32
|
-
*
|
|
33
|
-
* @param config Optional configuration to override defaults
|
|
34
|
-
* @returns Complete ProviderContext ready for use with extensions
|
|
35
|
-
*/
|
|
36
27
|
export function createProviderContext(config: ProviderContextConfig = {}): ProviderContext {
|
|
37
|
-
const extractorManager = config
|
|
28
|
+
const { extractorManager } = config;
|
|
29
|
+
const bundled = defaultExtractors as unknown as Record<string, ExtractorFactory | undefined>;
|
|
38
30
|
|
|
39
|
-
//
|
|
40
|
-
// the extractor, verified and cached by the shared manager, falling back to the bundled version.
|
|
31
|
+
// The manager falls back to the bundled version itself when the registry one can't be used.
|
|
41
32
|
const registryBacked =
|
|
42
|
-
(name: string
|
|
43
|
-
(callerCtx
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
extract: async (...args: any[]) => {
|
|
47
|
-
let extractor: any;
|
|
48
|
-
try {
|
|
49
|
-
extractor = await extractorManager!.loadExtractor(name);
|
|
50
|
-
} catch (error) {
|
|
51
|
-
if (!bundled) throw error;
|
|
52
|
-
}
|
|
53
|
-
// loadExtractor returns the bundled extractor itself when the registry code fails; it throws
|
|
54
|
-
// when the entry can't be used at all (e.g. it needs a newer context), so build it here.
|
|
55
|
-
if (typeof extractor?.extract !== 'function') {
|
|
56
|
-
if (!bundled) throw new Error(`Extractor '${name}' is not available`);
|
|
57
|
-
extractor = bundled(callerCtx);
|
|
58
|
-
}
|
|
59
|
-
return extractor.extract(...(args as [any]));
|
|
60
|
-
},
|
|
33
|
+
(name: string): ExtractorFactory =>
|
|
34
|
+
(callerCtx) => ({
|
|
35
|
+
extract: async (videoUrl, ...args) =>
|
|
36
|
+
(await extractorManager!.loadExtractorFactory(name))(callerCtx ?? ctx).extract(videoUrl, ...args),
|
|
61
37
|
});
|
|
62
38
|
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Extractors in the app's registry run their registry version
|
|
73
|
-
if (extractorManager?.getExtractorMetadata(prop)) {
|
|
74
|
-
return registryBacked(prop, target[prop]);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (target[prop]) {
|
|
78
|
-
return target[prop];
|
|
79
|
-
}
|
|
39
|
+
const missing =
|
|
40
|
+
(name: string): ExtractorFactory =>
|
|
41
|
+
() => ({
|
|
42
|
+
extract: async () => {
|
|
43
|
+
throw new Error(`Extractor '${name}' not found in the registry or the bundled extractors`);
|
|
44
|
+
},
|
|
45
|
+
});
|
|
80
46
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
47
|
+
const extractors = new Proxy(bundled, {
|
|
48
|
+
get: (target, prop) => {
|
|
49
|
+
if (typeof prop !== 'string') return Reflect.get(target, prop);
|
|
50
|
+
const custom = config.extractors?.[prop];
|
|
51
|
+
if (custom) return custom;
|
|
52
|
+
const own = target[prop];
|
|
53
|
+
if (extractorManager?.getExtractorMetadata(prop)) return registryBacked(prop);
|
|
54
|
+
if (own) return ((callerCtx) => own(callerCtx ?? ctx)) as ExtractorFactory;
|
|
55
|
+
return missing(prop);
|
|
88
56
|
},
|
|
89
|
-
});
|
|
57
|
+
}) as unknown as ProviderContext['extractors'];
|
|
90
58
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (customUrl.startsWith('http://') || customUrl.startsWith('https://')) {
|
|
98
|
-
return customUrl;
|
|
99
|
-
} else {
|
|
100
|
-
return `http://${customUrl}`;
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
return {
|
|
105
|
-
axios: config.axios || defaultAxios,
|
|
106
|
-
load: config.load || load,
|
|
107
|
-
CryptoJS,
|
|
108
|
-
USER_AGENT:
|
|
109
|
-
config.userAgent ||
|
|
110
|
-
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
|
|
111
|
-
AnimeParser: config.AnimeParser || AnimeParser,
|
|
112
|
-
MovieParser: config.MovieParser || MovieParser,
|
|
113
|
-
MangaParser: config.MangaParser || MangaParser,
|
|
114
|
-
extractors: finalExtractors,
|
|
115
|
-
extractorManager,
|
|
116
|
-
PolyURL: PolyURL,
|
|
117
|
-
PolyURLSearchParams: PolyURLSearchParams,
|
|
59
|
+
const ctx: ProviderContext = {
|
|
60
|
+
...createExtractorContext(config),
|
|
61
|
+
AnimeParser,
|
|
62
|
+
MovieParser,
|
|
63
|
+
MangaParser,
|
|
64
|
+
extractors,
|
|
118
65
|
createCustomBaseUrl,
|
|
119
|
-
enums:
|
|
120
|
-
StreamingServers,
|
|
121
|
-
MediaFormat,
|
|
122
|
-
MediaStatus,
|
|
123
|
-
SubOrDub,
|
|
124
|
-
WatchListType,
|
|
125
|
-
TvType,
|
|
126
|
-
Genres,
|
|
127
|
-
Topics,
|
|
128
|
-
},
|
|
129
|
-
NativeConsumet: {
|
|
130
|
-
getDdosGuardCookiesWithWebView,
|
|
131
|
-
makeGetRequestWithWebView,
|
|
132
|
-
makePostRequestWithWebView,
|
|
133
|
-
makePostRequest,
|
|
134
|
-
bypassDdosGuard,
|
|
135
|
-
deobfuscateScript,
|
|
136
|
-
},
|
|
66
|
+
enums: extensionEnums,
|
|
137
67
|
};
|
|
68
|
+
return ctx;
|
|
138
69
|
}
|
|
139
|
-
export default createProviderContext;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import CryptoJS from 'crypto-js';
|
|
2
|
+
import { IDENTIFIER_RE } from './registry-schema';
|
|
2
3
|
|
|
3
4
|
export type IntegrityErrorCode = 'INTEGRITY_MISMATCH' | 'INTEGRITY_MISSING' | 'INVALID_IDENTIFIER';
|
|
4
5
|
|
|
@@ -39,8 +40,6 @@ export interface ExecuteCodeOptions {
|
|
|
39
40
|
skipIntegrity?: boolean;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
const IDENTIFIER_RE = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
43
|
-
|
|
44
43
|
export const sha256Hex = (code: string): string => CryptoJS.SHA256(code).toString(CryptoJS.enc.Hex);
|
|
45
44
|
|
|
46
45
|
/**
|
|
@@ -1,33 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Topics,
|
|
10
|
-
} from '../models/types';
|
|
11
|
-
|
|
12
|
-
/** Module names registry bundles import from the runtime (see scripts/build-extensions.js). */
|
|
13
|
-
export const MODELS_MODULE = 'react-native-consumet/models';
|
|
14
|
-
export const UTILS_MODULE = 'react-native-consumet/utils';
|
|
15
|
-
|
|
16
|
-
// Paths tsc-built extensions used for the same modules, at any depth (`../models`, `../../../models/index.js`).
|
|
17
|
-
const LEGACY_MODELS = /^(\.\.\/)+models(\/index)?(\.js)?$/;
|
|
18
|
-
const LEGACY_UTILS = /^(\.\.\/)+utils(\/index|\/create-provider-context|\/create-extractor-context)?(\.js)?$/;
|
|
19
|
-
|
|
20
|
-
/** The library's enums, handed to extensions as-is so their values always match. */
|
|
21
|
-
export const extensionEnums = {
|
|
22
|
-
StreamingServers,
|
|
23
|
-
MediaFormat,
|
|
24
|
-
MediaStatus,
|
|
25
|
-
SubOrDub,
|
|
26
|
-
WatchListType,
|
|
27
|
-
TvType,
|
|
28
|
-
Genres,
|
|
29
|
-
Topics,
|
|
30
|
-
};
|
|
1
|
+
import { extensionEnums } from '../models/types';
|
|
2
|
+
import type { ExtractorContext, ProviderContext } from '../models';
|
|
3
|
+
import { MODELS_MODULE, UTILS_MODULE } from './runtime-modules';
|
|
4
|
+
import { assertValidIdentifier, verifyExtensionCode, type IntegrityOptions } from './extension-integrity';
|
|
5
|
+
import { IDENTIFIER_RE } from './registry-schema';
|
|
6
|
+
import { createExtensionFetch, fetchTextWithTimeout } from './fetch-with-timeout';
|
|
7
|
+
|
|
8
|
+
export type ExtensionKind = 'provider' | 'extractor';
|
|
31
9
|
|
|
32
10
|
/**
|
|
33
11
|
* Builds the `require` extension code runs with. Only the modules passed in resolve; anything
|
|
@@ -36,8 +14,7 @@ export const extensionEnums = {
|
|
|
36
14
|
*/
|
|
37
15
|
export function createExtensionRequire(extensionId: string, modules: Record<string, unknown>) {
|
|
38
16
|
return (specifier: string): any => {
|
|
39
|
-
|
|
40
|
-
if (Object.prototype.hasOwnProperty.call(modules, key)) return modules[key];
|
|
17
|
+
if (Object.prototype.hasOwnProperty.call(modules, specifier)) return modules[specifier];
|
|
41
18
|
throw new Error(
|
|
42
19
|
`Extension '${extensionId}' requires '${specifier}', which the extension runtime does not provide. ` +
|
|
43
20
|
'Registry code must be a single-file bundle (yarn build).'
|
|
@@ -47,58 +24,301 @@ export function createExtensionRequire(extensionId: string, modules: Record<stri
|
|
|
47
24
|
|
|
48
25
|
export type ExtensionFactory = (...args: any[]) => any;
|
|
49
26
|
|
|
27
|
+
const isIdentifier = (value: unknown): value is string => typeof value === 'string' && IDENTIFIER_RE.test(value);
|
|
28
|
+
|
|
50
29
|
/** The globals extension code runs with; each key becomes a local constant of that name. */
|
|
51
30
|
export type ExtensionGlobals = { exports: Record<string, any>; module: { exports: any } } & Record<string, unknown>;
|
|
52
31
|
|
|
32
|
+
const isProviderContext = (ctx: ExtractorContext | ProviderContext): ctx is ProviderContext => 'enums' in ctx;
|
|
33
|
+
|
|
53
34
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
35
|
+
* The globals and `require`-able modules registry code of `kind` runs with, built from the context it
|
|
36
|
+
* gets. Extractor code also sees axios, cheerio's load, CryptoJS and the URL classes as globals;
|
|
37
|
+
* provider code reaches them through `require` or its context.
|
|
57
38
|
*/
|
|
58
|
-
export function
|
|
39
|
+
export function extensionGlobals(
|
|
40
|
+
kind: ExtensionKind,
|
|
41
|
+
id: string,
|
|
42
|
+
ctx: ExtractorContext | ProviderContext
|
|
43
|
+
): ExtensionGlobals {
|
|
44
|
+
const parsers = isProviderContext(ctx)
|
|
45
|
+
? { AnimeParser: ctx.AnimeParser, MovieParser: ctx.MovieParser, MangaParser: ctx.MangaParser }
|
|
46
|
+
: {};
|
|
47
|
+
const utils = isProviderContext(ctx)
|
|
48
|
+
? { createProviderContext: () => ctx, createExtractorContext: () => ctx }
|
|
49
|
+
: { createExtractorContext: () => ctx };
|
|
50
|
+
// The only modules registry code can require; anything else throws (EXT-5).
|
|
51
|
+
const modules: Record<string, unknown> = {
|
|
52
|
+
'cheerio': { load: ctx.load },
|
|
53
|
+
'axios': ctx.axios,
|
|
54
|
+
'crypto-js': ctx.CryptoJS,
|
|
55
|
+
[MODELS_MODULE]: { ...parsers, ...extensionEnums },
|
|
56
|
+
[UTILS_MODULE]: utils,
|
|
57
|
+
};
|
|
58
|
+
const globals: ExtensionGlobals = {
|
|
59
|
+
exports: {},
|
|
60
|
+
module: { exports: {} },
|
|
61
|
+
require: createExtensionRequire(id, modules),
|
|
62
|
+
console,
|
|
63
|
+
Promise,
|
|
64
|
+
Object,
|
|
65
|
+
fetch: createExtensionFetch(ctx.axios),
|
|
66
|
+
};
|
|
67
|
+
if (kind === 'extractor') {
|
|
68
|
+
Object.assign(globals, {
|
|
69
|
+
axios: ctx.axios,
|
|
70
|
+
load: ctx.load,
|
|
71
|
+
CryptoJS: ctx.CryptoJS,
|
|
72
|
+
URL: ctx.PolyURL,
|
|
73
|
+
URLSearchParams: ctx.PolyURLSearchParams,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return globals;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The functions an evaluation of extension code provides, by the name they were asked for. */
|
|
80
|
+
export type ExtensionFactories = Map<string, ExtensionFactory | undefined>;
|
|
81
|
+
|
|
82
|
+
/** Extension code wrapped in a function that runs it and returns its top-level `names`, in order. */
|
|
83
|
+
function parseExtensionCode(
|
|
59
84
|
code: string,
|
|
60
|
-
|
|
61
|
-
globals: ExtensionGlobals
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
try {
|
|
67
|
-
run = new Function(
|
|
68
|
-
'context',
|
|
69
|
-
`
|
|
85
|
+
names: readonly string[],
|
|
86
|
+
globals: ExtensionGlobals
|
|
87
|
+
): (context: ExtensionGlobals) => unknown[] {
|
|
88
|
+
return new Function(
|
|
89
|
+
'context',
|
|
90
|
+
`
|
|
70
91
|
${Object.keys(globals)
|
|
71
92
|
.map((key) => `const ${key} = context.${key};`)
|
|
72
93
|
.join('\n ')}
|
|
73
94
|
|
|
74
|
-
|
|
75
|
-
${code}
|
|
76
|
-
} catch (execError) {
|
|
77
|
-
console.error('Error during ${kind} code execution:', execError);
|
|
78
|
-
throw new Error('${label} code execution failed: ' + execError.message);
|
|
79
|
-
}
|
|
95
|
+
${code}
|
|
80
96
|
|
|
81
|
-
return typeof ${name} !== 'undefined' ? ${name} : undefined;
|
|
97
|
+
return [${names.map((name) => `typeof ${name} !== 'undefined' ? ${name} : undefined`).join(', ')}];
|
|
82
98
|
`
|
|
83
|
-
|
|
99
|
+
) as (context: ExtensionGlobals) => unknown[];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Run single-file extension code once and return the functions it provides for `names`. For each
|
|
104
|
+
* name: a top-level `function name`, `exports[name]`, `module.exports[name]`, or its default export;
|
|
105
|
+
* undefined when it provides none. `names[0]` is the one the caller needs; the others are looked up
|
|
106
|
+
* when the code also parses with them, and are missing from the result otherwise. Every name must
|
|
107
|
+
* be a valid identifier (assertValidIdentifier).
|
|
108
|
+
*/
|
|
109
|
+
export function evaluateExtensionCode(
|
|
110
|
+
code: string,
|
|
111
|
+
names: readonly string[],
|
|
112
|
+
globals: ExtensionGlobals,
|
|
113
|
+
kind: ExtensionKind
|
|
114
|
+
): ExtensionFactories {
|
|
115
|
+
const label = kind === 'provider' ? 'Provider' : 'Extractor';
|
|
116
|
+
const parseError = (syntaxError: any) =>
|
|
117
|
+
new Error(`Failed to parse ${kind} code: ${syntaxError.message}`, { cause: syntaxError });
|
|
118
|
+
let captured = names;
|
|
119
|
+
let run: (context: ExtensionGlobals) => unknown[];
|
|
120
|
+
try {
|
|
121
|
+
run = parseExtensionCode(code, captured, globals);
|
|
84
122
|
} catch (syntaxError: any) {
|
|
85
|
-
|
|
86
|
-
|
|
123
|
+
if (names.length <= 1) throw parseError(syntaxError);
|
|
124
|
+
// A name that can't be referenced (a reserved word, say) must not fail the one asked for.
|
|
125
|
+
captured = names.slice(0, 1);
|
|
126
|
+
try {
|
|
127
|
+
run = parseExtensionCode(code, captured, globals);
|
|
128
|
+
} catch (singleError: any) {
|
|
129
|
+
throw parseError(singleError);
|
|
130
|
+
}
|
|
87
131
|
}
|
|
88
132
|
|
|
89
133
|
// The top-level declaration comes first: it always binds its own name, while bundle export
|
|
90
134
|
// getters built without block scoping can point at another export on Hermes (see
|
|
91
135
|
// scripts/hermes-safe-dist.js). Exports cover code without a top-level declaration, and the
|
|
92
136
|
// default export (`export default`) is the last resort.
|
|
93
|
-
|
|
137
|
+
let declared: unknown;
|
|
138
|
+
try {
|
|
139
|
+
declared = run(globals);
|
|
140
|
+
} catch (execError: any) {
|
|
141
|
+
throw new Error(`${label} code execution failed: ${execError?.message ?? execError}`, { cause: execError });
|
|
142
|
+
}
|
|
143
|
+
// Not the list when the code returns early on its own (a top-level `return`).
|
|
144
|
+
const declaredAt = (index: number) => (Array.isArray(declared) ? declared[index] : undefined);
|
|
94
145
|
const { exports, module } = globals;
|
|
95
|
-
return
|
|
96
|
-
(
|
|
146
|
+
return new Map(
|
|
147
|
+
captured.map((name, index): [string, ExtensionFactory | undefined] => [
|
|
148
|
+
name,
|
|
149
|
+
[declaredAt(index), exports[name], module.exports?.[name], exports.default, module.exports?.default].find(
|
|
150
|
+
(candidate): candidate is ExtensionFactory => typeof candidate === 'function'
|
|
151
|
+
),
|
|
152
|
+
])
|
|
97
153
|
);
|
|
98
154
|
}
|
|
99
155
|
|
|
156
|
+
/** Thrown when a registry entry's code can't be downloaded; `status` is the HTTP status, if any. */
|
|
157
|
+
export class RegistryFetchError extends Error {
|
|
158
|
+
readonly kind: ExtensionKind;
|
|
159
|
+
readonly url: string;
|
|
160
|
+
readonly status?: number;
|
|
161
|
+
|
|
162
|
+
constructor(kind: ExtensionKind, url: string, message: string, status?: number) {
|
|
163
|
+
super(message);
|
|
164
|
+
this.name = 'RegistryFetchError';
|
|
165
|
+
this.kind = kind;
|
|
166
|
+
this.url = url;
|
|
167
|
+
this.status = status;
|
|
168
|
+
Object.setPrototypeOf(this, RegistryFetchError.prototype);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Download the code a registry entry's `main` points at. */
|
|
173
|
+
export async function fetchEntryCode(kind: ExtensionKind, main: string): Promise<string> {
|
|
174
|
+
const what = kind === 'provider' ? 'extension' : 'extractor';
|
|
175
|
+
let response: Awaited<ReturnType<typeof fetchTextWithTimeout>>;
|
|
176
|
+
try {
|
|
177
|
+
response = await fetchTextWithTimeout(main, {
|
|
178
|
+
method: 'GET',
|
|
179
|
+
headers: { 'Accept': 'text/plain, application/javascript, */*', 'User-Agent': 'react-native-consumet' },
|
|
180
|
+
});
|
|
181
|
+
} catch (error) {
|
|
182
|
+
throw new RegistryFetchError(kind, main, `Failed to fetch ${what}: ${(error as Error)?.message ?? error}`);
|
|
183
|
+
}
|
|
184
|
+
if (!response.ok) {
|
|
185
|
+
throw new RegistryFetchError(
|
|
186
|
+
kind,
|
|
187
|
+
main,
|
|
188
|
+
`Failed to fetch ${what}: ${response.status} ${response.statusText}`,
|
|
189
|
+
response.status
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
return response.text;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* One evaluation of verified code with a sha256: the functions it provides by name, and the keys
|
|
197
|
+
* compiled from it. Every key whose entry has that sha256 shares it, and so its top-level state.
|
|
198
|
+
*/
|
|
199
|
+
type SharedModule = { sha256: string; code: string; factories: ExtensionFactories; keys: Set<string> };
|
|
200
|
+
|
|
100
201
|
/** Compiled extension code, reused only for the same code and sha256 (one entry per key). */
|
|
101
|
-
|
|
202
|
+
type CompiledCode = { sha256: string; code: string; factory: ExtensionFactory; module?: SharedModule };
|
|
203
|
+
|
|
204
|
+
export interface CompileRequest {
|
|
205
|
+
kind: ExtensionKind;
|
|
206
|
+
/** Registry id of the entry, for errors */
|
|
207
|
+
id: string;
|
|
208
|
+
/** The function the code must provide; must be a plain identifier, as it's interpolated into the code */
|
|
209
|
+
name: unknown;
|
|
210
|
+
code: string;
|
|
211
|
+
entry: { id?: string; name?: string; sha256?: string };
|
|
212
|
+
globals: () => ExtensionGlobals;
|
|
213
|
+
/**
|
|
214
|
+
* The function names of other entries whose code has the same sha256, also looked up when the
|
|
215
|
+
* code runs, so those entries get their function from the same run. Names that aren't plain
|
|
216
|
+
* identifiers are skipped.
|
|
217
|
+
*/
|
|
218
|
+
siblings?: () => readonly unknown[];
|
|
219
|
+
/** Run the code without checking it against `entry.sha256`; such code is never cached or shared. */
|
|
220
|
+
skipIntegrity?: boolean;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/** Whether a cache key belongs to the extension or extractor `id`: keys are `${id}` and `${id}|…`. */
|
|
224
|
+
const isKeyOf = (key: string, id: string) => key === id || key.startsWith(`${id}|`);
|
|
225
|
+
/** The id a cache key belongs to. */
|
|
226
|
+
const idOfKey = (key: string) => key.split('|')[0]!;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Turns verified registry code into the function it provides. The same code verified against the
|
|
230
|
+
* same hash runs from its compiled copy; unverified code is checked again on every call. Verified
|
|
231
|
+
* code with a sha256 runs once per sha256: entries that share a bundle (same code, same hash) get
|
|
232
|
+
* their functions from one run, so they share its top-level state.
|
|
233
|
+
*/
|
|
234
|
+
export class CompiledCodeCache {
|
|
235
|
+
private compiled = new Map<string, CompiledCode>();
|
|
236
|
+
// By sha256
|
|
237
|
+
private modules = new Map<string, SharedModule>();
|
|
238
|
+
|
|
239
|
+
constructor(private integrityOptions: IntegrityOptions = {}) {}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* The function `name` for `key`, when this cache has it from code verified against `sha256` (not
|
|
243
|
+
* empty): compiled for `key`, or provided by a run of code with that sha256 for another key.
|
|
244
|
+
* Undefined otherwise, without running anything.
|
|
245
|
+
*/
|
|
246
|
+
lookup(key: string, sha256: string | undefined, name: unknown): ExtensionFactory | undefined {
|
|
247
|
+
if (!sha256) return undefined;
|
|
248
|
+
const cached = this.compiled.get(key);
|
|
249
|
+
if (cached?.sha256 === sha256) return cached.factory;
|
|
250
|
+
const module = this.modules.get(sha256);
|
|
251
|
+
const factory = typeof name === 'string' ? module?.factories.get(name) : undefined;
|
|
252
|
+
if (!module || !factory) return undefined;
|
|
253
|
+
this.remember(key, { sha256, code: module.code, factory, module });
|
|
254
|
+
return factory;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
compile(key: string, request: CompileRequest): ExtensionFactory {
|
|
258
|
+
const { kind, id, name, code, entry, skipIntegrity } = request;
|
|
259
|
+
assertValidIdentifier(name, kind === 'provider' ? 'factoryName' : 'extractor name', id);
|
|
260
|
+
const label = kind === 'provider' ? 'extension' : 'extractor code';
|
|
261
|
+
const notFound = () => new Error(`Factory function '${name}' not found in ${label}`);
|
|
262
|
+
|
|
263
|
+
const sha256 = entry.sha256 ?? '';
|
|
264
|
+
const cached = this.compiled.get(key);
|
|
265
|
+
if (cached?.sha256 === sha256 && cached.code === code) return cached.factory;
|
|
266
|
+
if (!skipIntegrity) verifyExtensionCode(code, entry, this.integrityOptions);
|
|
267
|
+
|
|
268
|
+
// Only verified code with a hash is shared.
|
|
269
|
+
const shareable = !skipIntegrity && sha256 !== '';
|
|
270
|
+
const shared = shareable ? this.modules.get(sha256) : undefined;
|
|
271
|
+
if (shared && shared.code === code && shared.factories.has(name)) {
|
|
272
|
+
const factory = shared.factories.get(name);
|
|
273
|
+
if (!factory) throw notFound();
|
|
274
|
+
this.remember(key, { sha256, code, factory, module: shared });
|
|
275
|
+
return factory;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
const siblings = shareable ? (request.siblings?.() ?? []) : [];
|
|
279
|
+
const names = [name, ...siblings.filter((sibling): sibling is string => isIdentifier(sibling) && sibling !== name)];
|
|
280
|
+
const factories = evaluateExtensionCode(code, Array.from(new Set(names)), request.globals(), kind);
|
|
281
|
+
const factory = factories.get(name);
|
|
282
|
+
if (!factory) throw notFound();
|
|
283
|
+
if (skipIntegrity) return factory;
|
|
284
|
+
// When a shared run exists (one that lacks this name), this run stays this key's own.
|
|
285
|
+
const module = shareable && !shared ? { sha256, code, factories, keys: new Set<string>() } : undefined;
|
|
286
|
+
if (module) this.modules.set(sha256, module);
|
|
287
|
+
this.remember(key, { sha256, code, factory, module });
|
|
288
|
+
return factory;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Forget the compiled code of one extension or extractor (keys `${id}` and `${id}|…`), the shared
|
|
293
|
+
* runs it came from, and the compiled code of every other key that came from those runs. Returns
|
|
294
|
+
* the ids of those other keys.
|
|
295
|
+
*/
|
|
296
|
+
forget(id: string): string[] {
|
|
297
|
+
const siblings = new Set<string>();
|
|
298
|
+
for (const [key, { module }] of Array.from(this.compiled.entries())) {
|
|
299
|
+
if (!isKeyOf(key, id) || !this.compiled.has(key)) continue;
|
|
300
|
+
this.compiled.delete(key);
|
|
301
|
+
if (!module) continue;
|
|
302
|
+
if (this.modules.get(module.sha256) === module) this.modules.delete(module.sha256);
|
|
303
|
+
for (const other of module.keys) {
|
|
304
|
+
this.compiled.delete(other);
|
|
305
|
+
if (!isKeyOf(other, id)) siblings.add(idOfKey(other));
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return Array.from(siblings);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/** Store the compiled code of `key`, moving it off the shared run it had before. */
|
|
312
|
+
private remember(key: string, compiled: CompiledCode): void {
|
|
313
|
+
const previous = this.compiled.get(key)?.module;
|
|
314
|
+
if (previous && previous !== compiled.module) {
|
|
315
|
+
previous.keys.delete(key);
|
|
316
|
+
if (!previous.keys.size && this.modules.get(previous.sha256) === previous) this.modules.delete(previous.sha256);
|
|
317
|
+
}
|
|
318
|
+
this.compiled.set(key, compiled);
|
|
319
|
+
compiled.module?.keys.add(key);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
102
322
|
|
|
103
323
|
/**
|
|
104
324
|
* Share one load per key: concurrent callers get the same promise, later callers the result.
|
|
@@ -118,6 +338,6 @@ export function memoiseLoad<T>(cache: Map<string, Promise<T>>, key: string, load
|
|
|
118
338
|
/** Delete the entries of one extension or extractor: keys `${id}` and `${id}|…`. */
|
|
119
339
|
export function deleteEntriesOf(cache: Map<string, unknown>, id: string): void {
|
|
120
340
|
for (const key of Array.from(cache.keys())) {
|
|
121
|
-
if (key
|
|
341
|
+
if (isKeyOf(key, id)) cache.delete(key);
|
|
122
342
|
}
|
|
123
343
|
}
|