react-native-consumet 1.6.0 → 3.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/Consumet.podspec +2 -2
- package/README.md +24 -15
- package/android/build.gradle +9 -8
- package/android/generated/java/com/consumet/NativeConsumetSpec.java +0 -4
- package/android/generated/jni/RNConsumetSpec-generated.cpp +0 -6
- package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI.h +0 -10
- package/android/src/androidTest/AndroidManifest.xml +4 -0
- package/android/src/androidTest/java/com/consumet/DeobfuscatorModuleTest.kt +88 -0
- package/android/src/androidTest/java/com/consumet/SynchronyEngineTest.kt +75 -0
- package/android/src/androidTest/java/com/consumet/TestSupport.kt +115 -0
- package/android/src/androidTest/java/com/consumet/WebViewContractTest.kt +125 -0
- package/android/src/main/java/com/consumet/ConsumetModule.kt +0 -13
- package/android/src/main/java/com/consumet/DdosGuardModule.kt +26 -60
- package/android/src/main/java/com/consumet/DeobfuscatorModule.kt +59 -68
- package/android/src/main/java/com/consumet/HttpRequestModule.kt +171 -285
- package/android/src/main/java/com/consumet/Synchrony.kt +65 -0
- package/android/src/main/java/com/consumet/SynchronyScriptCache.kt +121 -0
- package/android/src/main/java/com/consumet/WebViewDebugging.kt +36 -0
- package/android/src/main/java/com/consumet/WebViewTask.kt +101 -0
- package/ios/Consumet.mm +205 -184
- package/ios/RCConsumetSynchronyCache.h +51 -0
- package/ios/RCConsumetSynchronyCache.m +246 -0
- package/ios/generated/ReactCodegen/RNConsumetSpec/RNConsumetSpec-generated.mm +0 -7
- package/ios/generated/ReactCodegen/RNConsumetSpec/RNConsumetSpec.h +0 -2
- package/ios/generated/ReactCodegen/RNConsumetSpecJSI.h +0 -10
- package/lib/commonjs/NativeConsumet.ts +68 -2
- package/lib/commonjs/extension-registry.json +174 -54
- package/lib/commonjs/extension-registry.json.sig +1 -0
- package/lib/commonjs/extractors/asianload.js +11 -5
- package/lib/commonjs/extractors/asianload.js.map +1 -1
- package/lib/commonjs/extractors/filemoon.js +11 -6
- package/lib/commonjs/extractors/filemoon.js.map +1 -1
- package/lib/commonjs/extractors/flixcloud.js +0 -2
- package/lib/commonjs/extractors/flixcloud.js.map +1 -1
- package/lib/commonjs/extractors/gdflix.js +0 -2
- package/lib/commonjs/extractors/gdflix.js.map +1 -1
- package/lib/commonjs/extractors/gofile.js +0 -2
- package/lib/commonjs/extractors/gofile.js.map +1 -1
- package/lib/commonjs/extractors/gogocdn.js +13 -7
- package/lib/commonjs/extractors/gogocdn.js.map +1 -1
- package/lib/commonjs/extractors/hubcloud.js +0 -2
- package/lib/commonjs/extractors/hubcloud.js.map +1 -1
- package/lib/commonjs/extractors/index.js +28 -29
- package/lib/commonjs/extractors/index.js.map +1 -1
- package/lib/commonjs/extractors/kwik.js +0 -2
- package/lib/commonjs/extractors/kwik.js.map +1 -1
- package/lib/commonjs/extractors/megaplay.js +0 -2
- package/lib/commonjs/extractors/megaplay.js.map +1 -1
- package/lib/commonjs/extractors/megaup.js +2 -6
- package/lib/commonjs/extractors/megaup.js.map +1 -1
- package/lib/commonjs/extractors/mixdrop.js +10 -5
- package/lib/commonjs/extractors/mixdrop.js.map +1 -1
- package/lib/commonjs/extractors/mp4player.js +11 -6
- package/lib/commonjs/extractors/mp4player.js.map +1 -1
- package/lib/commonjs/extractors/mp4upload.js +10 -5
- package/lib/commonjs/extractors/mp4upload.js.map +1 -1
- package/lib/commonjs/extractors/rapidcloud.js +16 -10
- package/lib/commonjs/extractors/rapidcloud.js.map +1 -1
- package/lib/commonjs/extractors/streamhub.js +11 -6
- package/lib/commonjs/extractors/streamhub.js.map +1 -1
- package/lib/commonjs/extractors/streamlare.js +13 -8
- package/lib/commonjs/extractors/streamlare.js.map +1 -1
- package/lib/commonjs/extractors/streamsb.js +11 -6
- package/lib/commonjs/extractors/streamsb.js.map +1 -1
- package/lib/commonjs/extractors/streamtape.js +10 -5
- package/lib/commonjs/extractors/streamtape.js.map +1 -1
- package/lib/commonjs/extractors/vidhide.js +4 -4
- package/lib/commonjs/extractors/vidhide.js.map +1 -1
- package/lib/commonjs/extractors/vidmoly.js +11 -6
- package/lib/commonjs/extractors/vidmoly.js.map +1 -1
- package/lib/commonjs/extractors/vizcloud.js +11 -6
- package/lib/commonjs/extractors/vizcloud.js.map +1 -1
- package/lib/commonjs/extractors/voe.js +11 -6
- package/lib/commonjs/extractors/voe.js.map +1 -1
- package/lib/commonjs/index.js +130 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/base-provider.js +4 -0
- package/lib/commonjs/models/base-provider.js.map +1 -1
- package/lib/commonjs/models/extension-manifest.js +0 -4
- package/lib/commonjs/models/index.js +7 -0
- package/lib/commonjs/models/index.js.map +1 -1
- package/lib/commonjs/models/meta-error.js +36 -0
- package/lib/commonjs/models/meta-error.js.map +1 -0
- package/lib/commonjs/models/types.js +21 -0
- package/lib/commonjs/models/types.js.map +1 -1
- package/lib/commonjs/providers/anime/anikoto/anikoto.js +14 -10
- package/lib/commonjs/providers/anime/anikoto/anikoto.js.map +1 -1
- package/lib/commonjs/providers/anime/anikoto/create-anikoto.js +6 -4
- package/lib/commonjs/providers/anime/anikoto/create-anikoto.js.map +1 -1
- package/lib/commonjs/providers/anime/animekai/animekai.js +14 -8
- package/lib/commonjs/providers/anime/animekai/animekai.js.map +1 -1
- package/lib/commonjs/providers/anime/animekai/create-animekai.js +6 -4
- package/lib/commonjs/providers/anime/animekai/create-animekai.js.map +1 -1
- package/lib/commonjs/providers/anime/animepahe/animepahe.js +17 -11
- package/lib/commonjs/providers/anime/animepahe/animepahe.js.map +1 -1
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +6 -15
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/commonjs/providers/anime/animeunity.js +23 -10
- package/lib/commonjs/providers/anime/animeunity.js.map +1 -1
- package/lib/commonjs/providers/anime/anineko/anineko.js +18 -8
- package/lib/commonjs/providers/anime/anineko/anineko.js.map +1 -1
- package/lib/commonjs/providers/anime/anineko/create-anineko.js +4 -2
- package/lib/commonjs/providers/anime/anineko/create-anineko.js.map +1 -1
- package/lib/commonjs/providers/anime/index.js +26 -35
- package/lib/commonjs/providers/anime/index.js.map +1 -1
- package/lib/commonjs/providers/anime/reanime/create-reanime.js +4 -5
- package/lib/commonjs/providers/anime/reanime/create-reanime.js.map +1 -1
- package/lib/commonjs/providers/anime/reanime/reanime.js +13 -8
- package/lib/commonjs/providers/anime/reanime/reanime.js.map +1 -1
- package/lib/commonjs/providers/anime/zoro/create-zoro.js +8 -8
- package/lib/commonjs/providers/anime/zoro/create-zoro.js.map +1 -1
- package/lib/commonjs/providers/anime/zoro/zoro.js +17 -11
- package/lib/commonjs/providers/anime/zoro/zoro.js.map +1 -1
- package/lib/commonjs/providers/index.js +8 -8
- package/lib/commonjs/providers/index.js.map +1 -1
- package/lib/commonjs/providers/light-novels/index.js +6 -7
- package/lib/commonjs/providers/light-novels/index.js.map +1 -1
- package/lib/commonjs/providers/light-novels/novelupdates.js +32 -11
- package/lib/commonjs/providers/light-novels/novelupdates.js.map +1 -1
- package/lib/commonjs/providers/light-novels/readlightnovels.js +15 -7
- package/lib/commonjs/providers/light-novels/readlightnovels.js.map +1 -1
- package/lib/commonjs/providers/manga/asurascans.js +169 -100
- package/lib/commonjs/providers/manga/asurascans.js.map +1 -1
- package/lib/commonjs/providers/manga/flamescans.js +181 -94
- package/lib/commonjs/providers/manga/flamescans.js.map +1 -1
- package/lib/commonjs/providers/manga/index.js +14 -31
- package/lib/commonjs/providers/manga/index.js.map +1 -1
- package/lib/commonjs/providers/manga/mangadex.js +243 -231
- package/lib/commonjs/providers/manga/mangadex.js.map +1 -1
- package/lib/commonjs/providers/manga/mangahere.js +287 -138
- package/lib/commonjs/providers/manga/mangahere.js.map +1 -1
- package/lib/commonjs/providers/manga/mangakakalot.js +215 -111
- package/lib/commonjs/providers/manga/mangakakalot.js.map +1 -1
- package/lib/commonjs/providers/manga/mangapill.js +137 -44
- package/lib/commonjs/providers/manga/mangapill.js.map +1 -1
- package/lib/commonjs/providers/meta/anilist.js +595 -1030
- package/lib/commonjs/providers/meta/anilist.js.map +1 -1
- package/lib/commonjs/providers/meta/index.js +1 -0
- package/lib/commonjs/providers/meta/index.js.map +1 -1
- package/lib/commonjs/providers/meta/mal.js +86 -89
- package/lib/commonjs/providers/meta/mal.js.map +1 -1
- package/lib/commonjs/providers/meta/tmdb-api-key.js +29 -0
- package/lib/commonjs/providers/meta/tmdb-api-key.js.map +1 -0
- package/lib/commonjs/providers/meta/tmdb.js +122 -94
- package/lib/commonjs/providers/meta/tmdb.js.map +1 -1
- package/lib/commonjs/providers/movies/himovies/create-himovies.js +3 -3
- package/lib/commonjs/providers/movies/himovies/create-himovies.js.map +1 -1
- package/lib/commonjs/providers/movies/himovies/himovies.js +13 -8
- package/lib/commonjs/providers/movies/himovies/himovies.js.map +1 -1
- package/lib/commonjs/providers/movies/index.js +20 -30
- package/lib/commonjs/providers/movies/index.js.map +1 -1
- package/lib/commonjs/providers/movies/multimovies/create-multimovies.js +3 -3
- package/lib/commonjs/providers/movies/multimovies/create-multimovies.js.map +1 -1
- package/lib/commonjs/providers/movies/multimovies/multimovies.js +13 -8
- package/lib/commonjs/providers/movies/multimovies/multimovies.js.map +1 -1
- package/lib/commonjs/providers/movies/multistream/index.js +28 -17
- package/lib/commonjs/providers/movies/multistream/index.js.map +1 -1
- package/lib/commonjs/providers/movies/multistream/utils.js +18 -19
- package/lib/commonjs/providers/movies/multistream/utils.js.map +1 -1
- package/lib/commonjs/providers/movies/netflixmirror/create-netflixmirror.js +451 -185
- package/lib/commonjs/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -1
- package/lib/commonjs/providers/movies/netflixmirror/disneymirror.js +22 -0
- package/lib/commonjs/providers/movies/netflixmirror/disneymirror.js.map +1 -0
- package/lib/commonjs/providers/movies/netflixmirror/netflixmirror.js +11 -24
- package/lib/commonjs/providers/movies/netflixmirror/netflixmirror.js.map +1 -1
- package/lib/commonjs/providers/movies/netflixmirror/netmirror-parser.js +30 -0
- package/lib/commonjs/providers/movies/netflixmirror/netmirror-parser.js.map +1 -0
- package/lib/commonjs/providers/movies/netflixmirror/primemirror.js +22 -0
- package/lib/commonjs/providers/movies/netflixmirror/primemirror.js.map +1 -0
- package/lib/commonjs/providers/movies/vegamovies/create-vegamovies.js +57 -40
- package/lib/commonjs/providers/movies/vegamovies/create-vegamovies.js.map +1 -1
- package/lib/commonjs/providers/movies/vegamovies/vegamovies.js +11 -14
- package/lib/commonjs/providers/movies/vegamovies/vegamovies.js.map +1 -1
- package/lib/commonjs/providers/movies/yflix/create-yflix.js +2 -2
- package/lib/commonjs/providers/movies/yflix/create-yflix.js.map +1 -1
- package/lib/commonjs/providers/movies/yflix/yflix.js +13 -6
- package/lib/commonjs/providers/movies/yflix/yflix.js.map +1 -1
- package/lib/commonjs/providers/provider-args.js +17 -0
- package/lib/commonjs/providers/provider-args.js.map +1 -0
- package/lib/commonjs/registry-signing-keys.js +26 -0
- package/lib/commonjs/registry-signing-keys.js.map +1 -0
- package/lib/commonjs/utils/ExtractorManager.js +136 -233
- package/lib/commonjs/utils/ExtractorManager.js.map +1 -1
- package/lib/commonjs/utils/ProviderManager.js +181 -251
- package/lib/commonjs/utils/ProviderManager.js.map +1 -1
- package/lib/commonjs/utils/create-extractor-context.js +0 -1
- package/lib/commonjs/utils/create-extractor-context.js.map +1 -1
- package/lib/commonjs/utils/create-provider-context.js +37 -29
- package/lib/commonjs/utils/create-provider-context.js.map +1 -1
- package/lib/commonjs/utils/extension-integrity.js +62 -0
- package/lib/commonjs/utils/extension-integrity.js.map +1 -0
- package/lib/commonjs/utils/extension-modules.js +109 -0
- package/lib/commonjs/utils/extension-modules.js.map +1 -0
- package/lib/commonjs/utils/extension-utils.js +46 -40
- package/lib/commonjs/utils/extension-utils.js.map +1 -1
- package/lib/commonjs/utils/fetch-with-timeout.js +76 -0
- package/lib/commonjs/utils/fetch-with-timeout.js.map +1 -0
- package/lib/commonjs/utils/index.js +96 -2
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/manga.js +60 -0
- package/lib/commonjs/utils/manga.js.map +1 -0
- package/lib/commonjs/utils/meta-http.js +42 -0
- package/lib/commonjs/utils/meta-http.js.map +1 -0
- package/lib/commonjs/utils/provider-maps.js +26 -18
- package/lib/commonjs/utils/provider-maps.js.map +1 -1
- package/lib/commonjs/utils/queries.js +24 -11
- package/lib/commonjs/utils/queries.js.map +1 -1
- package/lib/commonjs/utils/registry-schema.js +263 -0
- package/lib/commonjs/utils/registry-schema.js.map +1 -0
- package/lib/commonjs/utils/registry-signature.js +180 -0
- package/lib/commonjs/utils/registry-signature.js.map +1 -0
- package/lib/commonjs/utils/url-polyfill.js +1075 -426
- package/lib/commonjs/utils/url-polyfill.js.map +1 -1
- package/lib/commonjs/utils/utils.js +2 -30
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/NativeConsumet.ts +68 -2
- package/lib/module/extension-registry.json +174 -54
- package/lib/module/extension-registry.json.sig +1 -0
- package/lib/module/extractors/asianload.js +10 -5
- package/lib/module/extractors/asianload.js.map +1 -1
- package/lib/module/extractors/filemoon.js +10 -5
- package/lib/module/extractors/filemoon.js.map +1 -1
- package/lib/module/extractors/flixcloud.js +0 -1
- package/lib/module/extractors/flixcloud.js.map +1 -1
- package/lib/module/extractors/gdflix.js +0 -1
- package/lib/module/extractors/gdflix.js.map +1 -1
- package/lib/module/extractors/gofile.js +0 -1
- package/lib/module/extractors/gofile.js.map +1 -1
- package/lib/module/extractors/gogocdn.js +12 -7
- package/lib/module/extractors/gogocdn.js.map +1 -1
- package/lib/module/extractors/hubcloud.js +0 -1
- package/lib/module/extractors/hubcloud.js.map +1 -1
- package/lib/module/extractors/index.js +24 -25
- package/lib/module/extractors/index.js.map +1 -1
- package/lib/module/extractors/kwik.js +0 -1
- package/lib/module/extractors/kwik.js.map +1 -1
- package/lib/module/extractors/megaplay.js +0 -1
- package/lib/module/extractors/megaplay.js.map +1 -1
- package/lib/module/extractors/megaup.js +2 -4
- package/lib/module/extractors/megaup.js.map +1 -1
- package/lib/module/extractors/mixdrop.js +9 -4
- package/lib/module/extractors/mixdrop.js.map +1 -1
- package/lib/module/extractors/mp4player.js +10 -5
- package/lib/module/extractors/mp4player.js.map +1 -1
- package/lib/module/extractors/mp4upload.js +9 -4
- package/lib/module/extractors/mp4upload.js.map +1 -1
- package/lib/module/extractors/rapidcloud.js +15 -10
- package/lib/module/extractors/rapidcloud.js.map +1 -1
- package/lib/module/extractors/streamhub.js +10 -5
- package/lib/module/extractors/streamhub.js.map +1 -1
- package/lib/module/extractors/streamlare.js +11 -6
- package/lib/module/extractors/streamlare.js.map +1 -1
- package/lib/module/extractors/streamsb.js +10 -5
- package/lib/module/extractors/streamsb.js.map +1 -1
- package/lib/module/extractors/streamtape.js +9 -4
- package/lib/module/extractors/streamtape.js.map +1 -1
- package/lib/module/extractors/vidhide.js +4 -3
- package/lib/module/extractors/vidhide.js.map +1 -1
- package/lib/module/extractors/vidmoly.js +10 -5
- package/lib/module/extractors/vidmoly.js.map +1 -1
- package/lib/module/extractors/vizcloud.js +10 -5
- package/lib/module/extractors/vizcloud.js.map +1 -1
- package/lib/module/extractors/voe.js +10 -5
- package/lib/module/extractors/voe.js.map +1 -1
- package/lib/module/index.js +11 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/base-provider.js +4 -0
- package/lib/module/models/base-provider.js.map +1 -1
- package/lib/module/models/extension-manifest.js +0 -2
- package/lib/module/models/index.js +2 -1
- package/lib/module/models/index.js.map +1 -1
- package/lib/module/models/meta-error.js +31 -0
- package/lib/module/models/meta-error.js.map +1 -0
- package/lib/module/models/types.js +30 -0
- package/lib/module/models/types.js.map +1 -1
- package/lib/module/providers/anime/anikoto/anikoto.js +13 -8
- package/lib/module/providers/anime/anikoto/anikoto.js.map +1 -1
- package/lib/module/providers/anime/anikoto/create-anikoto.js +6 -4
- package/lib/module/providers/anime/anikoto/create-anikoto.js.map +1 -1
- package/lib/module/providers/anime/animekai/animekai.js +13 -6
- package/lib/module/providers/anime/animekai/animekai.js.map +1 -1
- package/lib/module/providers/anime/animekai/create-animekai.js +6 -4
- package/lib/module/providers/anime/animekai/create-animekai.js.map +1 -1
- package/lib/module/providers/anime/animepahe/animepahe.js +13 -8
- package/lib/module/providers/anime/animepahe/animepahe.js.map +1 -1
- package/lib/module/providers/anime/animepahe/create-animepahe.js +6 -15
- package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/module/providers/anime/animeunity.js +21 -9
- package/lib/module/providers/anime/animeunity.js.map +1 -1
- package/lib/module/providers/anime/anineko/anineko.js +17 -6
- package/lib/module/providers/anime/anineko/anineko.js.map +1 -1
- package/lib/module/providers/anime/anineko/create-anineko.js +4 -2
- package/lib/module/providers/anime/anineko/create-anineko.js.map +1 -1
- package/lib/module/providers/anime/index.js +13 -21
- package/lib/module/providers/anime/index.js.map +1 -1
- package/lib/module/providers/anime/reanime/create-reanime.js +3 -4
- package/lib/module/providers/anime/reanime/create-reanime.js.map +1 -1
- package/lib/module/providers/anime/reanime/reanime.js +12 -6
- package/lib/module/providers/anime/reanime/reanime.js.map +1 -1
- package/lib/module/providers/anime/zoro/create-zoro.js +8 -9
- package/lib/module/providers/anime/zoro/create-zoro.js.map +1 -1
- package/lib/module/providers/anime/zoro/zoro.js +13 -8
- package/lib/module/providers/anime/zoro/zoro.js.map +1 -1
- package/lib/module/providers/index.js +4 -4
- package/lib/module/providers/index.js.map +1 -1
- package/lib/module/providers/light-novels/index.js +3 -3
- package/lib/module/providers/light-novels/index.js.map +1 -1
- package/lib/module/providers/light-novels/novelupdates.js +29 -11
- package/lib/module/providers/light-novels/novelupdates.js.map +1 -1
- package/lib/module/providers/light-novels/readlightnovels.js +12 -7
- package/lib/module/providers/light-novels/readlightnovels.js.map +1 -1
- package/lib/module/providers/manga/asurascans.js +169 -99
- package/lib/module/providers/manga/asurascans.js.map +1 -1
- package/lib/module/providers/manga/flamescans.js +181 -93
- package/lib/module/providers/manga/flamescans.js.map +1 -1
- package/lib/module/providers/manga/index.js +8 -24
- package/lib/module/providers/manga/index.js.map +1 -1
- package/lib/module/providers/manga/mangadex.js +244 -232
- package/lib/module/providers/manga/mangadex.js.map +1 -1
- package/lib/module/providers/manga/mangahere.js +284 -135
- package/lib/module/providers/manga/mangahere.js.map +1 -1
- package/lib/module/providers/manga/mangakakalot.js +215 -110
- package/lib/module/providers/manga/mangakakalot.js.map +1 -1
- package/lib/module/providers/manga/mangapill.js +137 -44
- package/lib/module/providers/manga/mangapill.js.map +1 -1
- package/lib/module/providers/meta/anilist.js +598 -1031
- package/lib/module/providers/meta/anilist.js.map +1 -1
- package/lib/module/providers/meta/index.js +1 -0
- package/lib/module/providers/meta/index.js.map +1 -1
- package/lib/module/providers/meta/mal.js +87 -89
- package/lib/module/providers/meta/mal.js.map +1 -1
- package/lib/module/providers/meta/tmdb-api-key.js +24 -0
- package/lib/module/providers/meta/tmdb-api-key.js.map +1 -0
- package/lib/module/providers/meta/tmdb.js +123 -93
- package/lib/module/providers/meta/tmdb.js.map +1 -1
- package/lib/module/providers/movies/himovies/create-himovies.js +3 -3
- package/lib/module/providers/movies/himovies/create-himovies.js.map +1 -1
- package/lib/module/providers/movies/himovies/himovies.js +12 -9
- package/lib/module/providers/movies/himovies/himovies.js.map +1 -1
- package/lib/module/providers/movies/index.js +14 -11
- package/lib/module/providers/movies/index.js.map +1 -1
- package/lib/module/providers/movies/multimovies/create-multimovies.js +3 -3
- package/lib/module/providers/movies/multimovies/create-multimovies.js.map +1 -1
- package/lib/module/providers/movies/multimovies/multimovies.js +12 -8
- package/lib/module/providers/movies/multimovies/multimovies.js.map +1 -1
- package/lib/module/providers/movies/multistream/index.js +27 -17
- package/lib/module/providers/movies/multistream/index.js.map +1 -1
- package/lib/module/providers/movies/multistream/utils.js +8 -9
- package/lib/module/providers/movies/multistream/utils.js.map +1 -1
- package/lib/module/providers/movies/netflixmirror/create-netflixmirror.js +449 -185
- package/lib/module/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -1
- package/lib/module/providers/movies/netflixmirror/disneymirror.js +17 -0
- package/lib/module/providers/movies/netflixmirror/disneymirror.js.map +1 -0
- package/lib/module/providers/movies/netflixmirror/netflixmirror.js +9 -24
- package/lib/module/providers/movies/netflixmirror/netflixmirror.js.map +1 -1
- package/lib/module/providers/movies/netflixmirror/netmirror-parser.js +25 -0
- package/lib/module/providers/movies/netflixmirror/netmirror-parser.js.map +1 -0
- package/lib/module/providers/movies/netflixmirror/primemirror.js +17 -0
- package/lib/module/providers/movies/netflixmirror/primemirror.js.map +1 -0
- package/lib/module/providers/movies/vegamovies/create-vegamovies.js +57 -40
- package/lib/module/providers/movies/vegamovies/create-vegamovies.js.map +1 -1
- package/lib/module/providers/movies/vegamovies/vegamovies.js +12 -10
- package/lib/module/providers/movies/vegamovies/vegamovies.js.map +1 -1
- package/lib/module/providers/movies/yflix/create-yflix.js +2 -2
- package/lib/module/providers/movies/yflix/create-yflix.js.map +1 -1
- package/lib/module/providers/movies/yflix/yflix.js +12 -6
- package/lib/module/providers/movies/yflix/yflix.js.map +1 -1
- package/lib/module/providers/provider-args.js +14 -0
- package/lib/module/providers/provider-args.js.map +1 -0
- package/lib/module/registry-signing-keys.js +22 -0
- package/lib/module/registry-signing-keys.js.map +1 -0
- package/lib/module/utils/ExtractorManager.js +138 -234
- package/lib/module/utils/ExtractorManager.js.map +1 -1
- package/lib/module/utils/ProviderManager.js +180 -250
- package/lib/module/utils/ProviderManager.js.map +1 -1
- package/lib/module/utils/create-extractor-context.js +1 -2
- package/lib/module/utils/create-extractor-context.js.map +1 -1
- package/lib/module/utils/create-provider-context.js +39 -30
- package/lib/module/utils/create-provider-context.js.map +1 -1
- package/lib/module/utils/extension-integrity.js +52 -0
- package/lib/module/utils/extension-integrity.js.map +1 -0
- package/lib/module/utils/extension-modules.js +101 -0
- package/lib/module/utils/extension-modules.js.map +1 -0
- package/lib/module/utils/extension-utils.js +46 -40
- package/lib/module/utils/extension-utils.js.map +1 -1
- package/lib/module/utils/fetch-with-timeout.js +71 -0
- package/lib/module/utils/fetch-with-timeout.js.map +1 -0
- package/lib/module/utils/index.js +7 -3
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/manga.js +54 -0
- package/lib/module/utils/manga.js.map +1 -0
- package/lib/module/utils/meta-http.js +37 -0
- package/lib/module/utils/meta-http.js.map +1 -0
- package/lib/module/utils/provider-maps.js +26 -18
- package/lib/module/utils/provider-maps.js.map +1 -1
- package/lib/module/utils/queries.js +22 -9
- package/lib/module/utils/queries.js.map +1 -1
- package/lib/module/utils/registry-schema.js +255 -0
- package/lib/module/utils/registry-schema.js.map +1 -0
- package/lib/module/utils/registry-signature.js +168 -0
- package/lib/module/utils/registry-signature.js.map +1 -0
- package/lib/module/utils/url-polyfill.js +1073 -425
- package/lib/module/utils/url-polyfill.js.map +1 -1
- package/lib/module/utils/utils.js +0 -26
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts +68 -2
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/asianload.d.ts +5 -3
- package/lib/typescript/commonjs/src/extractors/asianload.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/filemoon.d.ts +5 -3
- package/lib/typescript/commonjs/src/extractors/filemoon.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/flixcloud.d.ts +0 -1
- package/lib/typescript/commonjs/src/extractors/flixcloud.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/gdflix.d.ts +0 -1
- package/lib/typescript/commonjs/src/extractors/gdflix.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/gofile.d.ts +0 -1
- package/lib/typescript/commonjs/src/extractors/gofile.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/gogocdn.d.ts +5 -3
- package/lib/typescript/commonjs/src/extractors/gogocdn.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/hubcloud.d.ts +0 -1
- package/lib/typescript/commonjs/src/extractors/hubcloud.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/index.d.ts +24 -25
- package/lib/typescript/commonjs/src/extractors/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/kwik.d.ts +0 -1
- package/lib/typescript/commonjs/src/extractors/kwik.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/megaplay.d.ts +0 -1
- package/lib/typescript/commonjs/src/extractors/megaplay.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/megaup.d.ts +0 -1
- package/lib/typescript/commonjs/src/extractors/megaup.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/mixdrop.d.ts +5 -3
- package/lib/typescript/commonjs/src/extractors/mixdrop.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/mp4player.d.ts +5 -3
- package/lib/typescript/commonjs/src/extractors/mp4player.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/mp4upload.d.ts +5 -3
- package/lib/typescript/commonjs/src/extractors/mp4upload.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/rapidcloud.d.ts +5 -3
- package/lib/typescript/commonjs/src/extractors/rapidcloud.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/streamhub.d.ts +5 -3
- package/lib/typescript/commonjs/src/extractors/streamhub.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/streamlare.d.ts +5 -4
- package/lib/typescript/commonjs/src/extractors/streamlare.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/streamsb.d.ts +5 -3
- package/lib/typescript/commonjs/src/extractors/streamsb.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/streamtape.d.ts +5 -3
- package/lib/typescript/commonjs/src/extractors/streamtape.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/vidhide.d.ts +0 -1
- package/lib/typescript/commonjs/src/extractors/vidhide.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/vidmoly.d.ts +5 -3
- package/lib/typescript/commonjs/src/extractors/vidmoly.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/vizcloud.d.ts +5 -3
- package/lib/typescript/commonjs/src/extractors/vizcloud.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/voe.d.ts +5 -3
- package/lib/typescript/commonjs/src/extractors/voe.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +15 -9
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/base-provider.d.ts +5 -1
- package/lib/typescript/commonjs/src/models/base-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/extension-manifest.d.ts +27 -5
- package/lib/typescript/commonjs/src/models/extension-manifest.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/extractor-context.d.ts +1 -2
- package/lib/typescript/commonjs/src/models/extractor-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/index.d.ts +6 -4
- package/lib/typescript/commonjs/src/models/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/meta-error.d.ts +20 -0
- package/lib/typescript/commonjs/src/models/meta-error.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/provider-context.d.ts +21 -16
- package/lib/typescript/commonjs/src/models/provider-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/types.d.ts +144 -8
- package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/anikoto/anikoto.d.ts +7 -2
- 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 +3 -3
- package/lib/typescript/commonjs/src/providers/anime/anikoto/create-anikoto.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animekai/animekai.d.ts +7 -2
- package/lib/typescript/commonjs/src/providers/anime/animekai/animekai.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animekai/create-animekai.d.ts +3 -3
- package/lib/typescript/commonjs/src/providers/anime/animekai/create-animekai.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animepahe/animepahe.d.ts +7 -2
- 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 +3 -3
- package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animeunity.d.ts +11 -3
- package/lib/typescript/commonjs/src/providers/anime/animeunity.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/anineko/anineko.d.ts +7 -2
- package/lib/typescript/commonjs/src/providers/anime/anineko/anineko.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/anineko/create-anineko.d.ts +3 -3
- package/lib/typescript/commonjs/src/providers/anime/anineko/create-anineko.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/index.d.ts +13 -22
- 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 +1 -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 +7 -2
- package/lib/typescript/commonjs/src/providers/anime/reanime/reanime.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts +3 -3
- package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/zoro/zoro.d.ts +7 -2
- package/lib/typescript/commonjs/src/providers/anime/zoro/zoro.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/index.d.ts +4 -4
- package/lib/typescript/commonjs/src/providers/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/light-novels/index.d.ts +3 -4
- package/lib/typescript/commonjs/src/providers/light-novels/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/light-novels/novelupdates.d.ts +7 -3
- 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 +5 -3
- package/lib/typescript/commonjs/src/providers/light-novels/readlightnovels.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/asurascans.d.ts +19 -7
- package/lib/typescript/commonjs/src/providers/manga/asurascans.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/flamescans.d.ts +23 -6
- package/lib/typescript/commonjs/src/providers/manga/flamescans.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/index.d.ts +7 -24
- package/lib/typescript/commonjs/src/providers/manga/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangadex.d.ts +27 -8
- package/lib/typescript/commonjs/src/providers/manga/mangadex.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangahere.d.ts +20 -6
- package/lib/typescript/commonjs/src/providers/manga/mangahere.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangakakalot.d.ts +31 -7
- package/lib/typescript/commonjs/src/providers/manga/mangakakalot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangapill.d.ts +21 -5
- package/lib/typescript/commonjs/src/providers/manga/mangapill.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts +26 -9
- package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/providers/meta/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/mal.d.ts +9 -4
- package/lib/typescript/commonjs/src/providers/meta/mal.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/tmdb-api-key.d.ts +7 -0
- package/lib/typescript/commonjs/src/providers/meta/tmdb-api-key.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/meta/tmdb.d.ts +18 -5
- package/lib/typescript/commonjs/src/providers/meta/tmdb.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/himovies/himovies.d.ts +8 -3
- package/lib/typescript/commonjs/src/providers/movies/himovies/himovies.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/index.d.ts +14 -10
- package/lib/typescript/commonjs/src/providers/movies/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/multimovies/multimovies.d.ts +8 -3
- package/lib/typescript/commonjs/src/providers/movies/multimovies/multimovies.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/multistream/index.d.ts +10 -3
- package/lib/typescript/commonjs/src/providers/movies/multistream/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts +7 -6
- 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 +2 -6
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/create-netflixmirror.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/disneymirror.d.ts +12 -0
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/disneymirror.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/netflixmirror.d.ts +9 -17
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/netflixmirror.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/netmirror-parser.d.ts +21 -0
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/netmirror-parser.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/primemirror.d.ts +12 -0
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror/primemirror.d.ts.map +1 -0
- 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 +8 -5
- package/lib/typescript/commonjs/src/providers/movies/vegamovies/vegamovies.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/yflix/yflix.d.ts +8 -3
- package/lib/typescript/commonjs/src/providers/movies/yflix/yflix.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/provider-args.d.ts +8 -0
- package/lib/typescript/commonjs/src/providers/provider-args.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/registry-signing-keys.d.ts +18 -0
- package/lib/typescript/commonjs/src/registry-signing-keys.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/ExtractorManager.d.ts +33 -15
- package/lib/typescript/commonjs/src/utils/ExtractorManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts +73 -21
- package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/create-extractor-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/create-provider-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/extension-integrity.d.ts +40 -0
- package/lib/typescript/commonjs/src/utils/extension-integrity.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/extension-modules.d.ts +49 -0
- package/lib/typescript/commonjs/src/utils/extension-modules.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/extension-utils.d.ts +24 -46
- package/lib/typescript/commonjs/src/utils/extension-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/fetch-with-timeout.d.ts +29 -0
- package/lib/typescript/commonjs/src/utils/fetch-with-timeout.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/index.d.ts +12 -4
- package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/manga.d.ts +19 -0
- package/lib/typescript/commonjs/src/utils/manga.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/meta-http.d.ts +16 -0
- package/lib/typescript/commonjs/src/utils/meta-http.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/provider-maps.d.ts +14 -7
- package/lib/typescript/commonjs/src/utils/provider-maps.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/queries.d.ts +17 -8
- package/lib/typescript/commonjs/src/utils/queries.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/registry-schema.d.ts +66 -0
- package/lib/typescript/commonjs/src/utils/registry-schema.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/registry-signature.d.ts +66 -0
- package/lib/typescript/commonjs/src/utils/registry-signature.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/url-polyfill.d.ts +20 -8
- package/lib/typescript/commonjs/src/utils/url-polyfill.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/utils.d.ts +0 -1
- package/lib/typescript/commonjs/src/utils/utils.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeConsumet.d.ts +68 -2
- package/lib/typescript/module/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/asianload.d.ts +5 -3
- package/lib/typescript/module/src/extractors/asianload.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/filemoon.d.ts +5 -3
- package/lib/typescript/module/src/extractors/filemoon.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/flixcloud.d.ts +0 -1
- package/lib/typescript/module/src/extractors/flixcloud.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/gdflix.d.ts +0 -1
- package/lib/typescript/module/src/extractors/gdflix.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/gofile.d.ts +0 -1
- package/lib/typescript/module/src/extractors/gofile.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/gogocdn.d.ts +5 -3
- package/lib/typescript/module/src/extractors/gogocdn.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/hubcloud.d.ts +0 -1
- package/lib/typescript/module/src/extractors/hubcloud.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/index.d.ts +24 -25
- package/lib/typescript/module/src/extractors/index.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/kwik.d.ts +0 -1
- package/lib/typescript/module/src/extractors/kwik.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/megaplay.d.ts +0 -1
- package/lib/typescript/module/src/extractors/megaplay.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/megaup.d.ts +0 -1
- package/lib/typescript/module/src/extractors/megaup.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/mixdrop.d.ts +5 -3
- package/lib/typescript/module/src/extractors/mixdrop.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/mp4player.d.ts +5 -3
- package/lib/typescript/module/src/extractors/mp4player.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/mp4upload.d.ts +5 -3
- package/lib/typescript/module/src/extractors/mp4upload.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/rapidcloud.d.ts +5 -3
- package/lib/typescript/module/src/extractors/rapidcloud.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/streamhub.d.ts +5 -3
- package/lib/typescript/module/src/extractors/streamhub.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/streamlare.d.ts +5 -4
- package/lib/typescript/module/src/extractors/streamlare.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/streamsb.d.ts +5 -3
- package/lib/typescript/module/src/extractors/streamsb.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/streamtape.d.ts +5 -3
- package/lib/typescript/module/src/extractors/streamtape.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/vidhide.d.ts +0 -1
- package/lib/typescript/module/src/extractors/vidhide.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/vidmoly.d.ts +5 -3
- package/lib/typescript/module/src/extractors/vidmoly.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/vizcloud.d.ts +5 -3
- package/lib/typescript/module/src/extractors/vizcloud.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/voe.d.ts +5 -3
- package/lib/typescript/module/src/extractors/voe.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +15 -9
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/base-provider.d.ts +5 -1
- package/lib/typescript/module/src/models/base-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/models/extension-manifest.d.ts +27 -5
- package/lib/typescript/module/src/models/extension-manifest.d.ts.map +1 -1
- package/lib/typescript/module/src/models/extractor-context.d.ts +1 -2
- package/lib/typescript/module/src/models/extractor-context.d.ts.map +1 -1
- package/lib/typescript/module/src/models/index.d.ts +6 -4
- package/lib/typescript/module/src/models/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/meta-error.d.ts +20 -0
- package/lib/typescript/module/src/models/meta-error.d.ts.map +1 -0
- package/lib/typescript/module/src/models/provider-context.d.ts +21 -16
- package/lib/typescript/module/src/models/provider-context.d.ts.map +1 -1
- package/lib/typescript/module/src/models/types.d.ts +144 -8
- package/lib/typescript/module/src/models/types.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/anikoto/anikoto.d.ts +7 -2
- 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 +3 -3
- package/lib/typescript/module/src/providers/anime/anikoto/create-anikoto.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animekai/animekai.d.ts +7 -2
- package/lib/typescript/module/src/providers/anime/animekai/animekai.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animekai/create-animekai.d.ts +3 -3
- package/lib/typescript/module/src/providers/anime/animekai/create-animekai.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animepahe/animepahe.d.ts +7 -2
- 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 +3 -3
- package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animeunity.d.ts +11 -3
- package/lib/typescript/module/src/providers/anime/animeunity.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/anineko/anineko.d.ts +7 -2
- package/lib/typescript/module/src/providers/anime/anineko/anineko.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/anineko/create-anineko.d.ts +3 -3
- package/lib/typescript/module/src/providers/anime/anineko/create-anineko.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/index.d.ts +13 -22
- 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 +1 -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 +7 -2
- package/lib/typescript/module/src/providers/anime/reanime/reanime.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts +3 -3
- package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/zoro/zoro.d.ts +7 -2
- package/lib/typescript/module/src/providers/anime/zoro/zoro.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/index.d.ts +4 -4
- package/lib/typescript/module/src/providers/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/light-novels/index.d.ts +3 -4
- package/lib/typescript/module/src/providers/light-novels/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/light-novels/novelupdates.d.ts +7 -3
- 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 +5 -3
- package/lib/typescript/module/src/providers/light-novels/readlightnovels.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/asurascans.d.ts +19 -7
- package/lib/typescript/module/src/providers/manga/asurascans.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/flamescans.d.ts +23 -6
- package/lib/typescript/module/src/providers/manga/flamescans.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/index.d.ts +7 -24
- package/lib/typescript/module/src/providers/manga/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangadex.d.ts +27 -8
- package/lib/typescript/module/src/providers/manga/mangadex.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangahere.d.ts +20 -6
- package/lib/typescript/module/src/providers/manga/mangahere.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangakakalot.d.ts +31 -7
- package/lib/typescript/module/src/providers/manga/mangakakalot.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangapill.d.ts +21 -5
- package/lib/typescript/module/src/providers/manga/mangapill.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/anilist.d.ts +26 -9
- package/lib/typescript/module/src/providers/meta/anilist.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/index.d.ts +1 -0
- package/lib/typescript/module/src/providers/meta/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/mal.d.ts +9 -4
- package/lib/typescript/module/src/providers/meta/mal.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/tmdb-api-key.d.ts +7 -0
- package/lib/typescript/module/src/providers/meta/tmdb-api-key.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/meta/tmdb.d.ts +18 -5
- package/lib/typescript/module/src/providers/meta/tmdb.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/himovies/himovies.d.ts +8 -3
- package/lib/typescript/module/src/providers/movies/himovies/himovies.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/index.d.ts +14 -10
- package/lib/typescript/module/src/providers/movies/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/multimovies/multimovies.d.ts +8 -3
- package/lib/typescript/module/src/providers/movies/multimovies/multimovies.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/multistream/index.d.ts +10 -3
- package/lib/typescript/module/src/providers/movies/multistream/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts +7 -6
- 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 +2 -6
- package/lib/typescript/module/src/providers/movies/netflixmirror/create-netflixmirror.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/netflixmirror/disneymirror.d.ts +12 -0
- package/lib/typescript/module/src/providers/movies/netflixmirror/disneymirror.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/netflixmirror/netflixmirror.d.ts +9 -17
- package/lib/typescript/module/src/providers/movies/netflixmirror/netflixmirror.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/netflixmirror/netmirror-parser.d.ts +21 -0
- package/lib/typescript/module/src/providers/movies/netflixmirror/netmirror-parser.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/netflixmirror/primemirror.d.ts +12 -0
- package/lib/typescript/module/src/providers/movies/netflixmirror/primemirror.d.ts.map +1 -0
- 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 +8 -5
- package/lib/typescript/module/src/providers/movies/vegamovies/vegamovies.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/yflix/yflix.d.ts +8 -3
- package/lib/typescript/module/src/providers/movies/yflix/yflix.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/provider-args.d.ts +8 -0
- package/lib/typescript/module/src/providers/provider-args.d.ts.map +1 -0
- package/lib/typescript/module/src/registry-signing-keys.d.ts +18 -0
- package/lib/typescript/module/src/registry-signing-keys.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/ExtractorManager.d.ts +33 -15
- package/lib/typescript/module/src/utils/ExtractorManager.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/ProviderManager.d.ts +73 -21
- package/lib/typescript/module/src/utils/ProviderManager.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/create-extractor-context.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/create-provider-context.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/extension-integrity.d.ts +40 -0
- package/lib/typescript/module/src/utils/extension-integrity.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/extension-modules.d.ts +49 -0
- package/lib/typescript/module/src/utils/extension-modules.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/extension-utils.d.ts +24 -46
- package/lib/typescript/module/src/utils/extension-utils.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/fetch-with-timeout.d.ts +29 -0
- package/lib/typescript/module/src/utils/fetch-with-timeout.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/index.d.ts +12 -4
- package/lib/typescript/module/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/manga.d.ts +19 -0
- package/lib/typescript/module/src/utils/manga.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/meta-http.d.ts +16 -0
- package/lib/typescript/module/src/utils/meta-http.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/provider-maps.d.ts +14 -7
- package/lib/typescript/module/src/utils/provider-maps.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/queries.d.ts +17 -8
- package/lib/typescript/module/src/utils/queries.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/registry-schema.d.ts +66 -0
- package/lib/typescript/module/src/utils/registry-schema.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/registry-signature.d.ts +66 -0
- package/lib/typescript/module/src/utils/registry-signature.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/url-polyfill.d.ts +20 -8
- package/lib/typescript/module/src/utils/url-polyfill.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/utils.d.ts +0 -1
- package/lib/typescript/module/src/utils/utils.d.ts.map +1 -1
- package/package.json +30 -19
- package/src/NativeConsumet.ts +68 -2
- package/src/extension-registry.json +174 -54
- package/src/extension-registry.json.sig +1 -0
- package/src/extractors/asianload.ts +10 -7
- package/src/extractors/filemoon.ts +10 -7
- package/src/extractors/flixcloud.ts +0 -2
- package/src/extractors/gdflix.ts +0 -2
- package/src/extractors/gofile.ts +0 -2
- package/src/extractors/gogocdn.ts +12 -9
- package/src/extractors/hubcloud.ts +0 -2
- package/src/extractors/index.ts +24 -51
- package/src/extractors/kwik.ts +0 -2
- package/src/extractors/megaplay.ts +0 -2
- package/src/extractors/megaup.ts +2 -6
- package/src/extractors/mixdrop.ts +9 -5
- package/src/extractors/mp4player.ts +10 -6
- package/src/extractors/mp4upload.ts +9 -5
- package/src/extractors/rapidcloud.ts +15 -12
- package/src/extractors/streamhub.ts +10 -6
- package/src/extractors/streamlare.ts +10 -8
- package/src/extractors/streamsb.ts +10 -7
- package/src/extractors/streamtape.ts +9 -5
- package/src/extractors/vidhide.ts +3 -4
- package/src/extractors/vidmoly.ts +10 -6
- package/src/extractors/vizcloud.ts +10 -7
- package/src/extractors/voe.ts +10 -7
- package/src/index.tsx +115 -3
- package/src/models/base-provider.ts +6 -1
- package/src/models/extension-manifest.ts +30 -6
- package/src/models/extractor-context.ts +0 -2
- package/src/models/index.ts +13 -1
- package/src/models/meta-error.ts +33 -0
- package/src/models/provider-context.ts +21 -58
- package/src/models/types.ts +148 -6
- package/src/providers/anime/anikoto/anikoto.ts +14 -10
- package/src/providers/anime/anikoto/create-anikoto.ts +5 -4
- package/src/providers/anime/animekai/animekai.ts +14 -9
- package/src/providers/anime/animekai/create-animekai.ts +5 -5
- package/src/providers/anime/animepahe/animepahe.ts +14 -11
- package/src/providers/anime/animepahe/create-animepahe.ts +5 -14
- package/src/providers/anime/animeunity.ts +20 -10
- package/src/providers/anime/anineko/anineko.ts +18 -8
- package/src/providers/anime/anineko/create-anineko.ts +3 -2
- package/src/providers/anime/index.ts +13 -21
- package/src/providers/anime/reanime/create-reanime.ts +2 -4
- package/src/providers/anime/reanime/reanime.ts +13 -9
- package/src/providers/anime/zoro/create-zoro.ts +6 -7
- package/src/providers/anime/zoro/zoro.ts +14 -11
- package/src/providers/index.ts +4 -4
- package/src/providers/light-novels/index.ts +3 -3
- package/src/providers/light-novels/novelupdates.ts +33 -19
- package/src/providers/light-novels/readlightnovels.ts +12 -8
- package/src/providers/manga/asurascans.ts +207 -136
- package/src/providers/manga/flamescans.ts +229 -122
- package/src/providers/manga/index.ts +7 -23
- package/src/providers/manga/mangadex.ts +343 -286
- package/src/providers/manga/mangahere.ts +317 -160
- package/src/providers/manga/mangakakalot.ts +257 -156
- package/src/providers/manga/mangapill.ts +172 -69
- package/src/providers/meta/anilist.ts +613 -1450
- package/src/providers/meta/index.ts +6 -1
- package/src/providers/meta/mal.ts +102 -139
- package/src/providers/meta/tmdb-api-key.ts +27 -0
- package/src/providers/meta/tmdb.ts +150 -141
- package/src/providers/movies/himovies/create-himovies.ts +3 -3
- package/src/providers/movies/himovies/himovies.ts +13 -11
- package/src/providers/movies/index.ts +14 -12
- package/src/providers/movies/multimovies/create-multimovies.ts +3 -3
- package/src/providers/movies/multimovies/multimovies.ts +13 -11
- package/src/providers/movies/multistream/index.ts +30 -18
- package/src/providers/movies/multistream/utils.ts +27 -15
- package/src/providers/movies/netflixmirror/create-netflixmirror.ts +567 -232
- package/src/providers/movies/netflixmirror/disneymirror.ts +16 -0
- package/src/providers/movies/netflixmirror/netflixmirror.ts +13 -43
- package/src/providers/movies/netflixmirror/netmirror-parser.ts +43 -0
- package/src/providers/movies/netflixmirror/primemirror.ts +16 -0
- package/src/providers/movies/vegamovies/create-vegamovies.ts +75 -50
- package/src/providers/movies/vegamovies/vegamovies.ts +13 -13
- package/src/providers/movies/yflix/create-yflix.ts +2 -2
- package/src/providers/movies/yflix/yflix.ts +13 -10
- package/src/providers/provider-args.ts +15 -0
- package/src/registry-signing-keys.ts +20 -0
- package/src/utils/ExtractorManager.ts +165 -247
- package/src/utils/ProviderManager.ts +235 -285
- package/src/utils/create-extractor-context.ts +0 -2
- package/src/utils/create-provider-context.ts +45 -29
- package/src/utils/extension-integrity.ts +82 -0
- package/src/utils/extension-modules.ts +123 -0
- package/src/utils/extension-utils.ts +45 -42
- package/src/utils/fetch-with-timeout.ts +76 -0
- package/src/utils/index.ts +32 -4
- package/src/utils/manga.ts +58 -0
- package/src/utils/meta-http.ts +35 -0
- package/src/utils/provider-maps.ts +39 -19
- package/src/utils/queries.ts +30 -26
- package/src/utils/registry-schema.ts +273 -0
- package/src/utils/registry-signature.ts +215 -0
- package/src/utils/url-polyfill.ts +1146 -460
- package/src/utils/utils.ts +0 -26
- package/lib/commonjs/extractors/StreamP2P.js +0 -69
- package/lib/commonjs/extractors/StreamP2P.js.map +0 -1
- package/lib/commonjs/extractors/kisskh/kkey.js +0 -98
- package/lib/commonjs/extractors/kisskh/kkey.js.map +0 -1
- package/lib/commonjs/extractors/kisskh/staticdata.js +0 -9
- package/lib/commonjs/extractors/kisskh/staticdata.js.map +0 -1
- package/lib/commonjs/providers/anime/anify.js +0 -195
- package/lib/commonjs/providers/anime/anify.js.map +0 -1
- package/lib/commonjs/providers/anime/animedrive.js +0 -228
- package/lib/commonjs/providers/anime/animedrive.js.map +0 -1
- package/lib/commonjs/providers/anime/animesuge/animesuge.js +0 -78
- package/lib/commonjs/providers/anime/animesuge/animesuge.js.map +0 -1
- package/lib/commonjs/providers/anime/animesuge/create-animesuge.js +0 -312
- package/lib/commonjs/providers/anime/animesuge/create-animesuge.js.map +0 -1
- package/lib/commonjs/providers/anime/kickassanime.js +0 -48
- package/lib/commonjs/providers/anime/kickassanime.js.map +0 -1
- package/lib/commonjs/providers/anime/marin.js +0 -282
- package/lib/commonjs/providers/anime/marin.js.map +0 -1
- package/lib/commonjs/providers/manga/brmangas.js +0 -105
- package/lib/commonjs/providers/manga/brmangas.js.map +0 -1
- package/lib/commonjs/providers/manga/comick.js +0 -149
- package/lib/commonjs/providers/manga/comick.js.map +0 -1
- package/lib/commonjs/providers/manga/mangahost.js +0 -108
- package/lib/commonjs/providers/manga/mangahost.js.map +0 -1
- package/lib/commonjs/providers/manga/mangapark.js +0 -92
- package/lib/commonjs/providers/manga/mangapark.js.map +0 -1
- package/lib/commonjs/providers/manga/mangareader.js +0 -101
- package/lib/commonjs/providers/manga/mangareader.js.map +0 -1
- package/lib/commonjs/providers/manga/mangasee123.js +0 -156
- package/lib/commonjs/providers/manga/mangasee123.js.map +0 -1
- package/lib/commonjs/providers/manga/readmanga.js +0 -258
- package/lib/commonjs/providers/manga/readmanga.js.map +0 -1
- package/lib/commonjs/providers/manga/vyvymanga.js +0 -161
- package/lib/commonjs/providers/manga/vyvymanga.js.map +0 -1
- package/lib/commonjs/providers/movies/dramacool.js +0 -397
- package/lib/commonjs/providers/movies/dramacool.js.map +0 -1
- package/lib/commonjs/providers/movies/yflix.js +0 -561
- package/lib/commonjs/providers/movies/yflix.js.map +0 -1
- package/lib/module/extractors/StreamP2P.js +0 -63
- package/lib/module/extractors/StreamP2P.js.map +0 -1
- package/lib/module/extractors/kisskh/kkey.js +0 -92
- package/lib/module/extractors/kisskh/kkey.js.map +0 -1
- package/lib/module/extractors/kisskh/staticdata.js +0 -5
- package/lib/module/extractors/kisskh/staticdata.js.map +0 -1
- package/lib/module/providers/anime/anify.js +0 -192
- package/lib/module/providers/anime/anify.js.map +0 -1
- package/lib/module/providers/anime/animedrive.js +0 -223
- package/lib/module/providers/anime/animedrive.js.map +0 -1
- package/lib/module/providers/anime/animesuge/animesuge.js +0 -73
- package/lib/module/providers/anime/animesuge/animesuge.js.map +0 -1
- package/lib/module/providers/anime/animesuge/create-animesuge.js +0 -309
- package/lib/module/providers/anime/animesuge/create-animesuge.js.map +0 -1
- package/lib/module/providers/anime/kickassanime.js +0 -45
- package/lib/module/providers/anime/kickassanime.js.map +0 -1
- package/lib/module/providers/anime/marin.js +0 -281
- package/lib/module/providers/anime/marin.js.map +0 -1
- package/lib/module/providers/manga/brmangas.js +0 -100
- package/lib/module/providers/manga/brmangas.js.map +0 -1
- package/lib/module/providers/manga/comick.js +0 -145
- package/lib/module/providers/manga/comick.js.map +0 -1
- package/lib/module/providers/manga/mangahost.js +0 -103
- package/lib/module/providers/manga/mangahost.js.map +0 -1
- package/lib/module/providers/manga/mangapark.js +0 -87
- package/lib/module/providers/manga/mangapark.js.map +0 -1
- package/lib/module/providers/manga/mangareader.js +0 -97
- package/lib/module/providers/manga/mangareader.js.map +0 -1
- package/lib/module/providers/manga/mangasee123.js +0 -152
- package/lib/module/providers/manga/mangasee123.js.map +0 -1
- package/lib/module/providers/manga/readmanga.js +0 -253
- package/lib/module/providers/manga/readmanga.js.map +0 -1
- package/lib/module/providers/manga/vyvymanga.js +0 -156
- package/lib/module/providers/manga/vyvymanga.js.map +0 -1
- package/lib/module/providers/movies/dramacool.js +0 -397
- package/lib/module/providers/movies/dramacool.js.map +0 -1
- package/lib/module/providers/movies/yflix.js +0 -561
- package/lib/module/providers/movies/yflix.js.map +0 -1
- package/lib/typescript/commonjs/src/extractors/StreamP2P.d.ts +0 -10
- package/lib/typescript/commonjs/src/extractors/StreamP2P.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/kisskh/kkey.d.ts +0 -25
- package/lib/typescript/commonjs/src/extractors/kisskh/kkey.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/kisskh/staticdata.d.ts +0 -3
- package/lib/typescript/commonjs/src/extractors/kisskh/staticdata.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/anify.d.ts +0 -40
- package/lib/typescript/commonjs/src/providers/anime/anify.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/animedrive.d.ts +0 -33
- package/lib/typescript/commonjs/src/providers/anime/animedrive.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/animesuge/animesuge.d.ts +0 -34
- package/lib/typescript/commonjs/src/providers/anime/animesuge/animesuge.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/animesuge/create-animesuge.d.ts +0 -14
- package/lib/typescript/commonjs/src/providers/anime/animesuge/create-animesuge.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/kickassanime.d.ts +0 -30
- package/lib/typescript/commonjs/src/providers/anime/kickassanime.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/marin.d.ts +0 -32
- package/lib/typescript/commonjs/src/providers/anime/marin.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/brmangas.d.ts +0 -16
- package/lib/typescript/commonjs/src/providers/manga/brmangas.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/comick.d.ts +0 -36
- package/lib/typescript/commonjs/src/providers/manga/comick.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/mangahost.d.ts +0 -16
- package/lib/typescript/commonjs/src/providers/manga/mangahost.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/mangapark.d.ts +0 -12
- package/lib/typescript/commonjs/src/providers/manga/mangapark.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/mangareader.d.ts +0 -16
- package/lib/typescript/commonjs/src/providers/manga/mangareader.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/mangasee123.d.ts +0 -15
- package/lib/typescript/commonjs/src/providers/manga/mangasee123.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/readmanga.d.ts +0 -23
- package/lib/typescript/commonjs/src/providers/manga/readmanga.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/vyvymanga.d.ts +0 -15
- package/lib/typescript/commonjs/src/providers/manga/vyvymanga.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/dramacool.d.ts +0 -1
- package/lib/typescript/commonjs/src/providers/movies/dramacool.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/yflix.d.ts +0 -1
- package/lib/typescript/commonjs/src/providers/movies/yflix.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/StreamP2P.d.ts +0 -10
- package/lib/typescript/module/src/extractors/StreamP2P.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/kisskh/kkey.d.ts +0 -25
- package/lib/typescript/module/src/extractors/kisskh/kkey.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/kisskh/staticdata.d.ts +0 -3
- package/lib/typescript/module/src/extractors/kisskh/staticdata.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/anify.d.ts +0 -40
- package/lib/typescript/module/src/providers/anime/anify.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/animedrive.d.ts +0 -33
- package/lib/typescript/module/src/providers/anime/animedrive.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/animesuge/animesuge.d.ts +0 -34
- package/lib/typescript/module/src/providers/anime/animesuge/animesuge.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/animesuge/create-animesuge.d.ts +0 -14
- package/lib/typescript/module/src/providers/anime/animesuge/create-animesuge.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/kickassanime.d.ts +0 -30
- package/lib/typescript/module/src/providers/anime/kickassanime.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/marin.d.ts +0 -32
- package/lib/typescript/module/src/providers/anime/marin.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/brmangas.d.ts +0 -16
- package/lib/typescript/module/src/providers/manga/brmangas.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/comick.d.ts +0 -36
- package/lib/typescript/module/src/providers/manga/comick.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/mangahost.d.ts +0 -16
- package/lib/typescript/module/src/providers/manga/mangahost.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/mangapark.d.ts +0 -12
- package/lib/typescript/module/src/providers/manga/mangapark.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/mangareader.d.ts +0 -16
- package/lib/typescript/module/src/providers/manga/mangareader.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/mangasee123.d.ts +0 -15
- package/lib/typescript/module/src/providers/manga/mangasee123.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/readmanga.d.ts +0 -23
- package/lib/typescript/module/src/providers/manga/readmanga.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/vyvymanga.d.ts +0 -15
- package/lib/typescript/module/src/providers/manga/vyvymanga.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/dramacool.d.ts +0 -1
- package/lib/typescript/module/src/providers/movies/dramacool.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/yflix.d.ts +0 -1
- package/lib/typescript/module/src/providers/movies/yflix.d.ts.map +0 -1
- package/src/extractors/StreamP2P.ts +0 -60
- package/src/extractors/kisskh/kkey.ts +0 -161
- package/src/extractors/kisskh/staticdata.ts +0 -144
- package/src/providers/anime/anify.ts +0 -276
- package/src/providers/anime/animedrive.ts +0 -245
- package/src/providers/anime/animesuge/animesuge.ts +0 -77
- package/src/providers/anime/animesuge/create-animesuge.ts +0 -327
- package/src/providers/anime/kickassanime.ts +0 -51
- package/src/providers/anime/marin.ts +0 -319
- package/src/providers/manga/brmangas.ts +0 -144
- package/src/providers/manga/comick.ts +0 -280
- package/src/providers/manga/mangahost.ts +0 -130
- package/src/providers/manga/mangapark.ts +0 -111
- package/src/providers/manga/mangareader.ts +0 -128
- package/src/providers/manga/mangasee123.ts +0 -183
- package/src/providers/manga/readmanga.ts +0 -367
- package/src/providers/manga/vyvymanga.ts +0 -233
- package/src/providers/movies/dramacool.ts +0 -395
- package/src/providers/movies/yflix.ts +0 -559
|
@@ -1,210 +1,1038 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
/**
|
|
4
|
+
* WHATWG URL and URLSearchParams for Hermes, whose global URL support is incomplete.
|
|
5
|
+
*
|
|
6
|
+
* Extensions get these as `ctx.PolyURL` / `ctx.PolyURLSearchParams`, so every provider and extractor
|
|
7
|
+
* inherits their behaviour. The parser follows the URL Standard (https://url.spec.whatwg.org/) state
|
|
8
|
+
* machine, and test/unit/url-polyfill.test.ts checks it against Node's URL. It never uses a global URL.
|
|
9
|
+
*
|
|
10
|
+
* Known gap: hosts are mapped with NFKC, lower-casing and punycode instead of the full UTS #46 table,
|
|
11
|
+
* so exotic internationalised domain names can differ from a browser.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const EOF = -1;
|
|
15
|
+
|
|
16
|
+
/* -----------------------------
|
|
17
|
+
Code points, UTF-8 and percent-encoding
|
|
18
|
+
----------------------------- */
|
|
19
|
+
|
|
20
|
+
// The code points of a string, with lone surrogates replaced by U+FFFD (USVString conversion).
|
|
21
|
+
function toCodePoints(input) {
|
|
22
|
+
const out = [];
|
|
23
|
+
for (let i = 0; i < input.length; i++) {
|
|
24
|
+
const c = input.charCodeAt(i);
|
|
25
|
+
if (c >= 0xd800 && c <= 0xdbff && i + 1 < input.length) {
|
|
26
|
+
const d = input.charCodeAt(i + 1);
|
|
27
|
+
if (d >= 0xdc00 && d <= 0xdfff) {
|
|
28
|
+
out.push(0x10000 + (c - 0xd800 << 10) + (d - 0xdc00));
|
|
29
|
+
i++;
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
out.push(c >= 0xd800 && c <= 0xdfff ? 0xfffd : c);
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
function fromCodePoints(codePoints) {
|
|
38
|
+
let out = '';
|
|
39
|
+
for (const cp of codePoints) out += String.fromCodePoint(cp);
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
42
|
+
function utf8EncodeCodePoint(cp, bytes) {
|
|
43
|
+
if (cp < 0x80) {
|
|
44
|
+
bytes.push(cp);
|
|
45
|
+
} else if (cp < 0x800) {
|
|
46
|
+
bytes.push(0xc0 | cp >> 6, 0x80 | cp & 0x3f);
|
|
47
|
+
} else if (cp < 0x10000) {
|
|
48
|
+
bytes.push(0xe0 | cp >> 12, 0x80 | cp >> 6 & 0x3f, 0x80 | cp & 0x3f);
|
|
49
|
+
} else {
|
|
50
|
+
bytes.push(0xf0 | cp >> 18, 0x80 | cp >> 12 & 0x3f, 0x80 | cp >> 6 & 0x3f, 0x80 | cp & 0x3f);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function utf8Encode(input) {
|
|
9
54
|
const bytes = [];
|
|
10
|
-
for (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
55
|
+
for (const cp of toCodePoints(input)) utf8EncodeCodePoint(cp, bytes);
|
|
56
|
+
return bytes;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// UTF-8 decode without BOM, replacing invalid sequences with U+FFFD (WHATWG Encoding).
|
|
60
|
+
function utf8Decode(bytes) {
|
|
61
|
+
const out = [];
|
|
62
|
+
let codePoint = 0;
|
|
63
|
+
let bytesSeen = 0;
|
|
64
|
+
let bytesNeeded = 0;
|
|
65
|
+
let lower = 0x80;
|
|
66
|
+
let upper = 0xbf;
|
|
67
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
68
|
+
const byte = bytes[i];
|
|
69
|
+
if (bytesNeeded === 0) {
|
|
70
|
+
if (byte <= 0x7f) {
|
|
71
|
+
out.push(byte);
|
|
72
|
+
} else if (byte >= 0xc2 && byte <= 0xdf) {
|
|
73
|
+
bytesNeeded = 1;
|
|
74
|
+
codePoint = byte & 0x1f;
|
|
75
|
+
} else if (byte >= 0xe0 && byte <= 0xef) {
|
|
76
|
+
if (byte === 0xe0) lower = 0xa0;
|
|
77
|
+
if (byte === 0xed) upper = 0x9f;
|
|
78
|
+
bytesNeeded = 2;
|
|
79
|
+
codePoint = byte & 0xf;
|
|
80
|
+
} else if (byte >= 0xf0 && byte <= 0xf4) {
|
|
81
|
+
if (byte === 0xf0) lower = 0x90;
|
|
82
|
+
if (byte === 0xf4) upper = 0x8f;
|
|
83
|
+
bytesNeeded = 3;
|
|
84
|
+
codePoint = byte & 0x7;
|
|
85
|
+
} else {
|
|
86
|
+
out.push(0xfffd);
|
|
87
|
+
}
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (byte < lower || byte > upper) {
|
|
91
|
+
codePoint = bytesNeeded = bytesSeen = 0;
|
|
92
|
+
lower = 0x80;
|
|
93
|
+
upper = 0xbf;
|
|
94
|
+
out.push(0xfffd);
|
|
95
|
+
i--; // reprocess this byte
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
lower = 0x80;
|
|
99
|
+
upper = 0xbf;
|
|
100
|
+
codePoint = codePoint << 6 | byte & 0x3f;
|
|
101
|
+
bytesSeen++;
|
|
102
|
+
if (bytesSeen === bytesNeeded) {
|
|
103
|
+
out.push(codePoint);
|
|
104
|
+
codePoint = bytesNeeded = bytesSeen = 0;
|
|
28
105
|
}
|
|
29
106
|
}
|
|
30
|
-
|
|
107
|
+
if (bytesNeeded !== 0) out.push(0xfffd);
|
|
108
|
+
return fromCodePoints(out);
|
|
31
109
|
}
|
|
32
|
-
|
|
33
|
-
|
|
110
|
+
const isASCIIDigit = c => c >= 0x30 && c <= 0x39;
|
|
111
|
+
const isASCIIAlpha = c => c >= 0x41 && c <= 0x5a || c >= 0x61 && c <= 0x7a;
|
|
112
|
+
const isASCIIAlphanumeric = c => isASCIIDigit(c) || isASCIIAlpha(c);
|
|
113
|
+
const isASCIIHex = c => isASCIIDigit(c) || c >= 0x41 && c <= 0x46 || c >= 0x61 && c <= 0x66;
|
|
114
|
+
const lowerASCII = c => c >= 0x41 && c <= 0x5a ? c + 0x20 : c;
|
|
115
|
+
function isASCII(input) {
|
|
116
|
+
for (let i = 0; i < input.length; i++) if (input.charCodeAt(i) > 0x7f) return false;
|
|
117
|
+
return true;
|
|
34
118
|
}
|
|
35
|
-
|
|
36
|
-
|
|
119
|
+
|
|
120
|
+
// Remove leading and trailing C0 controls and spaces.
|
|
121
|
+
function trimC0ControlOrSpace(input) {
|
|
122
|
+
let start = 0;
|
|
123
|
+
let end = input.length;
|
|
124
|
+
while (start < end && input.charCodeAt(start) <= 0x20) start++;
|
|
125
|
+
while (end > start && input.charCodeAt(end - 1) <= 0x20) end--;
|
|
126
|
+
return input.slice(start, end);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Percent-encode sets, as predicates on a code point. Each set extends another with ASCII characters.
|
|
130
|
+
|
|
131
|
+
function charTable(chars) {
|
|
132
|
+
const table = [];
|
|
133
|
+
for (let i = 0; i < chars.length; i++) table[chars.charCodeAt(i)] = true;
|
|
134
|
+
return table;
|
|
135
|
+
}
|
|
136
|
+
function extendSet(base, chars) {
|
|
137
|
+
const table = charTable(chars);
|
|
138
|
+
return c => base(c) || table[c] === true;
|
|
139
|
+
}
|
|
140
|
+
const inC0ControlSet = c => c <= 0x1f || c > 0x7e;
|
|
141
|
+
const inFragmentSet = extendSet(inC0ControlSet, ' "<>`');
|
|
142
|
+
const inQuerySet = extendSet(inC0ControlSet, ' "#<>');
|
|
143
|
+
const inSpecialQuerySet = extendSet(inQuerySet, "'");
|
|
144
|
+
const inPathSet = extendSet(inQuerySet, '?^`{}');
|
|
145
|
+
const inUserinfoSet = extendSet(inPathSet, '/:;=@[\\]|');
|
|
146
|
+
const inComponentSet = extendSet(inUserinfoSet, '$%&+,');
|
|
147
|
+
const inFormSet = extendSet(inComponentSet, "!'()~");
|
|
148
|
+
function percentEncodeCodePoint(cp, set) {
|
|
149
|
+
if (!set(cp)) return String.fromCodePoint(cp);
|
|
150
|
+
const bytes = [];
|
|
151
|
+
utf8EncodeCodePoint(cp, bytes);
|
|
37
152
|
let out = '';
|
|
38
|
-
const bytes
|
|
153
|
+
for (const b of bytes) out += '%' + (b < 0x10 ? '0' : '') + b.toString(16).toUpperCase();
|
|
154
|
+
return out;
|
|
155
|
+
}
|
|
156
|
+
function percentEncodeString(input, set, spaceAsPlus = false) {
|
|
157
|
+
let out = '';
|
|
158
|
+
for (const cp of toCodePoints(input)) out += spaceAsPlus && cp === 0x20 ? '+' : percentEncodeCodePoint(cp, set);
|
|
159
|
+
return out;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Percent-decode a string into bytes; a `%` not followed by two hex digits stays as is.
|
|
163
|
+
function percentDecode(input) {
|
|
164
|
+
const bytes = utf8Encode(input);
|
|
165
|
+
const out = [];
|
|
39
166
|
for (let i = 0; i < bytes.length; i++) {
|
|
40
167
|
const b = bytes[i];
|
|
41
|
-
|
|
42
|
-
|
|
168
|
+
if (b === 0x25 && i + 2 < bytes.length && isASCIIHex(bytes[i + 1]) && isASCIIHex(bytes[i + 2])) {
|
|
169
|
+
out.push(parseInt(String.fromCharCode(bytes[i + 1], bytes[i + 2]), 16));
|
|
170
|
+
i += 2;
|
|
171
|
+
} else {
|
|
172
|
+
out.push(b);
|
|
173
|
+
}
|
|
43
174
|
}
|
|
44
175
|
return out;
|
|
45
176
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
177
|
+
|
|
178
|
+
/* -----------------------------
|
|
179
|
+
application/x-www-form-urlencoded
|
|
180
|
+
----------------------------- */
|
|
181
|
+
|
|
182
|
+
function parseFormUrlencoded(input) {
|
|
183
|
+
const decode = s => utf8Decode(percentDecode(s.replace(/\+/g, ' ')));
|
|
184
|
+
const out = [];
|
|
185
|
+
for (const sequence of input.split('&')) {
|
|
186
|
+
if (sequence === '') continue;
|
|
187
|
+
const eq = sequence.indexOf('=');
|
|
188
|
+
const name = eq === -1 ? sequence : sequence.slice(0, eq);
|
|
189
|
+
const value = eq === -1 ? '' : sequence.slice(eq + 1);
|
|
190
|
+
out.push([decode(name), decode(value)]);
|
|
191
|
+
}
|
|
192
|
+
return out;
|
|
193
|
+
}
|
|
194
|
+
function serializeFormUrlencoded(list) {
|
|
195
|
+
return list.map(([name, value]) => `${percentEncodeString(name, inFormSet, true)}=${percentEncodeString(value, inFormSet, true)}`).join('&');
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* -----------------------------
|
|
199
|
+
Hosts
|
|
200
|
+
----------------------------- */
|
|
201
|
+
|
|
202
|
+
const FORBIDDEN_HOST_CODE_POINTS = charTable('\u0000\t\n\r #/:<>?@[\\]^|');
|
|
203
|
+
const isForbiddenHostCodePoint = c => FORBIDDEN_HOST_CODE_POINTS[c] === true;
|
|
204
|
+
const isForbiddenDomainCodePoint = c => isForbiddenHostCodePoint(c) || c <= 0x1f || c === 0x25 || c === 0x7f;
|
|
205
|
+
function parseIPv4Number(input) {
|
|
206
|
+
if (input === '') return null;
|
|
207
|
+
let radix = 10;
|
|
208
|
+
if (input.length >= 2 && input[0] === '0' && (input[1] === 'x' || input[1] === 'X')) {
|
|
209
|
+
input = input.slice(2);
|
|
210
|
+
radix = 16;
|
|
211
|
+
} else if (input.length >= 2 && input[0] === '0') {
|
|
212
|
+
input = input.slice(1);
|
|
213
|
+
radix = 8;
|
|
214
|
+
}
|
|
215
|
+
if (input === '') return 0;
|
|
216
|
+
const digits = radix === 10 ? /^[0-9]+$/ : radix === 16 ? /^[0-9A-Fa-f]+$/ : /^[0-7]+$/;
|
|
217
|
+
if (!digits.test(input)) return null;
|
|
218
|
+
return parseInt(input, radix);
|
|
219
|
+
}
|
|
220
|
+
function endsInANumber(input) {
|
|
221
|
+
const parts = input.split('.');
|
|
222
|
+
if (parts[parts.length - 1] === '') {
|
|
223
|
+
if (parts.length === 1) return false;
|
|
224
|
+
parts.pop();
|
|
225
|
+
}
|
|
226
|
+
const last = parts[parts.length - 1];
|
|
227
|
+
if (/^[0-9]+$/.test(last)) return true;
|
|
228
|
+
return parseIPv4Number(last) !== null;
|
|
229
|
+
}
|
|
230
|
+
function parseIPv4(input) {
|
|
231
|
+
const parts = input.split('.');
|
|
232
|
+
if (parts[parts.length - 1] === '' && parts.length > 1) parts.pop();
|
|
233
|
+
if (parts.length > 4) return null;
|
|
234
|
+
const numbers = [];
|
|
235
|
+
for (const part of parts) {
|
|
236
|
+
const n = parseIPv4Number(part);
|
|
237
|
+
if (n === null) return null;
|
|
238
|
+
numbers.push(n);
|
|
239
|
+
}
|
|
240
|
+
for (let i = 0; i < numbers.length - 1; i++) if (numbers[i] > 255) return null;
|
|
241
|
+
let ipv4 = numbers[numbers.length - 1];
|
|
242
|
+
if (ipv4 >= Math.pow(256, 5 - numbers.length)) return null;
|
|
243
|
+
for (let i = 0; i < numbers.length - 1; i++) ipv4 += numbers[i] * Math.pow(256, 3 - i);
|
|
244
|
+
let out = '';
|
|
245
|
+
for (let i = 0; i < 4; i++) {
|
|
246
|
+
out = String(ipv4 % 256) + (i === 0 ? '' : '.') + out;
|
|
247
|
+
ipv4 = Math.floor(ipv4 / 256);
|
|
248
|
+
}
|
|
249
|
+
return out;
|
|
250
|
+
}
|
|
251
|
+
function parseIPv6(input) {
|
|
252
|
+
const cps = toCodePoints(input);
|
|
253
|
+
const at = i => i < cps.length ? cps[i] : EOF;
|
|
254
|
+
const address = [0, 0, 0, 0, 0, 0, 0, 0];
|
|
255
|
+
let pieceIndex = 0;
|
|
256
|
+
let compress = null;
|
|
257
|
+
let pointer = 0;
|
|
258
|
+
if (at(pointer) === 0x3a) {
|
|
259
|
+
if (at(pointer + 1) !== 0x3a) return null;
|
|
260
|
+
pointer += 2;
|
|
261
|
+
compress = ++pieceIndex;
|
|
262
|
+
}
|
|
263
|
+
while (at(pointer) !== EOF) {
|
|
264
|
+
if (pieceIndex === 8) return null;
|
|
265
|
+
if (at(pointer) === 0x3a) {
|
|
266
|
+
if (compress !== null) return null;
|
|
267
|
+
pointer++;
|
|
268
|
+
compress = ++pieceIndex;
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
let value = 0;
|
|
272
|
+
let length = 0;
|
|
273
|
+
while (length < 4 && isASCIIHex(at(pointer))) {
|
|
274
|
+
value = value * 0x10 + parseInt(String.fromCharCode(at(pointer)), 16);
|
|
275
|
+
pointer++;
|
|
276
|
+
length++;
|
|
277
|
+
}
|
|
278
|
+
if (at(pointer) === 0x2e) {
|
|
279
|
+
// Embedded IPv4 address
|
|
280
|
+
if (length === 0) return null;
|
|
281
|
+
pointer -= length;
|
|
282
|
+
if (pieceIndex > 6) return null;
|
|
283
|
+
let numbersSeen = 0;
|
|
284
|
+
while (at(pointer) !== EOF) {
|
|
285
|
+
let ipv4Piece = null;
|
|
286
|
+
if (numbersSeen > 0) {
|
|
287
|
+
if (at(pointer) === 0x2e && numbersSeen < 4) pointer++;else return null;
|
|
288
|
+
}
|
|
289
|
+
if (!isASCIIDigit(at(pointer))) return null;
|
|
290
|
+
while (isASCIIDigit(at(pointer))) {
|
|
291
|
+
const n = at(pointer) - 0x30;
|
|
292
|
+
if (ipv4Piece === null) ipv4Piece = n;else if (ipv4Piece === 0) return null;else ipv4Piece = ipv4Piece * 10 + n;
|
|
293
|
+
if (ipv4Piece > 255) return null;
|
|
294
|
+
pointer++;
|
|
64
295
|
}
|
|
296
|
+
address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece;
|
|
297
|
+
numbersSeen++;
|
|
298
|
+
if (numbersSeen === 2 || numbersSeen === 4) pieceIndex++;
|
|
65
299
|
}
|
|
66
|
-
|
|
67
|
-
|
|
300
|
+
if (numbersSeen !== 4) return null;
|
|
301
|
+
break;
|
|
302
|
+
} else if (at(pointer) === 0x3a) {
|
|
303
|
+
pointer++;
|
|
304
|
+
if (at(pointer) === EOF) return null;
|
|
305
|
+
} else if (at(pointer) !== EOF) {
|
|
306
|
+
return null;
|
|
68
307
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const b2 = bytes[i + 1] ?? 0x80;
|
|
83
|
-
const b3 = bytes[i + 2] ?? 0x80;
|
|
84
|
-
const code = (b & 0x0f) << 12 | (b2 & 0x3f) << 6 | b3 & 0x3f;
|
|
85
|
-
res += String.fromCharCode(code);
|
|
86
|
-
i += 3;
|
|
87
|
-
} else if (b >= 0xf0) {
|
|
88
|
-
const b2 = bytes[i + 1] ?? 0x80,
|
|
89
|
-
b3 = bytes[i + 2] ?? 0x80,
|
|
90
|
-
b4 = bytes[i + 3] ?? 0x80;
|
|
91
|
-
const codePoint = (b & 7) << 18 | (b2 & 0x3f) << 12 | (b3 & 0x3f) << 6 | b4 & 0x3f;
|
|
92
|
-
const cp = codePoint - 0x10000;
|
|
93
|
-
res += String.fromCharCode(0xd800 + (cp >> 10), 0xdc00 + (cp & 0x3ff));
|
|
94
|
-
i += 4;
|
|
95
|
-
} else {
|
|
96
|
-
i++;
|
|
97
|
-
}
|
|
308
|
+
address[pieceIndex] = value;
|
|
309
|
+
pieceIndex++;
|
|
310
|
+
}
|
|
311
|
+
if (compress !== null) {
|
|
312
|
+
let swaps = pieceIndex - compress;
|
|
313
|
+
pieceIndex = 7;
|
|
314
|
+
while (pieceIndex !== 0 && swaps > 0) {
|
|
315
|
+
const other = compress + swaps - 1;
|
|
316
|
+
const tmp = address[other];
|
|
317
|
+
address[other] = address[pieceIndex];
|
|
318
|
+
address[pieceIndex] = tmp;
|
|
319
|
+
pieceIndex--;
|
|
320
|
+
swaps--;
|
|
98
321
|
}
|
|
99
|
-
|
|
322
|
+
} else if (pieceIndex !== 8) {
|
|
323
|
+
return null;
|
|
100
324
|
}
|
|
325
|
+
return address;
|
|
101
326
|
}
|
|
102
|
-
function
|
|
103
|
-
|
|
327
|
+
function serializeIPv6(address) {
|
|
328
|
+
// Compress the first longest run of two or more zero pieces.
|
|
329
|
+
let compress = null;
|
|
330
|
+
let longest = 1;
|
|
331
|
+
for (let i = 0; i < 8;) {
|
|
332
|
+
if (address[i] !== 0) {
|
|
333
|
+
i++;
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
let end = i;
|
|
337
|
+
while (end < 8 && address[end] === 0) end++;
|
|
338
|
+
if (end - i > longest) {
|
|
339
|
+
longest = end - i;
|
|
340
|
+
compress = i;
|
|
341
|
+
}
|
|
342
|
+
i = end;
|
|
343
|
+
}
|
|
344
|
+
let out = '';
|
|
345
|
+
let ignore0 = false;
|
|
346
|
+
for (let i = 0; i < 8; i++) {
|
|
347
|
+
if (ignore0 && address[i] === 0) continue;
|
|
348
|
+
ignore0 = false;
|
|
349
|
+
if (compress === i) {
|
|
350
|
+
out += i === 0 ? '::' : ':';
|
|
351
|
+
ignore0 = true;
|
|
352
|
+
continue;
|
|
353
|
+
}
|
|
354
|
+
out += address[i].toString(16);
|
|
355
|
+
if (i !== 7) out += ':';
|
|
356
|
+
}
|
|
357
|
+
return out;
|
|
104
358
|
}
|
|
105
359
|
|
|
106
|
-
//
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
360
|
+
// Code points UTS #46 maps to nothing (soft hyphen, zero-width space and joiners, variation selectors, BOM).
|
|
361
|
+
const IGNORED_IN_DOMAINS = /[\u00AD\u034F\u180B-\u180F\u200B\u2060\u2064\uFE00-\uFE0F\uFEFF]/g;
|
|
362
|
+
function normalizeUnicode(input, form) {
|
|
363
|
+
try {
|
|
364
|
+
return typeof input.normalize === 'function' ? input.normalize(form) : input;
|
|
365
|
+
} catch {
|
|
366
|
+
return input;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
function punycodeEncode(input) {
|
|
370
|
+
const base = 36;
|
|
371
|
+
const tMin = 1;
|
|
372
|
+
const tMax = 26;
|
|
373
|
+
const digit = d => String.fromCharCode(d < 26 ? 0x61 + d : 0x16 + d);
|
|
374
|
+
const adapt = (delta, numPoints, firstTime) => {
|
|
375
|
+
delta = firstTime ? Math.floor(delta / 700) : delta >> 1;
|
|
376
|
+
delta += Math.floor(delta / numPoints);
|
|
377
|
+
let k = 0;
|
|
378
|
+
while (delta > (base - tMin) * tMax >> 1) {
|
|
379
|
+
delta = Math.floor(delta / (base - tMin));
|
|
380
|
+
k += base;
|
|
381
|
+
}
|
|
382
|
+
return k + Math.floor((base - tMin + 1) * delta / (delta + 38));
|
|
383
|
+
};
|
|
384
|
+
let out = '';
|
|
385
|
+
for (const cp of input) if (cp < 0x80) out += String.fromCharCode(cp);
|
|
386
|
+
const basicLength = out.length;
|
|
387
|
+
let handled = basicLength;
|
|
388
|
+
if (basicLength > 0) out += '-';
|
|
389
|
+
let n = 0x80;
|
|
390
|
+
let delta = 0;
|
|
391
|
+
let bias = 72;
|
|
392
|
+
while (handled < input.length) {
|
|
393
|
+
let m = Infinity;
|
|
394
|
+
for (const cp of input) if (cp >= n && cp < m) m = cp;
|
|
395
|
+
delta += (m - n) * (handled + 1);
|
|
396
|
+
n = m;
|
|
397
|
+
for (const cp of input) {
|
|
398
|
+
if (cp < n) delta++;
|
|
399
|
+
if (cp === n) {
|
|
400
|
+
let q = delta;
|
|
401
|
+
for (let k = base;; k += base) {
|
|
402
|
+
const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
403
|
+
if (q < t) break;
|
|
404
|
+
out += digit(t + (q - t) % (base - t));
|
|
405
|
+
q = Math.floor((q - t) / (base - t));
|
|
406
|
+
}
|
|
407
|
+
out += digit(q);
|
|
408
|
+
bias = adapt(delta, handled + 1, handled === basicLength);
|
|
409
|
+
delta = 0;
|
|
410
|
+
handled++;
|
|
119
411
|
}
|
|
120
|
-
} else {
|
|
121
|
-
normalized.push(segment);
|
|
122
412
|
}
|
|
413
|
+
delta++;
|
|
414
|
+
n++;
|
|
415
|
+
}
|
|
416
|
+
return out;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// Domain to ASCII. ASCII input is lower-cased; other input gets an approximation of UTS #46 mapping
|
|
420
|
+
// (ignored code points removed, NFKC, per-code-point lower case, NFC) and punycode per label.
|
|
421
|
+
function domainToASCII(domain) {
|
|
422
|
+
let result;
|
|
423
|
+
if (isASCII(domain)) {
|
|
424
|
+
result = domain.replace(/[A-Z]+/g, m => m.toLowerCase());
|
|
425
|
+
} else {
|
|
426
|
+
let mapped = normalizeUnicode(domain.replace(IGNORED_IN_DOMAINS, ''), 'NFKC');
|
|
427
|
+
mapped = normalizeUnicode(toCodePoints(mapped).map(toLowerCodePoint).join(''), 'NFC');
|
|
428
|
+
mapped = mapped.replace(/[\u3002\uFF0E\uFF61]/g, '.');
|
|
429
|
+
// U+FFFD comes from invalid percent-encoded UTF-8; C1 controls are disallowed too.
|
|
430
|
+
if (/[\u0080-\u009f\uFFFD]/.test(mapped)) return null;
|
|
431
|
+
result = mapped.split('.').map(label => isASCII(label) ? label : 'xn--' + punycodeEncode(toCodePoints(label))).join('.');
|
|
432
|
+
}
|
|
433
|
+
if (result === '') return null;
|
|
434
|
+
for (let i = 0; i < result.length; i++) if (isForbiddenDomainCodePoint(result.charCodeAt(i))) return null;
|
|
435
|
+
return result;
|
|
436
|
+
}
|
|
437
|
+
function toLowerCodePoint(cp) {
|
|
438
|
+
return String.fromCodePoint(cp).toLowerCase();
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// Parse a host; returns the serialized host or null on failure.
|
|
442
|
+
function parseHost(input, isOpaque) {
|
|
443
|
+
if (input.startsWith('[')) {
|
|
444
|
+
if (!input.endsWith(']')) return null;
|
|
445
|
+
const address = parseIPv6(input.slice(1, -1));
|
|
446
|
+
return address ? `[${serializeIPv6(address)}]` : null;
|
|
447
|
+
}
|
|
448
|
+
if (isOpaque) {
|
|
449
|
+
for (const cp of toCodePoints(input)) if (isForbiddenHostCodePoint(cp)) return null;
|
|
450
|
+
return percentEncodeString(input, inC0ControlSet);
|
|
123
451
|
}
|
|
124
|
-
|
|
125
|
-
if (
|
|
126
|
-
if (
|
|
127
|
-
return
|
|
452
|
+
const asciiDomain = domainToASCII(utf8Decode(percentDecode(input)));
|
|
453
|
+
if (asciiDomain === null) return null;
|
|
454
|
+
if (endsInANumber(asciiDomain)) return parseIPv4(asciiDomain);
|
|
455
|
+
return asciiDomain;
|
|
128
456
|
}
|
|
129
457
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
458
|
+
/* -----------------------------
|
|
459
|
+
URL records and the basic URL parser
|
|
460
|
+
----------------------------- */
|
|
461
|
+
|
|
462
|
+
// Special schemes and their default ports (file has none).
|
|
463
|
+
function specialSchemePort(scheme) {
|
|
464
|
+
switch (scheme) {
|
|
465
|
+
case 'ftp':
|
|
466
|
+
return 21;
|
|
467
|
+
case 'http':
|
|
468
|
+
case 'ws':
|
|
469
|
+
return 80;
|
|
470
|
+
case 'https':
|
|
471
|
+
case 'wss':
|
|
472
|
+
return 443;
|
|
473
|
+
case 'file':
|
|
474
|
+
return null;
|
|
475
|
+
default:
|
|
476
|
+
return undefined;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
const isSpecialScheme = scheme => specialSchemePort(scheme) !== undefined;
|
|
480
|
+
const includesCredentials = url => url.username !== '' || url.password !== '';
|
|
481
|
+
const cannotHaveCredentialsOrPort = url => url.host === null || url.host === '' || url.scheme === 'file';
|
|
482
|
+
const isWindowsDriveLetter = s => /^[A-Za-z][:|]$/.test(s);
|
|
483
|
+
const isNormalizedWindowsDriveLetter = s => /^[A-Za-z]:$/.test(s);
|
|
484
|
+
const isSingleDotSegment = s => s === '.' || s.toLowerCase() === '%2e';
|
|
485
|
+
const isDoubleDotSegment = s => {
|
|
486
|
+
const lower = s.toLowerCase();
|
|
487
|
+
return lower === '..' || lower === '.%2e' || lower === '%2e.' || lower === '%2e%2e';
|
|
139
488
|
};
|
|
489
|
+
function startsWithWindowsDriveLetter(cps, pointer) {
|
|
490
|
+
if (cps.length - pointer < 2) return false;
|
|
491
|
+
const first = cps[pointer];
|
|
492
|
+
const second = cps[pointer + 1];
|
|
493
|
+
if (!isASCIIAlpha(first) || second !== 0x3a && second !== 0x7c) return false;
|
|
494
|
+
if (cps.length - pointer === 2) return true;
|
|
495
|
+
const third = cps[pointer + 2];
|
|
496
|
+
return third === 0x2f || third === 0x5c || third === 0x3f || third === 0x23;
|
|
497
|
+
}
|
|
498
|
+
function pathList(url) {
|
|
499
|
+
if (typeof url.path === 'string') url.path = [];
|
|
500
|
+
return url.path;
|
|
501
|
+
}
|
|
502
|
+
function shortenPath(url) {
|
|
503
|
+
const path = pathList(url);
|
|
504
|
+
if (url.scheme === 'file' && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) return;
|
|
505
|
+
path.pop();
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
// Parser states
|
|
509
|
+
const SCHEME_START = 1;
|
|
510
|
+
const SCHEME = 2;
|
|
511
|
+
const NO_SCHEME = 3;
|
|
512
|
+
const SPECIAL_RELATIVE_OR_AUTHORITY = 4;
|
|
513
|
+
const PATH_OR_AUTHORITY = 5;
|
|
514
|
+
const RELATIVE = 6;
|
|
515
|
+
const RELATIVE_SLASH = 7;
|
|
516
|
+
const SPECIAL_AUTHORITY_SLASHES = 8;
|
|
517
|
+
const SPECIAL_AUTHORITY_IGNORE_SLASHES = 9;
|
|
518
|
+
const AUTHORITY = 10;
|
|
519
|
+
const HOST = 11;
|
|
520
|
+
const HOSTNAME = 12;
|
|
521
|
+
const PORT = 13;
|
|
522
|
+
const FILE = 14;
|
|
523
|
+
const FILE_SLASH = 15;
|
|
524
|
+
const FILE_HOST = 16;
|
|
525
|
+
const PATH_START = 17;
|
|
526
|
+
const PATH = 18;
|
|
527
|
+
const OPAQUE_PATH = 19;
|
|
528
|
+
const QUERY = 20;
|
|
529
|
+
const FRAGMENT = 21;
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* The URL Standard's basic URL parser. Returns the URL record, or null on failure. With `url` and
|
|
533
|
+
* `stateOverride` (used by the setters) it modifies `url` in place.
|
|
534
|
+
*/
|
|
535
|
+
function basicURLParse(input, base, url, stateOverride) {
|
|
536
|
+
let record;
|
|
537
|
+
if (url) {
|
|
538
|
+
record = url;
|
|
539
|
+
} else {
|
|
540
|
+
record = {
|
|
541
|
+
scheme: '',
|
|
542
|
+
username: '',
|
|
543
|
+
password: '',
|
|
544
|
+
host: null,
|
|
545
|
+
port: null,
|
|
546
|
+
path: [],
|
|
547
|
+
query: null,
|
|
548
|
+
fragment: null
|
|
549
|
+
};
|
|
550
|
+
input = trimC0ControlOrSpace(input);
|
|
551
|
+
}
|
|
552
|
+
input = input.replace(/[\t\n\r]/g, '');
|
|
553
|
+
const cps = toCodePoints(input);
|
|
554
|
+
const special = () => isSpecialScheme(record.scheme);
|
|
555
|
+
let state = stateOverride || SCHEME_START;
|
|
556
|
+
let buffer = '';
|
|
557
|
+
let atSignSeen = false;
|
|
558
|
+
let insideBrackets = false;
|
|
559
|
+
let passwordTokenSeen = false;
|
|
560
|
+
for (let pointer = 0; pointer <= cps.length; pointer++) {
|
|
561
|
+
const c = pointer < cps.length ? cps[pointer] : EOF;
|
|
562
|
+
const next = pointer + 1 < cps.length ? cps[pointer + 1] : EOF;
|
|
563
|
+
switch (state) {
|
|
564
|
+
case SCHEME_START:
|
|
565
|
+
if (isASCIIAlpha(c)) {
|
|
566
|
+
buffer += String.fromCharCode(lowerASCII(c));
|
|
567
|
+
state = SCHEME;
|
|
568
|
+
} else if (!stateOverride) {
|
|
569
|
+
state = NO_SCHEME;
|
|
570
|
+
pointer--;
|
|
571
|
+
} else {
|
|
572
|
+
return null;
|
|
573
|
+
}
|
|
574
|
+
break;
|
|
575
|
+
case SCHEME:
|
|
576
|
+
if (isASCIIAlphanumeric(c) || c === 0x2b || c === 0x2d || c === 0x2e) {
|
|
577
|
+
buffer += String.fromCharCode(lowerASCII(c));
|
|
578
|
+
} else if (c === 0x3a) {
|
|
579
|
+
if (stateOverride) {
|
|
580
|
+
if (isSpecialScheme(record.scheme) !== isSpecialScheme(buffer)) return record;
|
|
581
|
+
if ((includesCredentials(record) || record.port !== null) && buffer === 'file') return record;
|
|
582
|
+
if (record.scheme === 'file' && record.host === '') return record;
|
|
583
|
+
}
|
|
584
|
+
record.scheme = buffer;
|
|
585
|
+
if (stateOverride) {
|
|
586
|
+
if (record.port === specialSchemePort(record.scheme)) record.port = null;
|
|
587
|
+
return record;
|
|
588
|
+
}
|
|
589
|
+
buffer = '';
|
|
590
|
+
if (record.scheme === 'file') {
|
|
591
|
+
state = FILE;
|
|
592
|
+
} else if (special() && base && base.scheme === record.scheme) {
|
|
593
|
+
state = SPECIAL_RELATIVE_OR_AUTHORITY;
|
|
594
|
+
} else if (special()) {
|
|
595
|
+
state = SPECIAL_AUTHORITY_SLASHES;
|
|
596
|
+
} else if (next === 0x2f) {
|
|
597
|
+
state = PATH_OR_AUTHORITY;
|
|
598
|
+
pointer++;
|
|
599
|
+
} else {
|
|
600
|
+
record.path = '';
|
|
601
|
+
state = OPAQUE_PATH;
|
|
602
|
+
}
|
|
603
|
+
} else if (!stateOverride) {
|
|
604
|
+
buffer = '';
|
|
605
|
+
state = NO_SCHEME;
|
|
606
|
+
pointer = -1; // start over
|
|
607
|
+
} else {
|
|
608
|
+
return null;
|
|
609
|
+
}
|
|
610
|
+
break;
|
|
611
|
+
case NO_SCHEME:
|
|
612
|
+
if (!base || typeof base.path === 'string' && c !== 0x23) {
|
|
613
|
+
return null;
|
|
614
|
+
} else if (typeof base.path === 'string' && c === 0x23) {
|
|
615
|
+
record.scheme = base.scheme;
|
|
616
|
+
record.path = base.path;
|
|
617
|
+
record.query = base.query;
|
|
618
|
+
record.fragment = '';
|
|
619
|
+
state = FRAGMENT;
|
|
620
|
+
} else if (base.scheme !== 'file') {
|
|
621
|
+
state = RELATIVE;
|
|
622
|
+
pointer--;
|
|
623
|
+
} else {
|
|
624
|
+
state = FILE;
|
|
625
|
+
pointer--;
|
|
626
|
+
}
|
|
627
|
+
break;
|
|
628
|
+
case SPECIAL_RELATIVE_OR_AUTHORITY:
|
|
629
|
+
if (c === 0x2f && next === 0x2f) {
|
|
630
|
+
state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
|
|
631
|
+
pointer++;
|
|
632
|
+
} else {
|
|
633
|
+
state = RELATIVE;
|
|
634
|
+
pointer--;
|
|
635
|
+
}
|
|
636
|
+
break;
|
|
637
|
+
case PATH_OR_AUTHORITY:
|
|
638
|
+
if (c === 0x2f) {
|
|
639
|
+
state = AUTHORITY;
|
|
640
|
+
} else {
|
|
641
|
+
state = PATH;
|
|
642
|
+
pointer--;
|
|
643
|
+
}
|
|
644
|
+
break;
|
|
645
|
+
case RELATIVE:
|
|
646
|
+
record.scheme = base.scheme;
|
|
647
|
+
if (c === 0x2f || special() && c === 0x5c) {
|
|
648
|
+
state = RELATIVE_SLASH;
|
|
649
|
+
} else {
|
|
650
|
+
record.username = base.username;
|
|
651
|
+
record.password = base.password;
|
|
652
|
+
record.host = base.host;
|
|
653
|
+
record.port = base.port;
|
|
654
|
+
record.path = typeof base.path === 'string' ? base.path : base.path.slice();
|
|
655
|
+
record.query = base.query;
|
|
656
|
+
if (c === 0x3f) {
|
|
657
|
+
record.query = '';
|
|
658
|
+
state = QUERY;
|
|
659
|
+
} else if (c === 0x23) {
|
|
660
|
+
record.fragment = '';
|
|
661
|
+
state = FRAGMENT;
|
|
662
|
+
} else if (c !== EOF) {
|
|
663
|
+
record.query = null;
|
|
664
|
+
shortenPath(record);
|
|
665
|
+
state = PATH;
|
|
666
|
+
pointer--;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
break;
|
|
670
|
+
case RELATIVE_SLASH:
|
|
671
|
+
if (special() && (c === 0x2f || c === 0x5c)) {
|
|
672
|
+
state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
|
|
673
|
+
} else if (c === 0x2f) {
|
|
674
|
+
state = AUTHORITY;
|
|
675
|
+
} else {
|
|
676
|
+
record.username = base.username;
|
|
677
|
+
record.password = base.password;
|
|
678
|
+
record.host = base.host;
|
|
679
|
+
record.port = base.port;
|
|
680
|
+
state = PATH;
|
|
681
|
+
pointer--;
|
|
682
|
+
}
|
|
683
|
+
break;
|
|
684
|
+
case SPECIAL_AUTHORITY_SLASHES:
|
|
685
|
+
state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
|
|
686
|
+
if (c === 0x2f && next === 0x2f) pointer++;else pointer--;
|
|
687
|
+
break;
|
|
688
|
+
case SPECIAL_AUTHORITY_IGNORE_SLASHES:
|
|
689
|
+
if (c !== 0x2f && c !== 0x5c) {
|
|
690
|
+
state = AUTHORITY;
|
|
691
|
+
pointer--;
|
|
692
|
+
}
|
|
693
|
+
break;
|
|
694
|
+
case AUTHORITY:
|
|
695
|
+
if (c === 0x40) {
|
|
696
|
+
if (atSignSeen) buffer = '%40' + buffer;
|
|
697
|
+
atSignSeen = true;
|
|
698
|
+
for (const bc of toCodePoints(buffer)) {
|
|
699
|
+
if (bc === 0x3a && !passwordTokenSeen) {
|
|
700
|
+
passwordTokenSeen = true;
|
|
701
|
+
continue;
|
|
702
|
+
}
|
|
703
|
+
const encoded = percentEncodeCodePoint(bc, inUserinfoSet);
|
|
704
|
+
if (passwordTokenSeen) record.password += encoded;else record.username += encoded;
|
|
705
|
+
}
|
|
706
|
+
buffer = '';
|
|
707
|
+
} else if (c === EOF || c === 0x2f || c === 0x3f || c === 0x23 || special() && c === 0x5c) {
|
|
708
|
+
if (atSignSeen && buffer === '') return null;
|
|
709
|
+
pointer -= toCodePoints(buffer).length + 1;
|
|
710
|
+
buffer = '';
|
|
711
|
+
state = HOST;
|
|
712
|
+
} else {
|
|
713
|
+
buffer += String.fromCodePoint(c);
|
|
714
|
+
}
|
|
715
|
+
break;
|
|
716
|
+
case HOST:
|
|
717
|
+
case HOSTNAME:
|
|
718
|
+
if (stateOverride && record.scheme === 'file') {
|
|
719
|
+
pointer--;
|
|
720
|
+
state = FILE_HOST;
|
|
721
|
+
} else if (c === 0x3a && !insideBrackets) {
|
|
722
|
+
if (buffer === '') return null;
|
|
723
|
+
if (stateOverride === HOSTNAME) return null;
|
|
724
|
+
const host = parseHost(buffer, !special());
|
|
725
|
+
if (host === null) return null;
|
|
726
|
+
record.host = host;
|
|
727
|
+
buffer = '';
|
|
728
|
+
state = PORT;
|
|
729
|
+
} else if (c === EOF || c === 0x2f || c === 0x3f || c === 0x23 || special() && c === 0x5c) {
|
|
730
|
+
pointer--;
|
|
731
|
+
if (special() && buffer === '') return null;
|
|
732
|
+
if (stateOverride && buffer === '' && (includesCredentials(record) || record.port !== null)) return null;
|
|
733
|
+
const host = parseHost(buffer, !special());
|
|
734
|
+
if (host === null) return null;
|
|
735
|
+
record.host = host;
|
|
736
|
+
buffer = '';
|
|
737
|
+
state = PATH_START;
|
|
738
|
+
if (stateOverride) return record;
|
|
739
|
+
} else {
|
|
740
|
+
if (c === 0x5b) insideBrackets = true;
|
|
741
|
+
if (c === 0x5d) insideBrackets = false;
|
|
742
|
+
buffer += String.fromCodePoint(c);
|
|
743
|
+
}
|
|
744
|
+
break;
|
|
745
|
+
case PORT:
|
|
746
|
+
if (isASCIIDigit(c)) {
|
|
747
|
+
buffer += String.fromCharCode(c);
|
|
748
|
+
} else if (c === EOF || c === 0x2f || c === 0x3f || c === 0x23 || special() && c === 0x5c || stateOverride) {
|
|
749
|
+
if (buffer !== '') {
|
|
750
|
+
const port = parseInt(buffer, 10);
|
|
751
|
+
if (port > 65535) return null;
|
|
752
|
+
record.port = port === specialSchemePort(record.scheme) ? null : port;
|
|
753
|
+
buffer = '';
|
|
754
|
+
if (stateOverride) return record;
|
|
755
|
+
}
|
|
756
|
+
if (stateOverride) return null;
|
|
757
|
+
state = PATH_START;
|
|
758
|
+
pointer--;
|
|
759
|
+
} else {
|
|
760
|
+
return null;
|
|
761
|
+
}
|
|
762
|
+
break;
|
|
763
|
+
case FILE:
|
|
764
|
+
record.scheme = 'file';
|
|
765
|
+
record.host = '';
|
|
766
|
+
if (c === 0x2f || c === 0x5c) {
|
|
767
|
+
state = FILE_SLASH;
|
|
768
|
+
} else if (base && base.scheme === 'file') {
|
|
769
|
+
record.host = base.host;
|
|
770
|
+
record.path = typeof base.path === 'string' ? base.path : base.path.slice();
|
|
771
|
+
record.query = base.query;
|
|
772
|
+
if (c === 0x3f) {
|
|
773
|
+
record.query = '';
|
|
774
|
+
state = QUERY;
|
|
775
|
+
} else if (c === 0x23) {
|
|
776
|
+
record.fragment = '';
|
|
777
|
+
state = FRAGMENT;
|
|
778
|
+
} else if (c !== EOF) {
|
|
779
|
+
record.query = null;
|
|
780
|
+
if (!startsWithWindowsDriveLetter(cps, pointer)) shortenPath(record);else record.path = [];
|
|
781
|
+
state = PATH;
|
|
782
|
+
pointer--;
|
|
783
|
+
}
|
|
784
|
+
} else {
|
|
785
|
+
state = PATH;
|
|
786
|
+
pointer--;
|
|
787
|
+
}
|
|
788
|
+
break;
|
|
789
|
+
case FILE_SLASH:
|
|
790
|
+
if (c === 0x2f || c === 0x5c) {
|
|
791
|
+
state = FILE_HOST;
|
|
792
|
+
} else {
|
|
793
|
+
if (base && base.scheme === 'file') {
|
|
794
|
+
record.host = base.host;
|
|
795
|
+
const basePath = base.path;
|
|
796
|
+
if (!startsWithWindowsDriveLetter(cps, pointer) && typeof basePath !== 'string' && basePath.length > 0 && isNormalizedWindowsDriveLetter(basePath[0])) {
|
|
797
|
+
pathList(record).push(basePath[0]);
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
state = PATH;
|
|
801
|
+
pointer--;
|
|
802
|
+
}
|
|
803
|
+
break;
|
|
804
|
+
case FILE_HOST:
|
|
805
|
+
if (c === EOF || c === 0x2f || c === 0x5c || c === 0x3f || c === 0x23) {
|
|
806
|
+
pointer--;
|
|
807
|
+
if (!stateOverride && isWindowsDriveLetter(buffer)) {
|
|
808
|
+
state = PATH; // the buffer is kept and becomes the first path segment
|
|
809
|
+
} else if (buffer === '') {
|
|
810
|
+
record.host = '';
|
|
811
|
+
if (stateOverride) return record;
|
|
812
|
+
state = PATH_START;
|
|
813
|
+
} else {
|
|
814
|
+
let host = parseHost(buffer, !special());
|
|
815
|
+
if (host === null) return null;
|
|
816
|
+
if (host === 'localhost') host = '';
|
|
817
|
+
record.host = host;
|
|
818
|
+
if (stateOverride) return record;
|
|
819
|
+
buffer = '';
|
|
820
|
+
state = PATH_START;
|
|
821
|
+
}
|
|
822
|
+
} else {
|
|
823
|
+
buffer += String.fromCodePoint(c);
|
|
824
|
+
}
|
|
825
|
+
break;
|
|
826
|
+
case PATH_START:
|
|
827
|
+
if (special()) {
|
|
828
|
+
state = PATH;
|
|
829
|
+
if (c !== 0x2f && c !== 0x5c) pointer--;
|
|
830
|
+
} else if (!stateOverride && c === 0x3f) {
|
|
831
|
+
record.query = '';
|
|
832
|
+
state = QUERY;
|
|
833
|
+
} else if (!stateOverride && c === 0x23) {
|
|
834
|
+
record.fragment = '';
|
|
835
|
+
state = FRAGMENT;
|
|
836
|
+
} else if (c !== EOF) {
|
|
837
|
+
state = PATH;
|
|
838
|
+
if (c !== 0x2f) pointer--;
|
|
839
|
+
} else if (stateOverride && record.host === null) {
|
|
840
|
+
pathList(record).push('');
|
|
841
|
+
}
|
|
842
|
+
break;
|
|
843
|
+
case PATH:
|
|
844
|
+
if (c === EOF || c === 0x2f || special() && c === 0x5c || !stateOverride && (c === 0x3f || c === 0x23)) {
|
|
845
|
+
const slash = c === 0x2f || special() && c === 0x5c;
|
|
846
|
+
const path = pathList(record);
|
|
847
|
+
if (isDoubleDotSegment(buffer)) {
|
|
848
|
+
shortenPath(record);
|
|
849
|
+
if (!slash) path.push('');
|
|
850
|
+
} else if (isSingleDotSegment(buffer)) {
|
|
851
|
+
if (!slash) path.push('');
|
|
852
|
+
} else {
|
|
853
|
+
if (record.scheme === 'file' && path.length === 0 && isWindowsDriveLetter(buffer)) {
|
|
854
|
+
buffer = buffer[0] + ':';
|
|
855
|
+
}
|
|
856
|
+
path.push(buffer);
|
|
857
|
+
}
|
|
858
|
+
buffer = '';
|
|
859
|
+
if (c === 0x3f) {
|
|
860
|
+
record.query = '';
|
|
861
|
+
state = QUERY;
|
|
862
|
+
} else if (c === 0x23) {
|
|
863
|
+
record.fragment = '';
|
|
864
|
+
state = FRAGMENT;
|
|
865
|
+
}
|
|
866
|
+
} else {
|
|
867
|
+
buffer += percentEncodeCodePoint(c, inPathSet);
|
|
868
|
+
}
|
|
869
|
+
break;
|
|
870
|
+
case OPAQUE_PATH:
|
|
871
|
+
if (c === 0x3f) {
|
|
872
|
+
record.query = '';
|
|
873
|
+
state = QUERY;
|
|
874
|
+
} else if (c === 0x23) {
|
|
875
|
+
record.fragment = '';
|
|
876
|
+
state = FRAGMENT;
|
|
877
|
+
} else if (c === 0x20) {
|
|
878
|
+
record.path += next === 0x3f || next === 0x23 ? '%20' : ' ';
|
|
879
|
+
} else if (c !== EOF) {
|
|
880
|
+
record.path += percentEncodeCodePoint(c, inC0ControlSet);
|
|
881
|
+
}
|
|
882
|
+
break;
|
|
883
|
+
case QUERY:
|
|
884
|
+
if (!stateOverride && c === 0x23 || c === EOF) {
|
|
885
|
+
record.query = (record.query ?? '') + percentEncodeString(buffer, special() ? inSpecialQuerySet : inQuerySet);
|
|
886
|
+
buffer = '';
|
|
887
|
+
if (c === 0x23) {
|
|
888
|
+
record.fragment = '';
|
|
889
|
+
state = FRAGMENT;
|
|
890
|
+
}
|
|
891
|
+
} else {
|
|
892
|
+
buffer += String.fromCodePoint(c);
|
|
893
|
+
}
|
|
894
|
+
break;
|
|
895
|
+
case FRAGMENT:
|
|
896
|
+
if (c !== EOF) record.fragment = (record.fragment ?? '') + percentEncodeCodePoint(c, inFragmentSet);
|
|
897
|
+
break;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
return record;
|
|
901
|
+
}
|
|
902
|
+
function serializePath(url) {
|
|
903
|
+
if (typeof url.path === 'string') return url.path;
|
|
904
|
+
let out = '';
|
|
905
|
+
for (const segment of url.path) out += '/' + segment;
|
|
906
|
+
return out;
|
|
907
|
+
}
|
|
908
|
+
function serializeURL(url) {
|
|
909
|
+
let out = url.scheme + ':';
|
|
910
|
+
if (url.host !== null) {
|
|
911
|
+
out += '//';
|
|
912
|
+
if (includesCredentials(url)) {
|
|
913
|
+
out += url.username;
|
|
914
|
+
if (url.password !== '') out += ':' + url.password;
|
|
915
|
+
out += '@';
|
|
916
|
+
}
|
|
917
|
+
out += url.host;
|
|
918
|
+
if (url.port !== null) out += ':' + url.port;
|
|
919
|
+
} else if (typeof url.path !== 'string' && url.path.length > 1 && url.path[0] === '') {
|
|
920
|
+
out += '/.';
|
|
921
|
+
}
|
|
922
|
+
out += serializePath(url);
|
|
923
|
+
if (url.query !== null) out += '?' + url.query;
|
|
924
|
+
if (url.fragment !== null) out += '#' + url.fragment;
|
|
925
|
+
return out;
|
|
926
|
+
}
|
|
927
|
+
function serializeOrigin(url) {
|
|
928
|
+
switch (url.scheme) {
|
|
929
|
+
case 'blob':
|
|
930
|
+
{
|
|
931
|
+
const inner = basicURLParse(serializePath(url), null);
|
|
932
|
+
return inner && (inner.scheme === 'http' || inner.scheme === 'https') ? serializeOrigin(inner) : 'null';
|
|
933
|
+
}
|
|
934
|
+
case 'ftp':
|
|
935
|
+
case 'http':
|
|
936
|
+
case 'https':
|
|
937
|
+
case 'ws':
|
|
938
|
+
case 'wss':
|
|
939
|
+
return `${url.scheme}://${url.host}${url.port !== null ? ':' + url.port : ''}`;
|
|
940
|
+
default:
|
|
941
|
+
return 'null';
|
|
942
|
+
}
|
|
943
|
+
}
|
|
140
944
|
|
|
141
945
|
/* -----------------------------
|
|
142
946
|
URLSearchParams Implementation
|
|
143
947
|
----------------------------- */
|
|
144
948
|
|
|
949
|
+
// What the owning URL needs to reach inside its URLSearchParams.
|
|
950
|
+
|
|
951
|
+
const internals = params => params;
|
|
145
952
|
export class URLSearchParams {
|
|
953
|
+
_list = [];
|
|
954
|
+
// The record of the URL whose `searchParams` this is; mutations rewrite its query.
|
|
955
|
+
_url = null;
|
|
146
956
|
constructor(init) {
|
|
147
|
-
|
|
148
|
-
if (
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
} else if (typeof init === 'object') {
|
|
164
|
-
Object.keys(init).forEach(k => this.set(k, init[k]));
|
|
957
|
+
if (init === undefined) return;
|
|
958
|
+
if (init !== null && (typeof init === 'object' || typeof init === 'function')) {
|
|
959
|
+
const iterable = init;
|
|
960
|
+
if (typeof iterable[Symbol.iterator] === 'function') {
|
|
961
|
+
for (const pair of iterable) {
|
|
962
|
+
const items = pair !== null && typeof pair === 'object' ? Array.from(pair) : null;
|
|
963
|
+
if (!items || items.length !== 2) {
|
|
964
|
+
throw new TypeError('Each query pair must be an iterable [name, value] tuple');
|
|
965
|
+
}
|
|
966
|
+
this._list.push([toUSVString(items[0]), toUSVString(items[1])]);
|
|
967
|
+
}
|
|
968
|
+
} else {
|
|
969
|
+
const record = init;
|
|
970
|
+
for (const key of Object.keys(record)) this._list.push([toUSVString(key), toUSVString(record[key])]);
|
|
971
|
+
}
|
|
972
|
+
return;
|
|
165
973
|
}
|
|
974
|
+
const query = String(init);
|
|
975
|
+
this._list = parseFormUrlencoded(query.startsWith('?') ? query.slice(1) : query);
|
|
976
|
+
}
|
|
977
|
+
_update() {
|
|
978
|
+
if (!this._url) return;
|
|
979
|
+
const serialized = serializeFormUrlencoded(this._list);
|
|
980
|
+
this._url.query = serialized === '' ? null : serialized;
|
|
166
981
|
}
|
|
167
982
|
append(name, value) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
const arr = this._map.get(key) || [];
|
|
171
|
-
arr.push(val);
|
|
172
|
-
this._map.set(key, arr);
|
|
983
|
+
this._list.push([toUSVString(name), toUSVString(value)]);
|
|
984
|
+
this._update();
|
|
173
985
|
}
|
|
174
986
|
set(name, value) {
|
|
175
|
-
|
|
987
|
+
const key = toUSVString(name);
|
|
988
|
+
const val = toUSVString(value);
|
|
989
|
+
const index = this._list.findIndex(([k]) => k === key);
|
|
990
|
+
if (index === -1) {
|
|
991
|
+
this._list.push([key, val]);
|
|
992
|
+
} else {
|
|
993
|
+
this._list[index] = [key, val];
|
|
994
|
+
this._list = this._list.filter(([k], i) => i <= index || k !== key);
|
|
995
|
+
}
|
|
996
|
+
this._update();
|
|
176
997
|
}
|
|
177
998
|
get(name) {
|
|
178
|
-
const
|
|
179
|
-
|
|
999
|
+
const key = toUSVString(name);
|
|
1000
|
+
const pair = this._list.find(([k]) => k === key);
|
|
1001
|
+
return pair ? pair[1] : null;
|
|
180
1002
|
}
|
|
181
1003
|
getAll(name) {
|
|
182
|
-
|
|
1004
|
+
const key = toUSVString(name);
|
|
1005
|
+
return this._list.filter(([k]) => k === key).map(([, v]) => v);
|
|
183
1006
|
}
|
|
184
|
-
has(name) {
|
|
185
|
-
|
|
1007
|
+
has(name, value) {
|
|
1008
|
+
const key = toUSVString(name);
|
|
1009
|
+
const val = value === undefined ? undefined : toUSVString(value);
|
|
1010
|
+
return this._list.some(([k, v]) => k === key && (val === undefined || v === val));
|
|
186
1011
|
}
|
|
187
|
-
delete(name) {
|
|
188
|
-
|
|
1012
|
+
delete(name, value) {
|
|
1013
|
+
const key = toUSVString(name);
|
|
1014
|
+
const val = value === undefined ? undefined : toUSVString(value);
|
|
1015
|
+
this._list = this._list.filter(([k, v]) => !(k === key && (val === undefined || v === val)));
|
|
1016
|
+
this._update();
|
|
189
1017
|
}
|
|
190
1018
|
forEach(cb, thisArg) {
|
|
191
|
-
for (
|
|
192
|
-
|
|
1019
|
+
for (let i = 0; i < this._list.length; i++) {
|
|
1020
|
+
const [k, v] = this._list[i];
|
|
1021
|
+
cb.call(thisArg, v, k, this);
|
|
193
1022
|
}
|
|
194
1023
|
}
|
|
195
1024
|
toString() {
|
|
196
|
-
|
|
197
|
-
for (const [k, vals] of this._map) {
|
|
198
|
-
for (const v of vals) {
|
|
199
|
-
out.push(`${encodeComponent(k)}=${encodeComponent(v)}`);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
return out.join('&');
|
|
1025
|
+
return serializeFormUrlencoded(this._list);
|
|
203
1026
|
}
|
|
204
1027
|
sort() {
|
|
205
|
-
// Stable sort by
|
|
206
|
-
|
|
207
|
-
|
|
1028
|
+
// Stable sort by name, comparing code units.
|
|
1029
|
+
this._list = this._list.map((pair, index) => ({
|
|
1030
|
+
pair,
|
|
1031
|
+
index
|
|
1032
|
+
})).sort((a, b) => a.pair[0] < b.pair[0] ? -1 : a.pair[0] > b.pair[0] ? 1 : a.index - b.index).map(({
|
|
1033
|
+
pair
|
|
1034
|
+
}) => pair);
|
|
1035
|
+
this._update();
|
|
208
1036
|
}
|
|
209
1037
|
toJSON() {
|
|
210
1038
|
return this.toString();
|
|
@@ -215,354 +1043,174 @@ export class URLSearchParams {
|
|
|
215
1043
|
|
|
216
1044
|
// Additional utility methods
|
|
217
1045
|
get size() {
|
|
218
|
-
|
|
219
|
-
for (const [, vals] of this._map) {
|
|
220
|
-
count += vals.length;
|
|
221
|
-
}
|
|
222
|
-
return count;
|
|
1046
|
+
return this._list.length;
|
|
223
1047
|
}
|
|
224
1048
|
clear() {
|
|
225
|
-
this.
|
|
1049
|
+
this._list = [];
|
|
1050
|
+
this._update();
|
|
226
1051
|
}
|
|
227
1052
|
*entries() {
|
|
228
|
-
for (
|
|
1053
|
+
for (let i = 0; i < this._list.length; i++) {
|
|
1054
|
+
const [k, v] = this._list[i];
|
|
1055
|
+
yield [k, v];
|
|
1056
|
+
}
|
|
229
1057
|
}
|
|
230
1058
|
*keys() {
|
|
231
|
-
for (
|
|
1059
|
+
for (let i = 0; i < this._list.length; i++) yield this._list[i][0];
|
|
232
1060
|
}
|
|
233
1061
|
*values() {
|
|
234
|
-
for (
|
|
1062
|
+
for (let i = 0; i < this._list.length; i++) yield this._list[i][1];
|
|
235
1063
|
}
|
|
236
1064
|
[Symbol.iterator]() {
|
|
237
1065
|
return this.entries();
|
|
238
1066
|
}
|
|
239
1067
|
}
|
|
1068
|
+
function toUSVString(value) {
|
|
1069
|
+
const s = String(value);
|
|
1070
|
+
return /[\ud800-\udfff]/.test(s) ? fromCodePoints(toCodePoints(s)) : s;
|
|
1071
|
+
}
|
|
240
1072
|
|
|
241
1073
|
/* -----------------------------
|
|
242
1074
|
URL Implementation
|
|
243
1075
|
----------------------------- */
|
|
244
1076
|
|
|
245
|
-
const SCHEME_RE = /^([A-Za-z][A-Za-z0-9+.-]*):/;
|
|
246
|
-
function splitBeforeFirst(haystack, needle) {
|
|
247
|
-
const idx = haystack.indexOf(needle);
|
|
248
|
-
if (idx === -1) return [haystack, ''];
|
|
249
|
-
return [haystack.slice(0, idx), haystack.slice(idx + needle.length)];
|
|
250
|
-
}
|
|
251
|
-
function parseURLString(input, base) {
|
|
252
|
-
let url = input.trim();
|
|
253
|
-
|
|
254
|
-
// Handle data URLs and other special schemes
|
|
255
|
-
if (url.match(/^(data|mailto|tel|sms):/i)) {
|
|
256
|
-
const [scheme, rest] = splitBeforeFirst(url, ':');
|
|
257
|
-
return {
|
|
258
|
-
protocol: scheme.toLowerCase() + ':',
|
|
259
|
-
username: '',
|
|
260
|
-
password: '',
|
|
261
|
-
host: '',
|
|
262
|
-
hostname: '',
|
|
263
|
-
port: '',
|
|
264
|
-
pathname: rest || '',
|
|
265
|
-
search: '',
|
|
266
|
-
hash: '',
|
|
267
|
-
origin: 'null'
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// If base is provided and url is relative, resolve
|
|
272
|
-
if (base) {
|
|
273
|
-
// handle scheme-relative: //host/path
|
|
274
|
-
if (url.startsWith('//')) {
|
|
275
|
-
url = base.protocol + url;
|
|
276
|
-
} else if (!SCHEME_RE.test(url)) {
|
|
277
|
-
// relative path
|
|
278
|
-
// join base.pathname directory with url
|
|
279
|
-
const basePath = base.pathname;
|
|
280
|
-
let dir = basePath.slice(0, basePath.lastIndexOf('/') + 1);
|
|
281
|
-
if (!dir.endsWith('/')) dir += '/';
|
|
282
|
-
url = `${base.protocol}//${base.host}${dir}${url}`;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
const protocolMatch = url.match(SCHEME_RE);
|
|
286
|
-
const protocol = protocolMatch ? protocolMatch[1].toLowerCase() + ':' : '';
|
|
287
|
-
let rest = protocol ? url.slice(protocol.length) : url;
|
|
288
|
-
|
|
289
|
-
// If protocol present, remove single leading slashes
|
|
290
|
-
if (protocol) {
|
|
291
|
-
if (rest.startsWith('///')) {
|
|
292
|
-
// weird but handle
|
|
293
|
-
rest = '//' + rest.slice(3);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
// Extract hash
|
|
298
|
-
let [withoutHash, hash] = splitBeforeFirst(rest, '#');
|
|
299
|
-
if (hash) hash = '#' + hash;
|
|
300
|
-
|
|
301
|
-
// Extract search
|
|
302
|
-
let [beforeSearch, search] = splitBeforeFirst(withoutHash, '?');
|
|
303
|
-
if (search) search = '?' + search;
|
|
304
|
-
|
|
305
|
-
// authority and path
|
|
306
|
-
let authority = '';
|
|
307
|
-
let pathname = '';
|
|
308
|
-
if (beforeSearch.startsWith('//')) {
|
|
309
|
-
const afterSlashes = beforeSearch.slice(2);
|
|
310
|
-
const idx = afterSlashes.indexOf('/');
|
|
311
|
-
if (idx === -1) {
|
|
312
|
-
authority = afterSlashes;
|
|
313
|
-
pathname = '/';
|
|
314
|
-
} else {
|
|
315
|
-
authority = afterSlashes.slice(0, idx);
|
|
316
|
-
pathname = afterSlashes.slice(idx) || '/';
|
|
317
|
-
}
|
|
318
|
-
} else {
|
|
319
|
-
pathname = beforeSearch || '';
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
// parse username/password and host/port
|
|
323
|
-
let username = '';
|
|
324
|
-
let password = '';
|
|
325
|
-
let host = '';
|
|
326
|
-
let hostname = '';
|
|
327
|
-
let port = '';
|
|
328
|
-
if (authority) {
|
|
329
|
-
// userinfo@host:port
|
|
330
|
-
const atIdx = authority.lastIndexOf('@');
|
|
331
|
-
let hostport = authority;
|
|
332
|
-
if (atIdx !== -1) {
|
|
333
|
-
const userinfo = authority.slice(0, atIdx);
|
|
334
|
-
hostport = authority.slice(atIdx + 1);
|
|
335
|
-
const [u, p] = splitBeforeFirst(userinfo, ':');
|
|
336
|
-
username = decodePercentEncoded(u);
|
|
337
|
-
password = p ? decodePercentEncoded(p) : '';
|
|
338
|
-
}
|
|
339
|
-
// IPv6 in [..]:port
|
|
340
|
-
if (hostport.startsWith('[')) {
|
|
341
|
-
const closeIdx = hostport.indexOf(']');
|
|
342
|
-
if (closeIdx !== -1) {
|
|
343
|
-
hostname = hostport.slice(0, closeIdx + 1);
|
|
344
|
-
port = hostport.slice(closeIdx + 1);
|
|
345
|
-
if (port.startsWith(':')) port = port.slice(1);
|
|
346
|
-
} else {
|
|
347
|
-
hostname = hostport; // malformed, but take as hostname
|
|
348
|
-
}
|
|
349
|
-
} else {
|
|
350
|
-
const colonIdx = hostport.lastIndexOf(':');
|
|
351
|
-
if (colonIdx > hostport.indexOf(']')) {
|
|
352
|
-
// normal
|
|
353
|
-
}
|
|
354
|
-
if (colonIdx !== -1 && hostport.indexOf(':') === colonIdx) {
|
|
355
|
-
hostname = hostport.slice(0, colonIdx);
|
|
356
|
-
port = hostport.slice(colonIdx + 1);
|
|
357
|
-
} else {
|
|
358
|
-
hostname = hostport;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
hostname = hostname || '';
|
|
362
|
-
host = port ? `${hostname}:${port}` : hostname;
|
|
363
|
-
host = host.trim();
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
// Normalization
|
|
367
|
-
if (!pathname) pathname = '/';
|
|
368
|
-
pathname = normalizePath(decodePercentEncoded(pathname));
|
|
369
|
-
|
|
370
|
-
// If hostname present but protocol empty (like relative), try to use base
|
|
371
|
-
let origin = '';
|
|
372
|
-
if (protocol && host) {
|
|
373
|
-
origin = protocol + '//' + host;
|
|
374
|
-
} else if (base && !protocol) {
|
|
375
|
-
origin = base.origin;
|
|
376
|
-
} else if (protocol && !host) {
|
|
377
|
-
origin = protocol + '//';
|
|
378
|
-
}
|
|
379
|
-
return {
|
|
380
|
-
protocol: protocol,
|
|
381
|
-
username,
|
|
382
|
-
password,
|
|
383
|
-
host,
|
|
384
|
-
hostname,
|
|
385
|
-
port,
|
|
386
|
-
pathname,
|
|
387
|
-
search: search || '',
|
|
388
|
-
hash: hash || '',
|
|
389
|
-
origin
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
1077
|
export class URL {
|
|
1078
|
+
/** @throws {TypeError} if `input` (resolved against `base`) or `base` is not a valid URL. */
|
|
393
1079
|
constructor(input, base) {
|
|
394
|
-
let
|
|
395
|
-
if (base
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
1080
|
+
let baseRecord = null;
|
|
1081
|
+
if (base !== undefined) {
|
|
1082
|
+
baseRecord = base instanceof URL ? base._r : basicURLParse(String(base), null);
|
|
1083
|
+
if (baseRecord === null) throw new TypeError(`Invalid base URL: ${String(base)}`);
|
|
1084
|
+
}
|
|
1085
|
+
const record = basicURLParse(String(input), baseRecord);
|
|
1086
|
+
if (record === null) throw new TypeError(`Invalid URL: ${String(input)}`);
|
|
1087
|
+
this._r = record;
|
|
1088
|
+
this.searchParams = new URLSearchParams();
|
|
1089
|
+
internals(this.searchParams)._url = record;
|
|
1090
|
+
this._resetSearchParams();
|
|
401
1091
|
}
|
|
402
|
-
_bindSearchParamsUpdates() {
|
|
403
|
-
const origToString = this.searchParams.toString.bind(this.searchParams);
|
|
404
|
-
const self = this;
|
|
405
1092
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
const fn = this.searchParams[m];
|
|
410
|
-
if (typeof fn === 'function') {
|
|
411
|
-
this.searchParams[m] = function (...args) {
|
|
412
|
-
const res = fn.apply(this, args);
|
|
413
|
-
const newSearch = origToString();
|
|
414
|
-
self._p.search = newSearch ? '?' + newSearch : '';
|
|
415
|
-
return res;
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
}
|
|
1093
|
+
// Refill searchParams from the query, keeping the same object (as the standard requires).
|
|
1094
|
+
_resetSearchParams() {
|
|
1095
|
+
internals(this.searchParams)._list = this._r.query !== null ? parseFormUrlencoded(this._r.query) : [];
|
|
419
1096
|
}
|
|
420
1097
|
|
|
421
1098
|
// Static helper methods
|
|
422
1099
|
static canParse(url, base) {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
return false;
|
|
1100
|
+
let baseRecord = null;
|
|
1101
|
+
if (base !== undefined) {
|
|
1102
|
+
baseRecord = base instanceof URL ? base._r : basicURLParse(String(base), null);
|
|
1103
|
+
if (baseRecord === null) return false;
|
|
428
1104
|
}
|
|
1105
|
+
return basicURLParse(String(url), baseRecord) !== null;
|
|
429
1106
|
}
|
|
430
1107
|
static parse(url, base) {
|
|
431
|
-
|
|
432
|
-
return new URL(url, base);
|
|
433
|
-
} catch {
|
|
434
|
-
return null;
|
|
435
|
-
}
|
|
1108
|
+
return URL.canParse(url, base) ? new URL(url, base) : null;
|
|
436
1109
|
}
|
|
437
1110
|
get href() {
|
|
438
|
-
return this.
|
|
1111
|
+
return serializeURL(this._r);
|
|
439
1112
|
}
|
|
440
1113
|
set href(val) {
|
|
441
|
-
const parsed =
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
this.
|
|
1114
|
+
const parsed = basicURLParse(String(val), null);
|
|
1115
|
+
if (parsed === null) throw new TypeError(`Invalid URL: ${String(val)}`);
|
|
1116
|
+
// Update in place: searchParams holds a reference to this record.
|
|
1117
|
+
Object.assign(this._r, parsed);
|
|
1118
|
+
this._resetSearchParams();
|
|
445
1119
|
}
|
|
446
1120
|
get protocol() {
|
|
447
|
-
return this.
|
|
1121
|
+
return this._r.scheme + ':';
|
|
448
1122
|
}
|
|
449
1123
|
set protocol(val) {
|
|
450
|
-
|
|
451
|
-
this._p.protocol = m + ':';
|
|
452
|
-
this._updateOrigin();
|
|
1124
|
+
basicURLParse(String(val) + ':', null, this._r, SCHEME_START);
|
|
453
1125
|
}
|
|
454
1126
|
get username() {
|
|
455
|
-
return this.
|
|
1127
|
+
return this._r.username;
|
|
456
1128
|
}
|
|
457
1129
|
set username(v) {
|
|
458
|
-
this.
|
|
1130
|
+
if (cannotHaveCredentialsOrPort(this._r)) return;
|
|
1131
|
+
this._r.username = percentEncodeString(String(v), inUserinfoSet);
|
|
459
1132
|
}
|
|
460
1133
|
get password() {
|
|
461
|
-
return this.
|
|
1134
|
+
return this._r.password;
|
|
462
1135
|
}
|
|
463
1136
|
set password(v) {
|
|
464
|
-
this.
|
|
1137
|
+
if (cannotHaveCredentialsOrPort(this._r)) return;
|
|
1138
|
+
this._r.password = percentEncodeString(String(v), inUserinfoSet);
|
|
465
1139
|
}
|
|
466
1140
|
get host() {
|
|
467
|
-
|
|
1141
|
+
const {
|
|
1142
|
+
host,
|
|
1143
|
+
port
|
|
1144
|
+
} = this._r;
|
|
1145
|
+
if (host === null) return '';
|
|
1146
|
+
return port === null ? host : `${host}:${port}`;
|
|
468
1147
|
}
|
|
469
1148
|
set host(v) {
|
|
470
|
-
|
|
471
|
-
this.
|
|
472
|
-
this._p.port = port;
|
|
473
|
-
this._p.host = port ? `${hostname}:${port}` : hostname;
|
|
474
|
-
this._updateOrigin();
|
|
1149
|
+
if (typeof this._r.path === 'string') return;
|
|
1150
|
+
basicURLParse(String(v), null, this._r, HOST);
|
|
475
1151
|
}
|
|
476
1152
|
get hostname() {
|
|
477
|
-
return this.
|
|
1153
|
+
return this._r.host ?? '';
|
|
478
1154
|
}
|
|
479
1155
|
set hostname(v) {
|
|
480
|
-
this.
|
|
481
|
-
|
|
482
|
-
this._updateOrigin();
|
|
1156
|
+
if (typeof this._r.path === 'string') return;
|
|
1157
|
+
basicURLParse(String(v), null, this._r, HOSTNAME);
|
|
483
1158
|
}
|
|
484
1159
|
get port() {
|
|
485
|
-
return this.
|
|
1160
|
+
return this._r.port === null ? '' : String(this._r.port);
|
|
486
1161
|
}
|
|
487
1162
|
set port(v) {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
if (
|
|
491
|
-
this._p.port = '';
|
|
492
|
-
} else {
|
|
493
|
-
this._p.port = portStr;
|
|
494
|
-
}
|
|
495
|
-
this._p.host = this._p.port ? `${this._p.hostname}:${this._p.port}` : this._p.hostname;
|
|
496
|
-
this._updateOrigin();
|
|
1163
|
+
if (cannotHaveCredentialsOrPort(this._r)) return;
|
|
1164
|
+
const port = String(v);
|
|
1165
|
+
if (port === '') this._r.port = null;else basicURLParse(port, null, this._r, PORT);
|
|
497
1166
|
}
|
|
498
1167
|
get pathname() {
|
|
499
|
-
return this.
|
|
1168
|
+
return serializePath(this._r);
|
|
500
1169
|
}
|
|
501
1170
|
set pathname(v) {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
this.
|
|
1171
|
+
if (typeof this._r.path === 'string') return;
|
|
1172
|
+
this._r.path = [];
|
|
1173
|
+
basicURLParse(String(v), null, this._r, PATH_START);
|
|
505
1174
|
}
|
|
506
1175
|
get search() {
|
|
507
|
-
return this.
|
|
1176
|
+
return this._r.query ? '?' + this._r.query : '';
|
|
508
1177
|
}
|
|
509
1178
|
set search(v) {
|
|
510
|
-
|
|
511
|
-
if (
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
1179
|
+
const value = String(v);
|
|
1180
|
+
if (value === '') {
|
|
1181
|
+
this._r.query = null;
|
|
1182
|
+
internals(this.searchParams)._list = [];
|
|
1183
|
+
return;
|
|
1184
|
+
}
|
|
1185
|
+
const input = value.startsWith('?') ? value.slice(1) : value;
|
|
1186
|
+
this._r.query = '';
|
|
1187
|
+
basicURLParse(input, null, this._r, QUERY);
|
|
1188
|
+
// Like Node, read the list back from the stored query (tabs and newlines already removed).
|
|
1189
|
+
this._resetSearchParams();
|
|
515
1190
|
}
|
|
516
1191
|
get hash() {
|
|
517
|
-
return this.
|
|
1192
|
+
return this._r.fragment ? '#' + this._r.fragment : '';
|
|
518
1193
|
}
|
|
519
1194
|
set hash(v) {
|
|
520
|
-
|
|
521
|
-
if (
|
|
522
|
-
|
|
1195
|
+
const value = String(v);
|
|
1196
|
+
if (value === '') {
|
|
1197
|
+
this._r.fragment = null;
|
|
1198
|
+
return;
|
|
1199
|
+
}
|
|
1200
|
+
this._r.fragment = '';
|
|
1201
|
+
basicURLParse(value.startsWith('#') ? value.slice(1) : value, null, this._r, FRAGMENT);
|
|
523
1202
|
}
|
|
524
1203
|
get origin() {
|
|
525
|
-
return this.
|
|
526
|
-
}
|
|
527
|
-
_updateOrigin() {
|
|
528
|
-
if (this._p.protocol && this._p.hostname) {
|
|
529
|
-
this._p.origin = this._p.protocol + '//' + this._p.host;
|
|
530
|
-
}
|
|
1204
|
+
return serializeOrigin(this._r);
|
|
531
1205
|
}
|
|
532
1206
|
toString() {
|
|
533
|
-
|
|
534
|
-
let auth = '';
|
|
535
|
-
if (p.username || p.password) {
|
|
536
|
-
auth = encodeComponent(p.username) + (p.password ? ':' + encodeComponent(p.password) : '') + '@';
|
|
537
|
-
}
|
|
538
|
-
const hostPart = p.host || '';
|
|
539
|
-
const path = p.pathname ? encodeComponentPath(p.pathname) : '/';
|
|
540
|
-
const search = p.search || (this.searchParams ? this.searchParams.toString() ? '?' + this.searchParams.toString() : '' : '');
|
|
541
|
-
const hash = p.hash || '';
|
|
542
|
-
const proto = p.protocol || '';
|
|
543
|
-
|
|
544
|
-
// Handle special schemes
|
|
545
|
-
if (proto.match(/^(data|mailto|tel|sms):/i)) {
|
|
546
|
-
return proto + path + search + hash;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
// If protocol uses scheme with no host (like mailto), handle simply
|
|
550
|
-
if (!hostPart && proto && (path === '/' || path === '')) {
|
|
551
|
-
return proto + path + search + hash;
|
|
552
|
-
}
|
|
553
|
-
return proto + '//' + auth + hostPart + path + search + hash;
|
|
1207
|
+
return this.href;
|
|
554
1208
|
}
|
|
555
1209
|
toJSON() {
|
|
556
|
-
return this.
|
|
1210
|
+
return this.href;
|
|
557
1211
|
}
|
|
558
1212
|
}
|
|
559
1213
|
|
|
560
|
-
/* Helper: escape path preserving slashes */
|
|
561
|
-
function encodeComponentPath(path) {
|
|
562
|
-
// Split on / and encode segments, preserving empty segments for proper // handling
|
|
563
|
-
return path.split('/').map(seg => encodeComponent(seg)).join('/');
|
|
564
|
-
}
|
|
565
|
-
|
|
566
1214
|
// Export for Node.js environments that might not have these globals
|
|
567
1215
|
export { URL as PolyURL, URLSearchParams as PolyURLSearchParams };
|
|
568
1216
|
//# sourceMappingURL=url-polyfill.js.map
|