react-native-consumet 0.8.0 → 1.0.0-rc.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 +26 -26
- package/LICENSE +673 -673
- package/README.md +83 -49
- package/android/build.gradle +106 -106
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +4 -4
- package/android/src/main/AndroidManifestNew.xml +3 -3
- package/android/src/main/java/com/consumet/ConsumetModule.kt +45 -49
- package/android/src/main/java/com/consumet/ConsumetPackage.kt +33 -33
- package/ios/Consumet.h +6 -6
- package/ios/Consumet.mm +18 -18
- package/lib/commonjs/extension-registry.json +81 -0
- package/lib/commonjs/extractors/StreamP2P.js +69 -0
- package/lib/commonjs/extractors/StreamP2P.js.map +1 -0
- package/lib/commonjs/extractors/asianload.js +3 -2
- package/lib/commonjs/extractors/asianload.js.map +1 -1
- package/lib/commonjs/extractors/filemoon.js +8 -6
- package/lib/commonjs/extractors/filemoon.js.map +1 -1
- package/lib/commonjs/extractors/gogocdn.js +5 -4
- package/lib/commonjs/extractors/gogocdn.js.map +1 -1
- package/lib/commonjs/extractors/index.js +4 -32
- package/lib/commonjs/extractors/index.js.map +1 -1
- package/lib/commonjs/extractors/kwik.js +39 -12
- package/lib/commonjs/extractors/kwik.js.map +1 -1
- package/lib/commonjs/extractors/megacloud.js +160 -0
- package/lib/commonjs/extractors/megacloud.js.map +1 -0
- package/lib/commonjs/extractors/megaup.js +6 -6
- package/lib/commonjs/extractors/megaup.js.map +1 -1
- package/lib/commonjs/extractors/mixdrop.js +4 -2
- package/lib/commonjs/extractors/mixdrop.js.map +1 -1
- package/lib/commonjs/extractors/mp4player.js +4 -2
- package/lib/commonjs/extractors/mp4player.js.map +1 -1
- package/lib/commonjs/extractors/mp4upload.js +4 -2
- package/lib/commonjs/extractors/mp4upload.js.map +1 -1
- package/lib/commonjs/extractors/rapidcloud.js +8 -7
- package/lib/commonjs/extractors/rapidcloud.js.map +1 -1
- package/lib/commonjs/extractors/streamhub.js +5 -3
- package/lib/commonjs/extractors/streamhub.js.map +1 -1
- package/lib/commonjs/extractors/streamlare.js +3 -2
- package/lib/commonjs/extractors/streamlare.js.map +1 -1
- package/lib/commonjs/extractors/streamsb.js +4 -2
- package/lib/commonjs/extractors/streamsb.js.map +1 -1
- package/lib/commonjs/extractors/streamtape.js +3 -1
- package/lib/commonjs/extractors/streamtape.js.map +1 -1
- package/lib/commonjs/extractors/streamwish.js +5 -3
- package/lib/commonjs/extractors/streamwish.js.map +1 -1
- package/lib/commonjs/extractors/vidhide.js +5 -3
- package/lib/commonjs/extractors/vidhide.js.map +1 -1
- package/lib/commonjs/extractors/vidmoly.js +4 -2
- package/lib/commonjs/extractors/vidmoly.js.map +1 -1
- package/lib/commonjs/extractors/vizcloud.js +4 -2
- package/lib/commonjs/extractors/vizcloud.js.map +1 -1
- package/lib/commonjs/extractors/voe.js +4 -2
- package/lib/commonjs/extractors/voe.js.map +1 -1
- package/lib/commonjs/index.js +116 -53
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/base-provider.js +1 -3
- package/lib/commonjs/models/base-provider.js.map +1 -1
- package/lib/commonjs/models/extension-manifest.js +6 -0
- package/lib/commonjs/models/extension-manifest.js.map +1 -0
- package/lib/commonjs/models/extractor-context.js +6 -0
- package/lib/commonjs/models/extractor-context.js.map +1 -0
- package/lib/commonjs/models/index.js +2 -36
- package/lib/commonjs/models/index.js.map +1 -1
- package/lib/commonjs/models/provider-context.js +6 -0
- package/lib/commonjs/models/provider-context.js.map +1 -0
- package/lib/commonjs/models/types.js +12 -10
- package/lib/commonjs/models/types.js.map +1 -1
- package/lib/commonjs/models/video-extractor.js +8 -3
- package/lib/commonjs/models/video-extractor.js.map +1 -1
- package/lib/commonjs/providers/anime/anify.js +9 -7
- package/lib/commonjs/providers/anime/anify.js.map +1 -1
- package/lib/commonjs/providers/anime/animedrive.js +16 -16
- package/lib/commonjs/providers/anime/animedrive.js.map +1 -1
- package/lib/commonjs/providers/anime/animekai.js +56 -56
- package/lib/commonjs/providers/anime/animekai.js.map +1 -1
- package/lib/commonjs/providers/anime/animepahe/animepahe.js +75 -0
- package/lib/commonjs/providers/anime/animepahe/animepahe.js.map +1 -0
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +311 -0
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -0
- package/lib/commonjs/providers/anime/animeunity.js +22 -20
- package/lib/commonjs/providers/anime/animeunity.js.map +1 -1
- package/lib/commonjs/providers/anime/index.js +7 -17
- package/lib/commonjs/providers/anime/index.js.map +1 -1
- package/lib/commonjs/providers/anime/marin.js +26 -23
- package/lib/commonjs/providers/anime/marin.js.map +1 -1
- package/lib/commonjs/providers/anime/zoro/create-zoro.js +595 -0
- package/lib/commonjs/providers/anime/zoro/create-zoro.js.map +1 -0
- package/lib/commonjs/providers/anime/zoro/zoro.js +192 -0
- package/lib/commonjs/providers/anime/zoro/zoro.js.map +1 -0
- package/lib/commonjs/providers/index.js +4 -18
- package/lib/commonjs/providers/index.js.map +1 -1
- package/lib/commonjs/providers/light-novels/readlightnovels.js +5 -4
- package/lib/commonjs/providers/light-novels/readlightnovels.js.map +1 -1
- package/lib/commonjs/providers/manga/asurascans.js +5 -3
- package/lib/commonjs/providers/manga/asurascans.js.map +1 -1
- package/lib/commonjs/providers/manga/brmangas.js +11 -7
- package/lib/commonjs/providers/manga/brmangas.js.map +1 -1
- package/lib/commonjs/providers/manga/flamescans.js +5 -3
- package/lib/commonjs/providers/manga/flamescans.js.map +1 -1
- package/lib/commonjs/providers/manga/mangadex.js +11 -9
- package/lib/commonjs/providers/manga/mangadex.js.map +1 -1
- package/lib/commonjs/providers/manga/mangahere.js +6 -4
- package/lib/commonjs/providers/manga/mangahere.js.map +1 -1
- package/lib/commonjs/providers/manga/mangahost.js +5 -3
- package/lib/commonjs/providers/manga/mangahost.js.map +1 -1
- package/lib/commonjs/providers/manga/mangakakalot.js +5 -3
- package/lib/commonjs/providers/manga/mangakakalot.js.map +1 -1
- package/lib/commonjs/providers/manga/mangapark.js +5 -3
- package/lib/commonjs/providers/manga/mangapark.js.map +1 -1
- package/lib/commonjs/providers/manga/mangapill.js +5 -3
- package/lib/commonjs/providers/manga/mangapill.js.map +1 -1
- package/lib/commonjs/providers/manga/mangareader.js +6 -4
- package/lib/commonjs/providers/manga/mangareader.js.map +1 -1
- package/lib/commonjs/providers/manga/mangasee123.js +5 -3
- package/lib/commonjs/providers/manga/mangasee123.js.map +1 -1
- package/lib/commonjs/providers/manga/readmanga.js +7 -5
- package/lib/commonjs/providers/manga/readmanga.js.map +1 -1
- package/lib/commonjs/providers/manga/vyvymanga.js +6 -4
- package/lib/commonjs/providers/manga/vyvymanga.js.map +1 -1
- package/lib/commonjs/providers/meta/anilist.js +138 -125
- package/lib/commonjs/providers/meta/anilist.js.map +1 -1
- package/lib/commonjs/providers/meta/mal.js +26 -66
- package/lib/commonjs/providers/meta/mal.js.map +1 -1
- package/lib/commonjs/providers/meta/tmdb.js +31 -30
- package/lib/commonjs/providers/meta/tmdb.js.map +1 -1
- package/lib/commonjs/providers/movies/dramacool.js +14 -12
- package/lib/commonjs/providers/movies/dramacool.js.map +1 -1
- package/lib/commonjs/providers/movies/{himovies.js → himovies/create-himovies.js} +172 -129
- package/lib/commonjs/providers/movies/himovies/create-himovies.js.map +1 -0
- package/lib/commonjs/providers/movies/himovies/himovies.js +84 -0
- package/lib/commonjs/providers/movies/himovies/himovies.js.map +1 -0
- package/lib/commonjs/providers/movies/index.js +6 -20
- package/lib/commonjs/providers/movies/index.js.map +1 -1
- package/lib/commonjs/providers/movies/multimovies.js +64 -46
- package/lib/commonjs/providers/movies/multimovies.js.map +1 -1
- package/lib/commonjs/providers/movies/multistream/index.js +210 -0
- package/lib/commonjs/providers/movies/multistream/index.js.map +1 -0
- package/lib/commonjs/providers/movies/multistream/utils.js +267 -0
- package/lib/commonjs/providers/movies/multistream/utils.js.map +1 -0
- package/lib/commonjs/providers/movies/netflixmirror.js +11 -9
- package/lib/commonjs/providers/movies/netflixmirror.js.map +1 -1
- package/lib/commonjs/utils/ExtractorManager.js +311 -0
- package/lib/commonjs/utils/ExtractorManager.js.map +1 -0
- package/lib/commonjs/utils/ProviderManager.js +398 -0
- package/lib/commonjs/utils/ProviderManager.js.map +1 -0
- package/lib/commonjs/utils/create-extractor-context.js +24 -0
- package/lib/commonjs/utils/create-extractor-context.js.map +1 -0
- package/lib/commonjs/utils/create-provider-context.js +100 -0
- package/lib/commonjs/utils/create-provider-context.js.map +1 -0
- package/lib/commonjs/utils/extension-utils.js +94 -0
- package/lib/commonjs/utils/extension-utils.js.map +1 -0
- package/lib/commonjs/utils/index.js +54 -25
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/providers-list.js +6 -8
- package/lib/commonjs/utils/providers-list.js.map +1 -1
- package/lib/commonjs/utils/url-polyfill.js +572 -0
- package/lib/commonjs/utils/url-polyfill.js.map +1 -0
- package/lib/commonjs/utils/utils.js +61 -37
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/extension-registry.json +81 -0
- package/lib/module/extractors/StreamP2P.js +63 -0
- package/lib/module/extractors/StreamP2P.js.map +1 -0
- package/lib/module/extractors/asianload.js +3 -2
- package/lib/module/extractors/asianload.js.map +1 -1
- package/lib/module/extractors/filemoon.js +7 -6
- package/lib/module/extractors/filemoon.js.map +1 -1
- package/lib/module/extractors/gogocdn.js +5 -4
- package/lib/module/extractors/gogocdn.js.map +1 -1
- package/lib/module/extractors/index.js +3 -7
- package/lib/module/extractors/index.js.map +1 -1
- package/lib/module/extractors/kwik.js +38 -11
- package/lib/module/extractors/kwik.js.map +1 -1
- package/lib/module/extractors/megacloud.js +156 -0
- package/lib/module/extractors/megacloud.js.map +1 -0
- package/lib/module/extractors/megaup.js +5 -6
- package/lib/module/extractors/megaup.js.map +1 -1
- package/lib/module/extractors/mixdrop.js +3 -2
- package/lib/module/extractors/mixdrop.js.map +1 -1
- package/lib/module/extractors/mp4player.js +3 -2
- package/lib/module/extractors/mp4player.js.map +1 -1
- package/lib/module/extractors/mp4upload.js +3 -2
- package/lib/module/extractors/mp4upload.js.map +1 -1
- package/lib/module/extractors/rapidcloud.js +8 -7
- package/lib/module/extractors/rapidcloud.js.map +1 -1
- package/lib/module/extractors/streamhub.js +4 -3
- package/lib/module/extractors/streamhub.js.map +1 -1
- package/lib/module/extractors/streamlare.js +3 -2
- package/lib/module/extractors/streamlare.js.map +1 -1
- package/lib/module/extractors/streamsb.js +3 -2
- package/lib/module/extractors/streamsb.js.map +1 -1
- package/lib/module/extractors/streamtape.js +2 -1
- package/lib/module/extractors/streamtape.js.map +1 -1
- package/lib/module/extractors/streamwish.js +4 -3
- package/lib/module/extractors/streamwish.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 +3 -2
- package/lib/module/extractors/vidmoly.js.map +1 -1
- package/lib/module/extractors/vizcloud.js +3 -2
- package/lib/module/extractors/vizcloud.js.map +1 -1
- package/lib/module/extractors/voe.js +3 -2
- package/lib/module/extractors/voe.js.map +1 -1
- package/lib/module/index.js +47 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/base-provider.js +1 -2
- package/lib/module/models/base-provider.js.map +1 -1
- package/lib/module/models/extension-manifest.js +4 -0
- package/lib/module/models/extension-manifest.js.map +1 -0
- package/lib/module/models/extractor-context.js +4 -0
- package/lib/module/models/extractor-context.js.map +1 -0
- package/lib/module/models/index.js +2 -6
- package/lib/module/models/index.js.map +1 -1
- package/lib/module/models/provider-context.js +4 -0
- package/lib/module/models/provider-context.js.map +1 -0
- package/lib/module/models/types.js +11 -9
- package/lib/module/models/types.js.map +1 -1
- package/lib/module/models/video-extractor.js +8 -2
- package/lib/module/models/video-extractor.js.map +1 -1
- package/lib/module/providers/anime/anify.js +8 -7
- package/lib/module/providers/anime/anify.js.map +1 -1
- package/lib/module/providers/anime/animedrive.js +16 -16
- package/lib/module/providers/anime/animedrive.js.map +1 -1
- package/lib/module/providers/anime/animekai.js +57 -57
- package/lib/module/providers/anime/animekai.js.map +1 -1
- package/lib/module/providers/anime/animepahe/animepahe.js +73 -0
- package/lib/module/providers/anime/animepahe/animepahe.js.map +1 -0
- package/lib/module/providers/anime/animepahe/create-animepahe.js +307 -0
- package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -0
- package/lib/module/providers/anime/animeunity.js +22 -21
- package/lib/module/providers/anime/animeunity.js.map +1 -1
- package/lib/module/providers/anime/index.js +7 -17
- package/lib/module/providers/anime/index.js.map +1 -1
- package/lib/module/providers/anime/marin.js +25 -23
- package/lib/module/providers/anime/marin.js.map +1 -1
- package/lib/module/providers/anime/zoro/create-zoro.js +591 -0
- package/lib/module/providers/anime/zoro/create-zoro.js.map +1 -0
- package/lib/module/providers/anime/zoro/zoro.js +190 -0
- package/lib/module/providers/anime/zoro/zoro.js.map +1 -0
- package/lib/module/providers/index.js +1 -3
- package/lib/module/providers/index.js.map +1 -1
- package/lib/module/providers/light-novels/readlightnovels.js +5 -4
- package/lib/module/providers/light-novels/readlightnovels.js.map +1 -1
- package/lib/module/providers/manga/asurascans.js +4 -3
- package/lib/module/providers/manga/asurascans.js.map +1 -1
- package/lib/module/providers/manga/brmangas.js +10 -7
- package/lib/module/providers/manga/brmangas.js.map +1 -1
- package/lib/module/providers/manga/flamescans.js +4 -3
- package/lib/module/providers/manga/flamescans.js.map +1 -1
- package/lib/module/providers/manga/mangadex.js +10 -9
- package/lib/module/providers/manga/mangadex.js.map +1 -1
- package/lib/module/providers/manga/mangahere.js +5 -4
- package/lib/module/providers/manga/mangahere.js.map +1 -1
- package/lib/module/providers/manga/mangahost.js +4 -3
- package/lib/module/providers/manga/mangahost.js.map +1 -1
- package/lib/module/providers/manga/mangakakalot.js +4 -3
- package/lib/module/providers/manga/mangakakalot.js.map +1 -1
- package/lib/module/providers/manga/mangapark.js +4 -3
- package/lib/module/providers/manga/mangapark.js.map +1 -1
- package/lib/module/providers/manga/mangapill.js +4 -3
- package/lib/module/providers/manga/mangapill.js.map +1 -1
- package/lib/module/providers/manga/mangareader.js +5 -4
- package/lib/module/providers/manga/mangareader.js.map +1 -1
- package/lib/module/providers/manga/mangasee123.js +4 -3
- package/lib/module/providers/manga/mangasee123.js.map +1 -1
- package/lib/module/providers/manga/readmanga.js +6 -5
- package/lib/module/providers/manga/readmanga.js.map +1 -1
- package/lib/module/providers/manga/vyvymanga.js +5 -4
- package/lib/module/providers/manga/vyvymanga.js.map +1 -1
- package/lib/module/providers/meta/anilist.js +138 -125
- package/lib/module/providers/meta/anilist.js.map +1 -1
- package/lib/module/providers/meta/mal.js +27 -67
- package/lib/module/providers/meta/mal.js.map +1 -1
- package/lib/module/providers/meta/tmdb.js +31 -30
- package/lib/module/providers/meta/tmdb.js.map +1 -1
- package/lib/module/providers/movies/dramacool.js +13 -12
- package/lib/module/providers/movies/dramacool.js.map +1 -1
- package/lib/module/providers/movies/{himovies.js → himovies/create-himovies.js} +160 -119
- package/lib/module/providers/movies/himovies/create-himovies.js.map +1 -0
- package/lib/module/providers/movies/himovies/himovies.js +82 -0
- package/lib/module/providers/movies/himovies/himovies.js.map +1 -0
- package/lib/module/providers/movies/index.js +6 -20
- package/lib/module/providers/movies/index.js.map +1 -1
- package/lib/module/providers/movies/multimovies.js +63 -46
- package/lib/module/providers/movies/multimovies.js.map +1 -1
- package/lib/module/providers/movies/multistream/index.js +206 -0
- package/lib/module/providers/movies/multistream/index.js.map +1 -0
- package/lib/module/providers/movies/multistream/utils.js +259 -0
- package/lib/module/providers/movies/multistream/utils.js.map +1 -0
- package/lib/module/providers/movies/netflixmirror.js +10 -9
- package/lib/module/providers/movies/netflixmirror.js.map +1 -1
- package/lib/module/utils/ExtractorManager.js +305 -0
- package/lib/module/utils/ExtractorManager.js.map +1 -0
- package/lib/module/utils/ProviderManager.js +392 -0
- package/lib/module/utils/ProviderManager.js.map +1 -0
- package/lib/module/utils/create-extractor-context.js +19 -0
- package/lib/module/utils/create-extractor-context.js.map +1 -0
- package/lib/module/utils/create-provider-context.js +94 -0
- package/lib/module/utils/create-provider-context.js.map +1 -0
- package/lib/module/utils/extension-utils.js +89 -0
- package/lib/module/utils/extension-utils.js.map +1 -0
- package/lib/module/utils/index.js +10 -3
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/providers-list.js +7 -9
- package/lib/module/utils/providers-list.js.map +1 -1
- package/lib/module/utils/url-polyfill.js +568 -0
- package/lib/module/utils/url-polyfill.js.map +1 -0
- package/lib/module/utils/utils.js +58 -33
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/commonjs/src/extractors/StreamP2P.d.ts +10 -0
- package/lib/typescript/commonjs/src/extractors/StreamP2P.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/extractors/asianload.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/filemoon.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/gogocdn.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/index.d.ts +3 -7
- package/lib/typescript/commonjs/src/extractors/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/kwik.d.ts +7 -8
- package/lib/typescript/commonjs/src/extractors/kwik.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/megacloud.d.ts +8 -0
- package/lib/typescript/commonjs/src/extractors/megacloud.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/extractors/megaup.d.ts +1 -5
- package/lib/typescript/commonjs/src/extractors/megaup.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/mixdrop.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/mp4player.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/mp4upload.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/rapidcloud.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/streamhub.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/streamlare.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/streamsb.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/streamtape.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/streamwish.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/vidhide.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/vidmoly.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/vizcloud.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/voe.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +12 -7
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/base-provider.d.ts +1 -2
- package/lib/typescript/commonjs/src/models/base-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/extension-manifest.d.ts +58 -0
- package/lib/typescript/commonjs/src/models/extension-manifest.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/extractor-context.d.ts +36 -0
- package/lib/typescript/commonjs/src/models/extractor-context.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/index.d.ts +7 -8
- package/lib/typescript/commonjs/src/models/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/provider-context.d.ts +130 -0
- package/lib/typescript/commonjs/src/models/provider-context.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/types.d.ts +5 -37
- package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/video-extractor.d.ts +24 -2
- package/lib/typescript/commonjs/src/models/video-extractor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/anify.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animekai.d.ts +4 -4
- package/lib/typescript/commonjs/src/providers/anime/animekai.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animepahe/animepahe.d.ts +34 -0
- package/lib/typescript/commonjs/src/providers/anime/animepahe/animepahe.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts +14 -0
- package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/anime/animeunity.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/index.d.ts +6 -16
- package/lib/typescript/commonjs/src/providers/anime/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/marin.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts +45 -0
- package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts.map +1 -0
- package/lib/typescript/{module/src/providers/anime → commonjs/src/providers/anime/zoro}/zoro.d.ts +38 -53
- package/lib/typescript/commonjs/src/providers/anime/zoro/zoro.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/index.d.ts +1 -3
- package/lib/typescript/commonjs/src/providers/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/light-novels/readlightnovels.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/asurascans.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/brmangas.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/flamescans.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangadex.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangahere.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangahost.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangakakalot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangapark.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangapill.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangareader.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangasee123.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/readmanga.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/vyvymanga.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/mal.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/tmdb.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/dramacool.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/himovies/create-himovies.d.ts +21 -0
- package/lib/typescript/commonjs/src/providers/movies/himovies/create-himovies.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/himovies/himovies.d.ts +44 -0
- package/lib/typescript/commonjs/src/providers/movies/himovies/himovies.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/index.d.ts +5 -19
- package/lib/typescript/commonjs/src/providers/movies/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/multimovies.d.ts +2 -0
- package/lib/typescript/commonjs/src/providers/movies/multimovies.d.ts.map +1 -1
- package/lib/typescript/{module/src/providers/movies/fmovies.d.ts → commonjs/src/providers/movies/multistream/index.d.ts} +13 -17
- package/lib/typescript/commonjs/src/providers/movies/multistream/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts +10 -0
- package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/netflixmirror.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/ExtractorManager.d.ts +40 -0
- package/lib/typescript/commonjs/src/utils/ExtractorManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts +74 -0
- package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/create-extractor-context.d.ts +8 -0
- package/lib/typescript/commonjs/src/utils/create-extractor-context.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/create-provider-context.d.ts +10 -0
- package/lib/typescript/commonjs/src/utils/create-provider-context.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/extension-utils.d.ts +61 -0
- package/lib/typescript/commonjs/src/utils/extension-utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/index.d.ts +8 -3
- package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/providers-list.d.ts +2 -4
- package/lib/typescript/commonjs/src/utils/providers-list.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/url-polyfill.d.ts +56 -0
- package/lib/typescript/commonjs/src/utils/url-polyfill.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/utils.d.ts +8 -8
- package/lib/typescript/commonjs/src/utils/utils.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/StreamP2P.d.ts +10 -0
- package/lib/typescript/module/src/extractors/StreamP2P.d.ts.map +1 -0
- package/lib/typescript/module/src/extractors/asianload.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/filemoon.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/gogocdn.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/index.d.ts +3 -7
- package/lib/typescript/module/src/extractors/index.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/kwik.d.ts +7 -8
- package/lib/typescript/module/src/extractors/kwik.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/megacloud.d.ts +8 -0
- package/lib/typescript/module/src/extractors/megacloud.d.ts.map +1 -0
- package/lib/typescript/module/src/extractors/megaup.d.ts +1 -5
- package/lib/typescript/module/src/extractors/megaup.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/mixdrop.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/mp4player.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/mp4upload.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/rapidcloud.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/streamhub.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/streamlare.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/streamsb.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/streamtape.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/streamwish.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/vidhide.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/vidmoly.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/vizcloud.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/voe.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +12 -7
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/base-provider.d.ts +1 -2
- package/lib/typescript/module/src/models/base-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/models/extension-manifest.d.ts +58 -0
- package/lib/typescript/module/src/models/extension-manifest.d.ts.map +1 -0
- package/lib/typescript/module/src/models/extractor-context.d.ts +36 -0
- package/lib/typescript/module/src/models/extractor-context.d.ts.map +1 -0
- package/lib/typescript/module/src/models/index.d.ts +7 -8
- package/lib/typescript/module/src/models/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/provider-context.d.ts +130 -0
- package/lib/typescript/module/src/models/provider-context.d.ts.map +1 -0
- package/lib/typescript/module/src/models/types.d.ts +5 -37
- package/lib/typescript/module/src/models/types.d.ts.map +1 -1
- package/lib/typescript/module/src/models/video-extractor.d.ts +24 -2
- package/lib/typescript/module/src/models/video-extractor.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/anify.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animekai.d.ts +4 -4
- package/lib/typescript/module/src/providers/anime/animekai.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animepahe/animepahe.d.ts +34 -0
- package/lib/typescript/module/src/providers/anime/animepahe/animepahe.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts +14 -0
- package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/anime/animeunity.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/index.d.ts +6 -16
- package/lib/typescript/module/src/providers/anime/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/marin.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts +45 -0
- package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src/providers/anime → module/src/providers/anime/zoro}/zoro.d.ts +38 -53
- package/lib/typescript/module/src/providers/anime/zoro/zoro.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/index.d.ts +1 -3
- package/lib/typescript/module/src/providers/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/light-novels/readlightnovels.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/asurascans.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/brmangas.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/flamescans.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangadex.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangahere.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangahost.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangakakalot.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangapark.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangapill.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangareader.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangasee123.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/readmanga.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/vyvymanga.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/anilist.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/mal.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/tmdb.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/dramacool.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/himovies/create-himovies.d.ts +21 -0
- package/lib/typescript/module/src/providers/movies/himovies/create-himovies.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/himovies/himovies.d.ts +44 -0
- package/lib/typescript/module/src/providers/movies/himovies/himovies.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/index.d.ts +5 -19
- package/lib/typescript/module/src/providers/movies/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/multimovies.d.ts +2 -0
- package/lib/typescript/module/src/providers/movies/multimovies.d.ts.map +1 -1
- package/lib/typescript/{commonjs/src/providers/movies/fmovies.d.ts → module/src/providers/movies/multistream/index.d.ts} +13 -17
- package/lib/typescript/module/src/providers/movies/multistream/index.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts +10 -0
- package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/netflixmirror.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/ExtractorManager.d.ts +40 -0
- package/lib/typescript/module/src/utils/ExtractorManager.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/ProviderManager.d.ts +74 -0
- package/lib/typescript/module/src/utils/ProviderManager.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/create-extractor-context.d.ts +8 -0
- package/lib/typescript/module/src/utils/create-extractor-context.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/create-provider-context.d.ts +10 -0
- package/lib/typescript/module/src/utils/create-provider-context.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/extension-utils.d.ts +61 -0
- package/lib/typescript/module/src/utils/extension-utils.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/index.d.ts +8 -3
- package/lib/typescript/module/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/providers-list.d.ts +2 -4
- package/lib/typescript/module/src/utils/providers-list.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/url-polyfill.d.ts +56 -0
- package/lib/typescript/module/src/utils/url-polyfill.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/utils.d.ts +8 -8
- package/lib/typescript/module/src/utils/utils.d.ts.map +1 -1
- package/package.json +23 -8
- package/react-native.config.js +12 -12
- package/src/extension-registry.json +81 -0
- package/src/extractors/StreamP2P.ts +60 -0
- package/src/extractors/asianload.ts +3 -2
- package/src/extractors/filemoon.ts +58 -55
- package/src/extractors/gogocdn.ts +5 -4
- package/src/extractors/index.ts +41 -49
- package/src/extractors/kwik.ts +50 -29
- package/src/extractors/megacloud.ts +163 -0
- package/src/extractors/megaup.ts +5 -9
- package/src/extractors/mixdrop.ts +31 -30
- package/src/extractors/mp4player.ts +3 -2
- package/src/extractors/mp4upload.ts +31 -28
- package/src/extractors/rapidcloud.ts +8 -7
- package/src/extractors/streamhub.ts +58 -55
- package/src/extractors/streamlare.ts +3 -2
- package/src/extractors/streamsb.ts +3 -2
- package/src/extractors/streamtape.ts +2 -1
- package/src/extractors/streamwish.ts +120 -119
- package/src/extractors/vidhide.ts +59 -56
- package/src/extractors/vidmoly.ts +3 -2
- package/src/extractors/vizcloud.ts +3 -2
- package/src/extractors/voe.ts +3 -2
- package/src/index.tsx +175 -137
- package/src/models/base-provider.ts +1 -2
- package/src/models/extension-manifest.ts +77 -0
- package/src/models/extractor-context.ts +41 -0
- package/src/models/index.ts +106 -110
- package/src/models/provider-context.ts +182 -0
- package/src/models/types.ts +531 -568
- package/src/models/video-extractor.ts +48 -23
- package/src/providers/anime/anify.ts +8 -7
- package/src/providers/anime/animedrive.ts +245 -245
- package/src/providers/anime/animekai.ts +627 -628
- package/src/providers/anime/animepahe/animepahe.ts +76 -0
- package/src/providers/anime/animepahe/create-animepahe.ts +348 -0
- package/src/providers/anime/animeunity.ts +216 -215
- package/src/providers/anime/index.ts +21 -31
- package/src/providers/anime/marin.ts +319 -318
- package/src/providers/anime/zoro/create-zoro.ts +655 -0
- package/src/providers/anime/zoro/zoro.ts +197 -0
- package/src/providers/index.ts +7 -9
- package/src/providers/light-novels/readlightnovels.ts +5 -4
- package/src/providers/manga/asurascans.ts +4 -5
- package/src/providers/manga/brmangas.ts +144 -143
- package/src/providers/manga/flamescans.ts +4 -3
- package/src/providers/manga/mangadex.ts +10 -9
- package/src/providers/manga/mangahere.ts +5 -4
- package/src/providers/manga/mangahost.ts +4 -3
- package/src/providers/manga/mangakakalot.ts +4 -3
- package/src/providers/manga/mangapark.ts +4 -3
- package/src/providers/manga/mangapill.ts +4 -3
- package/src/providers/manga/mangareader.ts +5 -4
- package/src/providers/manga/mangasee123.ts +4 -3
- package/src/providers/manga/readmanga.ts +6 -5
- package/src/providers/manga/vyvymanga.ts +5 -4
- package/src/providers/meta/anilist.ts +2108 -2097
- package/src/providers/meta/mal.ts +635 -688
- package/src/providers/meta/tmdb.ts +470 -469
- package/src/providers/movies/dramacool.ts +13 -12
- package/src/providers/movies/{himovies.ts → himovies/create-himovies.ts} +529 -495
- package/src/providers/movies/himovies/himovies.ts +90 -0
- package/src/providers/movies/index.ts +15 -29
- package/src/providers/movies/multimovies.ts +495 -475
- package/src/providers/movies/multistream/index.ts +231 -0
- package/src/providers/movies/multistream/utils.ts +393 -0
- package/src/providers/movies/netflixmirror.ts +10 -9
- package/src/utils/ExtractorManager.ts +311 -0
- package/src/utils/ProviderManager.ts +424 -0
- package/src/utils/create-extractor-context.ts +22 -0
- package/src/utils/create-provider-context.ts +107 -0
- package/src/utils/extension-utils.ts +114 -0
- package/src/utils/index.ts +95 -97
- package/src/utils/providers-list.ts +27 -51
- package/src/utils/url-polyfill.ts +642 -0
- package/src/utils/utils.ts +374 -339
- package/lib/commonjs/extractors/bilibili.js +0 -65
- package/lib/commonjs/extractors/bilibili.js.map +0 -1
- package/lib/commonjs/extractors/luffy.js +0 -39
- package/lib/commonjs/extractors/luffy.js.map +0 -1
- package/lib/commonjs/extractors/megacloud/index.js +0 -53
- package/lib/commonjs/extractors/megacloud/index.js.map +0 -1
- package/lib/commonjs/extractors/megacloud/megacloud.getsrcs.js +0 -68
- package/lib/commonjs/extractors/megacloud/megacloud.getsrcs.js.map +0 -1
- package/lib/commonjs/extractors/smashystream.js +0 -303
- package/lib/commonjs/extractors/smashystream.js.map +0 -1
- package/lib/commonjs/extractors/vidcloud.js +0 -63
- package/lib/commonjs/extractors/vidcloud.js.map +0 -1
- package/lib/commonjs/models/book-parser.js +0 -10
- package/lib/commonjs/models/book-parser.js.map +0 -1
- package/lib/commonjs/models/comic-parser.js +0 -10
- package/lib/commonjs/models/comic-parser.js.map +0 -1
- package/lib/commonjs/models/news-parser.js +0 -10
- package/lib/commonjs/models/news-parser.js.map +0 -1
- package/lib/commonjs/models/proxy.js +0 -122
- package/lib/commonjs/models/proxy.js.map +0 -1
- package/lib/commonjs/models/type-objects.js +0 -54
- package/lib/commonjs/models/type-objects.js.map +0 -1
- package/lib/commonjs/providers/anime/animefox.js +0 -199
- package/lib/commonjs/providers/anime/animefox.js.map +0 -1
- package/lib/commonjs/providers/anime/animeowl.js +0 -501
- package/lib/commonjs/providers/anime/animeowl.js.map +0 -1
- package/lib/commonjs/providers/anime/animepahe.js +0 -272
- package/lib/commonjs/providers/anime/animepahe.js.map +0 -1
- package/lib/commonjs/providers/anime/animesaturn.js +0 -162
- package/lib/commonjs/providers/anime/animesaturn.js.map +0 -1
- package/lib/commonjs/providers/anime/anix.js +0 -542
- package/lib/commonjs/providers/anime/anix.js.map +0 -1
- package/lib/commonjs/providers/anime/bilibili.js +0 -129
- package/lib/commonjs/providers/anime/bilibili.js.map +0 -1
- package/lib/commonjs/providers/anime/gogoanime.js +0 -481
- package/lib/commonjs/providers/anime/gogoanime.js.map +0 -1
- package/lib/commonjs/providers/anime/monoschinos.js +0 -184
- package/lib/commonjs/providers/anime/monoschinos.js.map +0 -1
- package/lib/commonjs/providers/anime/zoro.js +0 -855
- package/lib/commonjs/providers/anime/zoro.js.map +0 -1
- package/lib/commonjs/providers/comics/getComics.js +0 -58
- package/lib/commonjs/providers/comics/getComics.js.map +0 -1
- package/lib/commonjs/providers/comics/index.js +0 -12
- package/lib/commonjs/providers/comics/index.js.map +0 -1
- package/lib/commonjs/providers/movies/flixhq.js +0 -423
- package/lib/commonjs/providers/movies/flixhq.js.map +0 -1
- package/lib/commonjs/providers/movies/fmovies.js +0 -267
- package/lib/commonjs/providers/movies/fmovies.js.map +0 -1
- package/lib/commonjs/providers/movies/goku.js +0 -401
- package/lib/commonjs/providers/movies/goku.js.map +0 -1
- package/lib/commonjs/providers/movies/himovies.js.map +0 -1
- package/lib/commonjs/providers/movies/kissasian.js +0 -192
- package/lib/commonjs/providers/movies/kissasian.js.map +0 -1
- package/lib/commonjs/providers/movies/moviehdwatch.js +0 -401
- package/lib/commonjs/providers/movies/moviehdwatch.js.map +0 -1
- package/lib/commonjs/providers/movies/sflix.js +0 -423
- package/lib/commonjs/providers/movies/sflix.js.map +0 -1
- package/lib/commonjs/providers/movies/smashystream.js +0 -116
- package/lib/commonjs/providers/movies/smashystream.js.map +0 -1
- package/lib/commonjs/providers/movies/turkish123.js +0 -102
- package/lib/commonjs/providers/movies/turkish123.js.map +0 -1
- package/lib/commonjs/providers/movies/ummagurau.js +0 -69
- package/lib/commonjs/providers/movies/ummagurau.js.map +0 -1
- package/lib/commonjs/providers/movies/viewAsian.js +0 -151
- package/lib/commonjs/providers/movies/viewAsian.js.map +0 -1
- package/lib/commonjs/providers/news/animenewsnetwork.js +0 -104
- package/lib/commonjs/providers/news/animenewsnetwork.js.map +0 -1
- package/lib/commonjs/providers/news/index.js +0 -12
- package/lib/commonjs/providers/news/index.js.map +0 -1
- package/lib/commonjs/providers/others/index.js +0 -2
- package/lib/commonjs/providers/others/index.js.map +0 -1
- package/lib/commonjs/utils/getComics.js +0 -43
- package/lib/commonjs/utils/getComics.js.map +0 -1
- package/lib/module/extractors/bilibili.js +0 -61
- package/lib/module/extractors/bilibili.js.map +0 -1
- package/lib/module/extractors/luffy.js +0 -35
- package/lib/module/extractors/luffy.js.map +0 -1
- package/lib/module/extractors/megacloud/index.js +0 -49
- package/lib/module/extractors/megacloud/index.js.map +0 -1
- package/lib/module/extractors/megacloud/megacloud.getsrcs.js +0 -64
- package/lib/module/extractors/megacloud/megacloud.getsrcs.js.map +0 -1
- package/lib/module/extractors/smashystream.js +0 -299
- package/lib/module/extractors/smashystream.js.map +0 -1
- package/lib/module/extractors/vidcloud.js +0 -59
- package/lib/module/extractors/vidcloud.js.map +0 -1
- package/lib/module/models/book-parser.js +0 -6
- package/lib/module/models/book-parser.js.map +0 -1
- package/lib/module/models/comic-parser.js +0 -6
- package/lib/module/models/comic-parser.js.map +0 -1
- package/lib/module/models/news-parser.js +0 -6
- package/lib/module/models/news-parser.js.map +0 -1
- package/lib/module/models/proxy.js +0 -116
- package/lib/module/models/proxy.js.map +0 -1
- package/lib/module/models/type-objects.js +0 -48
- package/lib/module/models/type-objects.js.map +0 -1
- package/lib/module/providers/anime/animefox.js +0 -197
- package/lib/module/providers/anime/animefox.js.map +0 -1
- package/lib/module/providers/anime/animeowl.js +0 -498
- package/lib/module/providers/anime/animeowl.js.map +0 -1
- package/lib/module/providers/anime/animepahe.js +0 -271
- package/lib/module/providers/anime/animepahe.js.map +0 -1
- package/lib/module/providers/anime/animesaturn.js +0 -161
- package/lib/module/providers/anime/animesaturn.js.map +0 -1
- package/lib/module/providers/anime/anix.js +0 -538
- package/lib/module/providers/anime/anix.js.map +0 -1
- package/lib/module/providers/anime/bilibili.js +0 -126
- package/lib/module/providers/anime/bilibili.js.map +0 -1
- package/lib/module/providers/anime/gogoanime.js +0 -478
- package/lib/module/providers/anime/gogoanime.js.map +0 -1
- package/lib/module/providers/anime/monoschinos.js +0 -189
- package/lib/module/providers/anime/monoschinos.js.map +0 -1
- package/lib/module/providers/anime/zoro.js +0 -852
- package/lib/module/providers/anime/zoro.js.map +0 -1
- package/lib/module/providers/comics/getComics.js +0 -54
- package/lib/module/providers/comics/getComics.js.map +0 -1
- package/lib/module/providers/comics/index.js +0 -7
- package/lib/module/providers/comics/index.js.map +0 -1
- package/lib/module/providers/movies/flixhq.js +0 -420
- package/lib/module/providers/movies/flixhq.js.map +0 -1
- package/lib/module/providers/movies/fmovies.js +0 -264
- package/lib/module/providers/movies/fmovies.js.map +0 -1
- package/lib/module/providers/movies/goku.js +0 -398
- package/lib/module/providers/movies/goku.js.map +0 -1
- package/lib/module/providers/movies/himovies.js.map +0 -1
- package/lib/module/providers/movies/kissasian.js +0 -188
- package/lib/module/providers/movies/kissasian.js.map +0 -1
- package/lib/module/providers/movies/moviehdwatch.js +0 -397
- package/lib/module/providers/movies/moviehdwatch.js.map +0 -1
- package/lib/module/providers/movies/sflix.js +0 -420
- package/lib/module/providers/movies/sflix.js.map +0 -1
- package/lib/module/providers/movies/smashystream.js +0 -112
- package/lib/module/providers/movies/smashystream.js.map +0 -1
- package/lib/module/providers/movies/turkish123.js +0 -97
- package/lib/module/providers/movies/turkish123.js.map +0 -1
- package/lib/module/providers/movies/ummagurau.js +0 -69
- package/lib/module/providers/movies/ummagurau.js.map +0 -1
- package/lib/module/providers/movies/viewAsian.js +0 -147
- package/lib/module/providers/movies/viewAsian.js.map +0 -1
- package/lib/module/providers/news/animenewsnetwork.js +0 -99
- package/lib/module/providers/news/animenewsnetwork.js.map +0 -1
- package/lib/module/providers/news/index.js +0 -7
- package/lib/module/providers/news/index.js.map +0 -1
- package/lib/module/providers/others/index.js +0 -2
- package/lib/module/providers/others/index.js.map +0 -1
- package/lib/module/utils/getComics.js +0 -38
- package/lib/module/utils/getComics.js.map +0 -1
- package/lib/typescript/commonjs/src/extractors/bilibili.d.ts +0 -11
- package/lib/typescript/commonjs/src/extractors/bilibili.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/luffy.d.ts +0 -9
- package/lib/typescript/commonjs/src/extractors/luffy.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/megacloud/index.d.ts +0 -8
- package/lib/typescript/commonjs/src/extractors/megacloud/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/megacloud/megacloud.getsrcs.d.ts +0 -11
- package/lib/typescript/commonjs/src/extractors/megacloud/megacloud.getsrcs.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/smashystream.d.ts +0 -43
- package/lib/typescript/commonjs/src/extractors/smashystream.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/extractors/vidcloud.d.ts +0 -12
- package/lib/typescript/commonjs/src/extractors/vidcloud.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/models/book-parser.d.ts +0 -5
- package/lib/typescript/commonjs/src/models/book-parser.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/models/comic-parser.d.ts +0 -5
- package/lib/typescript/commonjs/src/models/comic-parser.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/models/news-parser.d.ts +0 -5
- package/lib/typescript/commonjs/src/models/news-parser.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/models/proxy.d.ts +0 -25
- package/lib/typescript/commonjs/src/models/proxy.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/models/type-objects.d.ts +0 -49
- package/lib/typescript/commonjs/src/models/type-objects.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/animefox.d.ts +0 -31
- package/lib/typescript/commonjs/src/providers/anime/animefox.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/animeowl.d.ts +0 -76
- package/lib/typescript/commonjs/src/providers/anime/animeowl.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/animepahe.d.ts +0 -34
- package/lib/typescript/commonjs/src/providers/anime/animepahe.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/animesaturn.d.ts +0 -27
- package/lib/typescript/commonjs/src/providers/anime/animesaturn.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/anix.d.ts +0 -54
- package/lib/typescript/commonjs/src/providers/anime/anix.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/bilibili.d.ts +0 -19
- package/lib/typescript/commonjs/src/providers/anime/bilibili.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/gogoanime.d.ts +0 -57
- package/lib/typescript/commonjs/src/providers/anime/gogoanime.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/monoschinos.d.ts +0 -29
- package/lib/typescript/commonjs/src/providers/anime/monoschinos.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/anime/zoro.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/comics/getComics.d.ts +0 -10
- package/lib/typescript/commonjs/src/providers/comics/getComics.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/comics/index.d.ts +0 -6
- package/lib/typescript/commonjs/src/providers/comics/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/flixhq.d.ts +0 -41
- package/lib/typescript/commonjs/src/providers/movies/flixhq.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/fmovies.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/goku.d.ts +0 -40
- package/lib/typescript/commonjs/src/providers/movies/goku.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/himovies.d.ts +0 -41
- package/lib/typescript/commonjs/src/providers/movies/himovies.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/kissasian.d.ts +0 -14
- package/lib/typescript/commonjs/src/providers/movies/kissasian.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/moviehdwatch.d.ts +0 -40
- package/lib/typescript/commonjs/src/providers/movies/moviehdwatch.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/sflix.d.ts +0 -41
- package/lib/typescript/commonjs/src/providers/movies/sflix.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/smashystream.d.ts +0 -14
- package/lib/typescript/commonjs/src/providers/movies/smashystream.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/turkish123.d.ts +0 -12
- package/lib/typescript/commonjs/src/providers/movies/turkish123.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/ummagurau.d.ts +0 -2
- package/lib/typescript/commonjs/src/providers/movies/ummagurau.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/movies/viewAsian.d.ts +0 -14
- package/lib/typescript/commonjs/src/providers/movies/viewAsian.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/news/animenewsnetwork.d.ts +0 -31
- package/lib/typescript/commonjs/src/providers/news/animenewsnetwork.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/news/index.d.ts +0 -6
- package/lib/typescript/commonjs/src/providers/news/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/others/index.d.ts +0 -1
- package/lib/typescript/commonjs/src/providers/others/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/getComics.d.ts +0 -6
- package/lib/typescript/commonjs/src/utils/getComics.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/bilibili.d.ts +0 -11
- package/lib/typescript/module/src/extractors/bilibili.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/luffy.d.ts +0 -9
- package/lib/typescript/module/src/extractors/luffy.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/megacloud/index.d.ts +0 -8
- package/lib/typescript/module/src/extractors/megacloud/index.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/megacloud/megacloud.getsrcs.d.ts +0 -11
- package/lib/typescript/module/src/extractors/megacloud/megacloud.getsrcs.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/smashystream.d.ts +0 -43
- package/lib/typescript/module/src/extractors/smashystream.d.ts.map +0 -1
- package/lib/typescript/module/src/extractors/vidcloud.d.ts +0 -12
- package/lib/typescript/module/src/extractors/vidcloud.d.ts.map +0 -1
- package/lib/typescript/module/src/models/book-parser.d.ts +0 -5
- package/lib/typescript/module/src/models/book-parser.d.ts.map +0 -1
- package/lib/typescript/module/src/models/comic-parser.d.ts +0 -5
- package/lib/typescript/module/src/models/comic-parser.d.ts.map +0 -1
- package/lib/typescript/module/src/models/news-parser.d.ts +0 -5
- package/lib/typescript/module/src/models/news-parser.d.ts.map +0 -1
- package/lib/typescript/module/src/models/proxy.d.ts +0 -25
- package/lib/typescript/module/src/models/proxy.d.ts.map +0 -1
- package/lib/typescript/module/src/models/type-objects.d.ts +0 -49
- package/lib/typescript/module/src/models/type-objects.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/animefox.d.ts +0 -31
- package/lib/typescript/module/src/providers/anime/animefox.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/animeowl.d.ts +0 -76
- package/lib/typescript/module/src/providers/anime/animeowl.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/animepahe.d.ts +0 -34
- package/lib/typescript/module/src/providers/anime/animepahe.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/animesaturn.d.ts +0 -27
- package/lib/typescript/module/src/providers/anime/animesaturn.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/anix.d.ts +0 -54
- package/lib/typescript/module/src/providers/anime/anix.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/bilibili.d.ts +0 -19
- package/lib/typescript/module/src/providers/anime/bilibili.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/gogoanime.d.ts +0 -57
- package/lib/typescript/module/src/providers/anime/gogoanime.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/monoschinos.d.ts +0 -29
- package/lib/typescript/module/src/providers/anime/monoschinos.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/anime/zoro.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/comics/getComics.d.ts +0 -10
- package/lib/typescript/module/src/providers/comics/getComics.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/comics/index.d.ts +0 -6
- package/lib/typescript/module/src/providers/comics/index.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/flixhq.d.ts +0 -41
- package/lib/typescript/module/src/providers/movies/flixhq.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/fmovies.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/goku.d.ts +0 -40
- package/lib/typescript/module/src/providers/movies/goku.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/himovies.d.ts +0 -41
- package/lib/typescript/module/src/providers/movies/himovies.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/kissasian.d.ts +0 -14
- package/lib/typescript/module/src/providers/movies/kissasian.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/moviehdwatch.d.ts +0 -40
- package/lib/typescript/module/src/providers/movies/moviehdwatch.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/sflix.d.ts +0 -41
- package/lib/typescript/module/src/providers/movies/sflix.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/smashystream.d.ts +0 -14
- package/lib/typescript/module/src/providers/movies/smashystream.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/turkish123.d.ts +0 -12
- package/lib/typescript/module/src/providers/movies/turkish123.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/ummagurau.d.ts +0 -2
- package/lib/typescript/module/src/providers/movies/ummagurau.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/movies/viewAsian.d.ts +0 -14
- package/lib/typescript/module/src/providers/movies/viewAsian.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/news/animenewsnetwork.d.ts +0 -31
- package/lib/typescript/module/src/providers/news/animenewsnetwork.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/news/index.d.ts +0 -6
- package/lib/typescript/module/src/providers/news/index.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/others/index.d.ts +0 -1
- package/lib/typescript/module/src/providers/others/index.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/getComics.d.ts +0 -6
- package/lib/typescript/module/src/utils/getComics.d.ts.map +0 -1
- package/src/extractors/bilibili.ts +0 -82
- package/src/extractors/luffy.ts +0 -33
- package/src/extractors/megacloud/index.ts +0 -54
- package/src/extractors/megacloud/megacloud.getsrcs.ts +0 -63
- package/src/extractors/smashystream.ts +0 -359
- package/src/extractors/vidcloud.ts +0 -71
- package/src/models/book-parser.ts +0 -5
- package/src/models/comic-parser.ts +0 -5
- package/src/models/news-parser.ts +0 -4
- package/src/models/proxy.ts +0 -121
- package/src/models/type-objects.ts +0 -50
- package/src/providers/anime/animefox.ts +0 -211
- package/src/providers/anime/animeowl.ts +0 -565
- package/src/providers/anime/animepahe.ts +0 -322
- package/src/providers/anime/animesaturn.ts +0 -204
- package/src/providers/anime/anix.ts +0 -590
- package/src/providers/anime/bilibili.ts +0 -142
- package/src/providers/anime/gogoanime.ts +0 -599
- package/src/providers/anime/monoschinos.ts +0 -216
- package/src/providers/anime/zoro.ts +0 -894
- package/src/providers/comics/getComics.ts +0 -53
- package/src/providers/comics/index.ts +0 -3
- package/src/providers/movies/flixhq.ts +0 -514
- package/src/providers/movies/fmovies.ts +0 -296
- package/src/providers/movies/goku.ts +0 -490
- package/src/providers/movies/kissasian.ts +0 -238
- package/src/providers/movies/moviehdwatch.ts +0 -482
- package/src/providers/movies/sflix.ts +0 -521
- package/src/providers/movies/smashystream.ts +0 -133
- package/src/providers/movies/turkish123.ts +0 -107
- package/src/providers/movies/ummagurau.ts +0 -91
- package/src/providers/movies/viewAsian.ts +0 -181
- package/src/providers/news/animenewsnetwork.ts +0 -111
- package/src/providers/news/index.ts +0 -3
- package/src/providers/others/index.ts +0 -0
- package/src/utils/getComics.ts +0 -47
|
@@ -1,2097 +1,2108 @@
|
|
|
1
|
-
import axios, { type AxiosAdapter } from 'axios';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
AnimeParser,
|
|
5
|
-
type ISearch,
|
|
6
|
-
type IAnimeInfo,
|
|
7
|
-
MediaStatus,
|
|
8
|
-
type IAnimeResult,
|
|
9
|
-
type ISource,
|
|
10
|
-
type IAnimeEpisode,
|
|
11
|
-
type IEpisodeServer,
|
|
12
|
-
Genres,
|
|
13
|
-
MangaParser,
|
|
14
|
-
type IMangaChapterPage,
|
|
15
|
-
type IMangaInfo,
|
|
16
|
-
type IMangaResult,
|
|
17
|
-
type IMangaChapter,
|
|
18
|
-
type ProxyConfig,
|
|
19
|
-
type ITitle,
|
|
20
|
-
type IStaff,
|
|
21
|
-
type AniZipEpisode,
|
|
22
|
-
} from '../../models';
|
|
23
|
-
import {
|
|
24
|
-
anilistSearchQuery,
|
|
25
|
-
anilistMediaDetailQuery,
|
|
26
|
-
anilistTrendingQuery,
|
|
27
|
-
anilistPopularQuery,
|
|
28
|
-
anilistAiringScheduleQuery,
|
|
29
|
-
anilistGenresQuery,
|
|
30
|
-
anilistAdvancedQuery,
|
|
31
|
-
anilistSiteStatisticsQuery,
|
|
32
|
-
anilistCharacterQuery,
|
|
33
|
-
anilistStaffInfoQuery,
|
|
34
|
-
getDays,
|
|
35
|
-
capitalizeFirstLetter,
|
|
36
|
-
} from '../../utils';
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
override
|
|
47
|
-
protected override
|
|
48
|
-
protected override
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
private readonly
|
|
52
|
-
private readonly
|
|
53
|
-
private readonly
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* @param
|
|
61
|
-
* @param
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
'
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
*
|
|
178
|
-
* @param
|
|
179
|
-
* @param
|
|
180
|
-
* @param
|
|
181
|
-
* @param
|
|
182
|
-
* @param
|
|
183
|
-
* @param
|
|
184
|
-
* @param
|
|
185
|
-
* @param
|
|
186
|
-
* @param
|
|
187
|
-
* @param
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
'
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
if (status >= 500
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
*
|
|
326
|
-
* @param
|
|
327
|
-
* @param
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
'
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
if (status ===
|
|
351
|
-
if (status
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
animeInfo.
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
animeInfo.
|
|
368
|
-
animeInfo.
|
|
369
|
-
animeInfo.
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
data.data?.Media?.coverImage?.
|
|
382
|
-
data.data?.Media?.coverImage?.
|
|
383
|
-
data.
|
|
384
|
-
data.
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
data.data?.Media?.coverImage?.
|
|
390
|
-
data.
|
|
391
|
-
data.
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
animeInfo.
|
|
396
|
-
animeInfo.
|
|
397
|
-
animeInfo.
|
|
398
|
-
animeInfo.
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
animeInfo.
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
animeInfo.
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
animeInfo.
|
|
441
|
-
animeInfo.
|
|
442
|
-
animeInfo.
|
|
443
|
-
animeInfo.
|
|
444
|
-
animeInfo.
|
|
445
|
-
animeInfo.
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
item.node.mediaRecommendation?.coverImage?.
|
|
470
|
-
item.node.mediaRecommendation?.coverImage?.
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
item.node.mediaRecommendation?.coverImage?.
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
item.node.mediaRecommendation?.
|
|
479
|
-
item.node.mediaRecommendation?.coverImage?.
|
|
480
|
-
item.node.mediaRecommendation?.coverImage?.
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
item.node.mediaRecommendation?.coverImage?.
|
|
485
|
-
item.node.mediaRecommendation?.coverImage?.
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
item.node.
|
|
550
|
-
item.node.coverImage.
|
|
551
|
-
item.node.coverImage.
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
item.node.coverImage.
|
|
556
|
-
item.node.coverImage.
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
this.
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
animeInfo.
|
|
569
|
-
animeInfo.
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
episode.
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
episode.
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
fillerEpisodes
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
'
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
episode.
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
*
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
*
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
* @param
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
'
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
*
|
|
767
|
-
* @param
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
'
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
*
|
|
840
|
-
* @param
|
|
841
|
-
* @param
|
|
842
|
-
* @
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
item.media.
|
|
899
|
-
|
|
900
|
-
item.media.
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
*
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
(
|
|
998
|
-
);
|
|
999
|
-
|
|
1000
|
-
//
|
|
1001
|
-
uniqueResults.
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
if (mappings
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
//
|
|
1039
|
-
//
|
|
1040
|
-
//
|
|
1041
|
-
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
) {
|
|
1149
|
-
try {
|
|
1150
|
-
// console.time('fetchEpisodesListById');
|
|
1151
|
-
const [animeMetaData, providerEpisodes] = await Promise.all([
|
|
1152
|
-
|
|
1153
|
-
this.fetchDefaultEpisodeList(Media),
|
|
1154
|
-
]);
|
|
1155
|
-
// console.timeEnd('fetchEpisodesListById');
|
|
1156
|
-
//to get the actual episode ids we make use of fetchDefaultEpisodeList
|
|
1157
|
-
const normalizedEpisodes = (
|
|
1158
|
-
Object.entries(animeMetaData.episodes || {}) as [string, AniZipEpisode & IAnimeEpisode][]
|
|
1159
|
-
).map(([key, item]) => ({
|
|
1160
|
-
title: item.title.en ?? item.title['x-jat'],
|
|
1161
|
-
uniqueId: `${id}$ep=${item.episodeNumber ?? item.episode}`,
|
|
1162
|
-
description: item.overview ?? item.summary,
|
|
1163
|
-
number: item.episodeNumber ?? parseInt(item.episode),
|
|
1164
|
-
image: item.image,
|
|
1165
|
-
imageHash: getHashFromImage(item.image),
|
|
1166
|
-
releaseDate: item.airDate ?? item.airdate ?? item.airDateUtc,
|
|
1167
|
-
}));
|
|
1168
|
-
|
|
1169
|
-
function mergeEpisodes(normalizedEpisodes: any[], providerEpisodes: IAnimeEpisode[]): IAnimeEpisode[] {
|
|
1170
|
-
const numberMap = new Map<number, any>();
|
|
1171
|
-
const dateMap = new Map<number, any>();
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
if (ep.
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
normalizedEp =
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
animeInfo.
|
|
1350
|
-
animeInfo.
|
|
1351
|
-
animeInfo.
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
animeInfo.
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
animeInfo.
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
animeInfo.
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
item.node.mediaRecommendation.coverImage.
|
|
1435
|
-
item.node.mediaRecommendation.coverImage.
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
item.node.mediaRecommendation.coverImage.extraLarge ??
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
),
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
const
|
|
1608
|
-
|
|
1609
|
-
.
|
|
1610
|
-
.
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
const
|
|
1623
|
-
const
|
|
1624
|
-
const
|
|
1625
|
-
const
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
*
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
: item.
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
mangaInfo.
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
}
|
|
1885
|
-
mangaInfo.
|
|
1886
|
-
mangaInfo.
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
item.node.mediaRecommendation?.coverImage?.
|
|
1925
|
-
item.node.mediaRecommendation?.coverImage?.
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
item.node.mediaRecommendation?.coverImage?.large ??
|
|
1930
|
-
item.node.mediaRecommendation?.coverImage?.medium
|
|
1931
|
-
),
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
const
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
1
|
+
import axios, { type AxiosAdapter } from 'axios';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
AnimeParser,
|
|
5
|
+
type ISearch,
|
|
6
|
+
type IAnimeInfo,
|
|
7
|
+
MediaStatus,
|
|
8
|
+
type IAnimeResult,
|
|
9
|
+
type ISource,
|
|
10
|
+
type IAnimeEpisode,
|
|
11
|
+
type IEpisodeServer,
|
|
12
|
+
Genres,
|
|
13
|
+
MangaParser,
|
|
14
|
+
type IMangaChapterPage,
|
|
15
|
+
type IMangaInfo,
|
|
16
|
+
type IMangaResult,
|
|
17
|
+
type IMangaChapter,
|
|
18
|
+
type ProxyConfig,
|
|
19
|
+
type ITitle,
|
|
20
|
+
type IStaff,
|
|
21
|
+
type AniZipEpisode,
|
|
22
|
+
} from '../../models';
|
|
23
|
+
import {
|
|
24
|
+
anilistSearchQuery,
|
|
25
|
+
anilistMediaDetailQuery,
|
|
26
|
+
anilistTrendingQuery,
|
|
27
|
+
anilistPopularQuery,
|
|
28
|
+
anilistAiringScheduleQuery,
|
|
29
|
+
anilistGenresQuery,
|
|
30
|
+
anilistAdvancedQuery,
|
|
31
|
+
anilistSiteStatisticsQuery,
|
|
32
|
+
anilistCharacterQuery,
|
|
33
|
+
anilistStaffInfoQuery,
|
|
34
|
+
getDays,
|
|
35
|
+
capitalizeFirstLetter,
|
|
36
|
+
} from '../../utils';
|
|
37
|
+
import Anify from '../anime/anify';
|
|
38
|
+
import Zoro from '../anime/zoro/zoro';
|
|
39
|
+
import AnimeKai from '../anime/animekai';
|
|
40
|
+
import AnimePahe from '../anime/animepahe/animepahe';
|
|
41
|
+
import Mangasee123 from '../manga/mangasee123';
|
|
42
|
+
import { ANIFY_URL, findSimilarTitles, getHashFromImage } from '../../utils/utils';
|
|
43
|
+
|
|
44
|
+
class Anilist extends AnimeParser {
|
|
45
|
+
override readonly name = 'Anilist';
|
|
46
|
+
protected override baseUrl = 'https://anilist.co';
|
|
47
|
+
protected override logo = 'https://upload.wikimedia.org/wikipedia/commons/6/61/AniList_logo.svg';
|
|
48
|
+
protected override classPath = 'META.Anilist';
|
|
49
|
+
|
|
50
|
+
private readonly anilistGraphqlUrl = 'https://graphql.anilist.co';
|
|
51
|
+
private readonly kitsuGraphqlUrl = 'https://kitsu.io/api/graphql';
|
|
52
|
+
private readonly malSyncUrl = 'https://api.malsync.moe';
|
|
53
|
+
private readonly anifyUrl = ANIFY_URL;
|
|
54
|
+
provider: AnimeParser;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* This class maps anilist to kitsu with any other anime provider.
|
|
58
|
+
* kitsu is used for episode images, titles and description.
|
|
59
|
+
* @param provider anime provider (optional) default: Gogoanime
|
|
60
|
+
* @param proxyConfig proxy config (optional)
|
|
61
|
+
* @param adapter axios adapter (optional)
|
|
62
|
+
*/
|
|
63
|
+
constructor(
|
|
64
|
+
provider?: AnimeParser,
|
|
65
|
+
public proxyConfig?: ProxyConfig,
|
|
66
|
+
adapter?: AxiosAdapter,
|
|
67
|
+
customBaseURL?: string
|
|
68
|
+
) {
|
|
69
|
+
super();
|
|
70
|
+
this.provider = provider || new Zoro(customBaseURL);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @param query Search query
|
|
75
|
+
* @param page Page number (optional)
|
|
76
|
+
* @param perPage Number of results per page (optional) (default: 15) (max: 50)
|
|
77
|
+
*/
|
|
78
|
+
override search = async (query: string, page: number = 1, perPage: number = 15): Promise<ISearch<IAnimeResult>> => {
|
|
79
|
+
const options = {
|
|
80
|
+
headers: {
|
|
81
|
+
'Content-Type': 'application/json',
|
|
82
|
+
'Accept': 'application/json',
|
|
83
|
+
},
|
|
84
|
+
query: anilistSearchQuery(query, page, perPage),
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
try {
|
|
88
|
+
let { data, status } = await axios.post(this.anilistGraphqlUrl, options, {
|
|
89
|
+
validateStatus: () => true,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
if (status >= 500 || status === 429) data = await new Anify().rawSearch(query, page);
|
|
93
|
+
|
|
94
|
+
const res: ISearch<IAnimeResult> = {
|
|
95
|
+
currentPage: data.data!.Page?.pageInfo?.currentPage ?? data.meta?.currentPage,
|
|
96
|
+
hasNextPage: data.data!.Page?.pageInfo?.hasNextPage ?? data.meta?.currentPage !== data.meta?.lastPage,
|
|
97
|
+
results:
|
|
98
|
+
data.data?.Page?.media?.map((item: any) => ({
|
|
99
|
+
id: item.id.toString(),
|
|
100
|
+
malId: item.idMal,
|
|
101
|
+
title: item.title
|
|
102
|
+
? {
|
|
103
|
+
romaji: item.title.romaji,
|
|
104
|
+
english: item.title.english,
|
|
105
|
+
native: item.title.native,
|
|
106
|
+
userPreferred: item.title.userPreferred,
|
|
107
|
+
}
|
|
108
|
+
: item.title.romaji,
|
|
109
|
+
status:
|
|
110
|
+
item.status === 'RELEASING'
|
|
111
|
+
? MediaStatus.ONGOING
|
|
112
|
+
: item.status === 'FINISHED'
|
|
113
|
+
? MediaStatus.COMPLETED
|
|
114
|
+
: item.status === 'NOT_YET_RELEASED'
|
|
115
|
+
? MediaStatus.NOT_YET_AIRED
|
|
116
|
+
: item.status === 'CANCELLED'
|
|
117
|
+
? MediaStatus.CANCELLED
|
|
118
|
+
: item.status === 'HIATUS'
|
|
119
|
+
? MediaStatus.HIATUS
|
|
120
|
+
: MediaStatus.UNKNOWN,
|
|
121
|
+
image: item.coverImage?.extraLarge ?? item.coverImage?.large ?? item.coverImage?.medium,
|
|
122
|
+
imageHash: getHashFromImage(
|
|
123
|
+
item.coverImage?.extraLarge ?? item.coverImage?.large ?? item.coverImage?.medium
|
|
124
|
+
),
|
|
125
|
+
cover: item.bannerImage,
|
|
126
|
+
coverHash: getHashFromImage(item.bannerImage),
|
|
127
|
+
popularity: item.popularity,
|
|
128
|
+
description: item.description,
|
|
129
|
+
rating: item.averageScore,
|
|
130
|
+
genres: item.genres,
|
|
131
|
+
color: item.coverImage?.color,
|
|
132
|
+
totalEpisodes: item.episodes ?? item.nextAiringEpisode?.episode - 1,
|
|
133
|
+
currentEpisodeCount: item?.nextAiringEpisode ? item?.nextAiringEpisode?.episode - 1 : item.episodes,
|
|
134
|
+
type: item.format,
|
|
135
|
+
releaseDate: item.seasonYear,
|
|
136
|
+
})) ??
|
|
137
|
+
data.data.map((item: any) => ({
|
|
138
|
+
id: item.anilistId.toString(),
|
|
139
|
+
malId: item.mappings!.mal!,
|
|
140
|
+
title: item.title,
|
|
141
|
+
status:
|
|
142
|
+
item.status === 'RELEASING'
|
|
143
|
+
? MediaStatus.ONGOING
|
|
144
|
+
: item.status === 'FINISHED'
|
|
145
|
+
? MediaStatus.COMPLETED
|
|
146
|
+
: item.status === 'NOT_YET_RELEASED'
|
|
147
|
+
? MediaStatus.NOT_YET_AIRED
|
|
148
|
+
: item.status === 'CANCELLED'
|
|
149
|
+
? MediaStatus.CANCELLED
|
|
150
|
+
: item.status === 'HIATUS'
|
|
151
|
+
? MediaStatus.HIATUS
|
|
152
|
+
: MediaStatus.UNKNOWN,
|
|
153
|
+
image: item.coverImage ?? item.bannerImage,
|
|
154
|
+
imageHash: getHashFromImage(item.coverImage ?? item.bannerImage),
|
|
155
|
+
cover: item.bannerImage,
|
|
156
|
+
coverHash: getHashFromImage(item.bannerImage),
|
|
157
|
+
popularity: item.popularity,
|
|
158
|
+
description: item.description,
|
|
159
|
+
rating: item.averageScore,
|
|
160
|
+
genres: item.genre,
|
|
161
|
+
color: item.color,
|
|
162
|
+
totalEpisodes: item.currentEpisode,
|
|
163
|
+
currentEpisodeCount: item?.nextAiringEpisode ? item?.nextAiringEpisode?.episode - 1 : item.currentEpisode,
|
|
164
|
+
type: item.format,
|
|
165
|
+
releaseDate: item.year,
|
|
166
|
+
})),
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
return res;
|
|
170
|
+
} catch (err) {
|
|
171
|
+
throw new Error((err as Error).message);
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
*
|
|
177
|
+
* @param query Search query (optional)
|
|
178
|
+
* @param type Media type (optional) (default: `ANIME`) (options: `ANIME`, `MANGA`)
|
|
179
|
+
* @param page Page number (optional)
|
|
180
|
+
* @param perPage Number of results per page (optional) (default: `20`) (max: `50`)
|
|
181
|
+
* @param format Format (optional) (options: `TV`, `TV_SHORT`, `MOVIE`, `SPECIAL`, `OVA`, `ONA`, `MUSIC`)
|
|
182
|
+
* @param sort Sort (optional) (Default: `[POPULARITY_DESC, SCORE_DESC]`) (options: `POPULARITY_DESC`, `POPULARITY`, `TRENDING_DESC`, `TRENDING`, `UPDATED_AT_DESC`, `UPDATED_AT`, `START_DATE_DESC`, `START_DATE`, `END_DATE_DESC`, `END_DATE`, `FAVOURITES_DESC`, `FAVOURITES`, `SCORE_DESC`, `SCORE`, `TITLE_ROMAJI_DESC`, `TITLE_ROMAJI`, `TITLE_ENGLISH_DESC`, `TITLE_ENGLISH`, `TITLE_NATIVE_DESC`, `TITLE_NATIVE`, `EPISODES_DESC`, `EPISODES`, `ID`, `ID_DESC`)
|
|
183
|
+
* @param genres Genres (optional) (options: `Action`, `Adventure`, `Cars`, `Comedy`, `Drama`, `Fantasy`, `Horror`, `Mahou Shoujo`, `Mecha`, `Music`, `Mystery`, `Psychological`, `Romance`, `Sci-Fi`, `Slice of Life`, `Sports`, `Supernatural`, `Thriller`)
|
|
184
|
+
* @param id anilist Id (optional)
|
|
185
|
+
* @param year Year (optional) e.g. `2022`
|
|
186
|
+
* @param status Status (optional) (options: `RELEASING`, `FINISHED`, `NOT_YET_RELEASED`, `CANCELLED`, `HIATUS`)
|
|
187
|
+
* @param season Season (optional) (options: `WINTER`, `SPRING`, `SUMMER`, `FALL`)
|
|
188
|
+
*/
|
|
189
|
+
advancedSearch = async (
|
|
190
|
+
query?: string,
|
|
191
|
+
type: string = 'ANIME',
|
|
192
|
+
page: number = 1,
|
|
193
|
+
perPage: number = 20,
|
|
194
|
+
format?: string,
|
|
195
|
+
sort?: string[],
|
|
196
|
+
genres?: Genres[] | string[],
|
|
197
|
+
id?: string | number,
|
|
198
|
+
year?: number,
|
|
199
|
+
status?: string,
|
|
200
|
+
season?: string
|
|
201
|
+
): Promise<ISearch<IAnimeResult>> => {
|
|
202
|
+
const options = {
|
|
203
|
+
headers: {
|
|
204
|
+
'Content-Type': 'application/json',
|
|
205
|
+
'Accept': 'application/json',
|
|
206
|
+
},
|
|
207
|
+
query: anilistAdvancedQuery(),
|
|
208
|
+
variables: {
|
|
209
|
+
search: query,
|
|
210
|
+
type: type,
|
|
211
|
+
page: page,
|
|
212
|
+
size: perPage,
|
|
213
|
+
format: format,
|
|
214
|
+
sort: sort,
|
|
215
|
+
genres: genres,
|
|
216
|
+
id: id,
|
|
217
|
+
year: year ? `${year}%` : undefined,
|
|
218
|
+
status: status,
|
|
219
|
+
season: season,
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
if (genres) {
|
|
224
|
+
genres.forEach((genre) => {
|
|
225
|
+
if (!Object.values(Genres).includes(genre as Genres)) {
|
|
226
|
+
throw new Error(`genre ${genre} is not valid`);
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
try {
|
|
232
|
+
let { data, status } = await axios.post(this.anilistGraphqlUrl, options, {
|
|
233
|
+
validateStatus: () => true,
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
if (status >= 500 && !query) throw new Error('No results found');
|
|
237
|
+
if (status >= 500) data = await new Anify().rawSearch(query!, page);
|
|
238
|
+
|
|
239
|
+
const res: ISearch<IAnimeResult> = {
|
|
240
|
+
currentPage: data.data?.Page?.pageInfo?.currentPage ?? data.meta?.currentPage,
|
|
241
|
+
hasNextPage: data.data?.Page?.pageInfo?.hasNextPage ?? data.meta?.currentPage !== data.meta?.lastPage,
|
|
242
|
+
totalPages: data.data?.Page?.pageInfo?.lastPage,
|
|
243
|
+
totalResults: data.data?.Page?.pageInfo?.total,
|
|
244
|
+
results: [],
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
res.results.push(
|
|
248
|
+
...(data.data?.Page?.media?.map((item: any) => ({
|
|
249
|
+
id: item.id.toString(),
|
|
250
|
+
malId: item.idMal,
|
|
251
|
+
title: item.title
|
|
252
|
+
? {
|
|
253
|
+
romaji: item.title.romaji,
|
|
254
|
+
english: item.title.english,
|
|
255
|
+
native: item.title.native,
|
|
256
|
+
userPreferred: item.title.userPreferred,
|
|
257
|
+
}
|
|
258
|
+
: item.title.romaji,
|
|
259
|
+
status:
|
|
260
|
+
item.status === 'RELEASING'
|
|
261
|
+
? MediaStatus.ONGOING
|
|
262
|
+
: item.status === 'FINISHED'
|
|
263
|
+
? MediaStatus.COMPLETED
|
|
264
|
+
: item.status === 'NOT_YET_RELEASED'
|
|
265
|
+
? MediaStatus.NOT_YET_AIRED
|
|
266
|
+
: item.status === 'CANCELLED'
|
|
267
|
+
? MediaStatus.CANCELLED
|
|
268
|
+
: item.status === 'HIATUS'
|
|
269
|
+
? MediaStatus.HIATUS
|
|
270
|
+
: MediaStatus.UNKNOWN,
|
|
271
|
+
image: item.coverImage.extraLarge ?? item.coverImage.large ?? item.coverImage.medium,
|
|
272
|
+
imageHash: getHashFromImage(item.coverImage.extraLarge ?? item.coverImage.large ?? item.coverImage.medium),
|
|
273
|
+
cover: item.bannerImage,
|
|
274
|
+
coverHash: getHashFromImage(item.bannerImage),
|
|
275
|
+
popularity: item.popularity,
|
|
276
|
+
totalEpisodes: item.episodes ?? item.nextAiringEpisode?.episode - 1,
|
|
277
|
+
currentEpisode: item.nextAiringEpisode?.episode - 1 || item.episodes,
|
|
278
|
+
countryOfOrigin: item.countryOfOrigin,
|
|
279
|
+
description: item.description,
|
|
280
|
+
genres: item.genres,
|
|
281
|
+
rating: item.averageScore,
|
|
282
|
+
color: item.coverImage?.color,
|
|
283
|
+
type: item.format,
|
|
284
|
+
releaseDate: item.seasonYear,
|
|
285
|
+
})) ??
|
|
286
|
+
data.data?.map((item: any) => ({
|
|
287
|
+
id: item.anilistId.toString(),
|
|
288
|
+
malId: item.mappings.mal,
|
|
289
|
+
title: item.title,
|
|
290
|
+
status:
|
|
291
|
+
item.status === 'RELEASING'
|
|
292
|
+
? MediaStatus.ONGOING
|
|
293
|
+
: item.status === 'FINISHED'
|
|
294
|
+
? MediaStatus.COMPLETED
|
|
295
|
+
: item.status === 'NOT_YET_RELEASED'
|
|
296
|
+
? MediaStatus.NOT_YET_AIRED
|
|
297
|
+
: item.status === 'CANCELLED'
|
|
298
|
+
? MediaStatus.CANCELLED
|
|
299
|
+
: item.status === 'HIATUS'
|
|
300
|
+
? MediaStatus.HIATUS
|
|
301
|
+
: MediaStatus.UNKNOWN,
|
|
302
|
+
image: item.coverImage ?? item.bannerImage,
|
|
303
|
+
imageHash: getHashFromImage(item.coverImage ?? item.bannerImage),
|
|
304
|
+
cover: item.bannerImage,
|
|
305
|
+
coverHash: getHashFromImage(item.bannerImage),
|
|
306
|
+
popularity: item.popularity,
|
|
307
|
+
description: item.description,
|
|
308
|
+
rating: item.averageScore,
|
|
309
|
+
genres: item.genre,
|
|
310
|
+
color: item.color,
|
|
311
|
+
totalEpisodes: item.currentEpisode,
|
|
312
|
+
type: item.format,
|
|
313
|
+
releaseDate: item.year,
|
|
314
|
+
})))
|
|
315
|
+
);
|
|
316
|
+
|
|
317
|
+
return res;
|
|
318
|
+
} catch (err) {
|
|
319
|
+
throw new Error((err as Error).message);
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
*
|
|
325
|
+
* @param id Anime id
|
|
326
|
+
* @param dub to get dubbed episodes (optional) set to `true` to get dubbed episodes. **ONLY WORKS FOR GOGOANIME**
|
|
327
|
+
* @param fetchFiller to get filler boolean on the episode object (optional) set to `true` to get filler boolean on the episode object.
|
|
328
|
+
*/
|
|
329
|
+
override fetchAnimeInfo = async (id: string, fetchFiller: boolean = false): Promise<IAnimeInfo> => {
|
|
330
|
+
const animeInfo: IAnimeInfo = {
|
|
331
|
+
id: id,
|
|
332
|
+
title: '',
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
const options = {
|
|
336
|
+
headers: {
|
|
337
|
+
'Content-Type': 'application/json',
|
|
338
|
+
'Accept': 'application/json',
|
|
339
|
+
},
|
|
340
|
+
query: anilistMediaDetailQuery(id),
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
let fillerEpisodes: { 'number': string; 'filler-bool': boolean }[];
|
|
344
|
+
try {
|
|
345
|
+
let { data, status } = await axios.post(this.anilistGraphqlUrl, options, {
|
|
346
|
+
validateStatus: () => true,
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
if (status === 404) throw new Error('Media not found. Perhaps the id is invalid or the anime is not in anilist');
|
|
350
|
+
if (status === 429) throw new Error('You have been ratelimited by anilist. Please try again later');
|
|
351
|
+
// if (status >= 500) throw new Error('Anilist seems to be down. Please try again later');
|
|
352
|
+
if (status !== 200 && status < 429)
|
|
353
|
+
throw Error('Media not found. If the problem persists, please contact the developer');
|
|
354
|
+
if (status >= 500) data = await new Anify().fetchAnimeInfoByIdRaw(id);
|
|
355
|
+
|
|
356
|
+
animeInfo.malId = data.data?.Media?.idMal ?? data?.mappings?.mal;
|
|
357
|
+
animeInfo.title = data.data.Media
|
|
358
|
+
? {
|
|
359
|
+
romaji: data.data.Media.title.romaji,
|
|
360
|
+
english: data.data.Media.title.english,
|
|
361
|
+
native: data.data.Media.title.native,
|
|
362
|
+
userPreferred: data.data.Media.title.userPreferred,
|
|
363
|
+
}
|
|
364
|
+
: (data.data.title as ITitle);
|
|
365
|
+
|
|
366
|
+
animeInfo.synonyms = data.data?.Media?.synonyms ?? data?.synonyms;
|
|
367
|
+
animeInfo.isLicensed = data.data?.Media?.isLicensed ?? undefined;
|
|
368
|
+
animeInfo.isAdult = data.data?.Media?.isAdult ?? undefined;
|
|
369
|
+
animeInfo.countryOfOrigin = data.data?.Media?.countryOfOrigin ?? undefined;
|
|
370
|
+
|
|
371
|
+
if (data.data?.Media?.trailer?.id) {
|
|
372
|
+
animeInfo.trailer = {
|
|
373
|
+
id: data.data.Media.trailer.id,
|
|
374
|
+
site: data.data.Media.trailer?.site,
|
|
375
|
+
thumbnail: data.data.Media.trailer?.thumbnail,
|
|
376
|
+
thumbnailHash: getHashFromImage(data.data.Media.trailer?.thumbnail),
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
animeInfo.image =
|
|
380
|
+
data.data?.Media?.coverImage?.extraLarge ??
|
|
381
|
+
data.data?.Media?.coverImage?.large ??
|
|
382
|
+
data.data?.Media?.coverImage?.medium ??
|
|
383
|
+
data.coverImage ??
|
|
384
|
+
data.bannerImage;
|
|
385
|
+
|
|
386
|
+
animeInfo.imageHash = getHashFromImage(
|
|
387
|
+
data.data?.Media?.coverImage?.extraLarge ??
|
|
388
|
+
data.data?.Media?.coverImage?.large ??
|
|
389
|
+
data.data?.Media?.coverImage?.medium ??
|
|
390
|
+
data.coverImage ??
|
|
391
|
+
data.bannerImage
|
|
392
|
+
);
|
|
393
|
+
|
|
394
|
+
animeInfo.popularity = data.data?.Media?.popularity ?? data?.popularity;
|
|
395
|
+
animeInfo.color = data.data?.Media?.coverImage?.color ?? data?.color;
|
|
396
|
+
animeInfo.cover = data.data?.Media?.bannerImage ?? data?.bannerImage ?? animeInfo.image;
|
|
397
|
+
animeInfo.coverHash = getHashFromImage(data.data?.Media?.bannerImage ?? data?.bannerImage ?? animeInfo.image);
|
|
398
|
+
animeInfo.description = data.data?.Media?.description ?? data?.description;
|
|
399
|
+
switch (data.data?.Media?.status ?? data?.status) {
|
|
400
|
+
case 'RELEASING':
|
|
401
|
+
animeInfo.status = MediaStatus.ONGOING;
|
|
402
|
+
break;
|
|
403
|
+
case 'FINISHED':
|
|
404
|
+
animeInfo.status = MediaStatus.COMPLETED;
|
|
405
|
+
break;
|
|
406
|
+
case 'NOT_YET_RELEASED':
|
|
407
|
+
animeInfo.status = MediaStatus.NOT_YET_AIRED;
|
|
408
|
+
break;
|
|
409
|
+
case 'CANCELLED':
|
|
410
|
+
animeInfo.status = MediaStatus.CANCELLED;
|
|
411
|
+
break;
|
|
412
|
+
case 'HIATUS':
|
|
413
|
+
animeInfo.status = MediaStatus.HIATUS;
|
|
414
|
+
break;
|
|
415
|
+
default:
|
|
416
|
+
animeInfo.status = MediaStatus.UNKNOWN;
|
|
417
|
+
}
|
|
418
|
+
animeInfo.releaseDate = data.data?.Media?.startDate?.year ?? data.year;
|
|
419
|
+
animeInfo.startDate = {
|
|
420
|
+
year: data.data.Media.startDate.year,
|
|
421
|
+
month: data.data.Media.startDate.month,
|
|
422
|
+
day: data.data.Media.startDate.day,
|
|
423
|
+
};
|
|
424
|
+
animeInfo.endDate = {
|
|
425
|
+
year: data.data.Media.endDate.year,
|
|
426
|
+
month: data.data.Media.endDate.month,
|
|
427
|
+
day: data.data.Media.endDate.day,
|
|
428
|
+
};
|
|
429
|
+
if (data.data.Media.nextAiringEpisode?.airingAt)
|
|
430
|
+
animeInfo.nextAiringEpisode = {
|
|
431
|
+
airingTime: data.data.Media.nextAiringEpisode?.airingAt,
|
|
432
|
+
timeUntilAiring: data.data.Media.nextAiringEpisode?.timeUntilAiring,
|
|
433
|
+
episode: data.data.Media.nextAiringEpisode?.episode,
|
|
434
|
+
};
|
|
435
|
+
animeInfo.totalEpisodes = data.data.Media?.episodes ?? data.data.Media.nextAiringEpisode?.episode - 1;
|
|
436
|
+
animeInfo.currentEpisode = data.data.Media?.nextAiringEpisode?.episode
|
|
437
|
+
? data.data.Media.nextAiringEpisode?.episode - 1
|
|
438
|
+
: data.data.Media?.episodes;
|
|
439
|
+
animeInfo.rating = data.data.Media.averageScore;
|
|
440
|
+
animeInfo.duration = data.data.Media.duration;
|
|
441
|
+
animeInfo.genres = data.data.Media.genres;
|
|
442
|
+
animeInfo.season = data.data.Media.season;
|
|
443
|
+
animeInfo.studios = data.data.Media.studios.edges.map((item: any) => item.node.name);
|
|
444
|
+
animeInfo.type = data.data.Media.format;
|
|
445
|
+
animeInfo.recommendations = data.data.Media?.recommendations?.edges?.map((item: any) => ({
|
|
446
|
+
id: item.node.mediaRecommendation?.id,
|
|
447
|
+
malId: item.node.mediaRecommendation?.idMal,
|
|
448
|
+
title: {
|
|
449
|
+
romaji: item.node.mediaRecommendation?.title?.romaji,
|
|
450
|
+
english: item.node.mediaRecommendation?.title?.english,
|
|
451
|
+
native: item.node.mediaRecommendation?.title?.native,
|
|
452
|
+
userPreferred: item.node.mediaRecommendation?.title?.userPreferred,
|
|
453
|
+
},
|
|
454
|
+
status:
|
|
455
|
+
item.node.mediaRecommendation?.status === 'RELEASING'
|
|
456
|
+
? MediaStatus.ONGOING
|
|
457
|
+
: item.node.mediaRecommendation?.status === 'FINISHED'
|
|
458
|
+
? MediaStatus.COMPLETED
|
|
459
|
+
: item.node.mediaRecommendation?.status === 'NOT_YET_RELEASED'
|
|
460
|
+
? MediaStatus.NOT_YET_AIRED
|
|
461
|
+
: item.node.mediaRecommendation?.status === 'CANCELLED'
|
|
462
|
+
? MediaStatus.CANCELLED
|
|
463
|
+
: item.node.mediaRecommendation?.status === 'HIATUS'
|
|
464
|
+
? MediaStatus.HIATUS
|
|
465
|
+
: MediaStatus.UNKNOWN,
|
|
466
|
+
episodes: item.node.mediaRecommendation?.episodes,
|
|
467
|
+
image:
|
|
468
|
+
item.node.mediaRecommendation?.coverImage?.extraLarge ??
|
|
469
|
+
item.node.mediaRecommendation?.coverImage?.large ??
|
|
470
|
+
item.node.mediaRecommendation?.coverImage?.medium,
|
|
471
|
+
imageHash: getHashFromImage(
|
|
472
|
+
item.node.mediaRecommendation?.coverImage?.extraLarge ??
|
|
473
|
+
item.node.mediaRecommendation?.coverImage?.large ??
|
|
474
|
+
item.node.mediaRecommendation?.coverImage?.medium
|
|
475
|
+
),
|
|
476
|
+
cover:
|
|
477
|
+
item.node.mediaRecommendation?.bannerImage ??
|
|
478
|
+
item.node.mediaRecommendation?.coverImage?.extraLarge ??
|
|
479
|
+
item.node.mediaRecommendation?.coverImage?.large ??
|
|
480
|
+
item.node.mediaRecommendation?.coverImage?.medium,
|
|
481
|
+
coverHash: getHashFromImage(
|
|
482
|
+
item.node.mediaRecommendation?.bannerImage ??
|
|
483
|
+
item.node.mediaRecommendation?.coverImage?.extraLarge ??
|
|
484
|
+
item.node.mediaRecommendation?.coverImage?.large ??
|
|
485
|
+
item.node.mediaRecommendation?.coverImage?.medium
|
|
486
|
+
),
|
|
487
|
+
rating: item.node.mediaRecommendation?.meanScore,
|
|
488
|
+
type: item.node.mediaRecommendation?.format,
|
|
489
|
+
}));
|
|
490
|
+
|
|
491
|
+
animeInfo.characters = data.data?.Media?.characters?.edges?.map((item: any) => ({
|
|
492
|
+
id: item.node?.id,
|
|
493
|
+
role: item.role,
|
|
494
|
+
name: {
|
|
495
|
+
first: item.node.name.first,
|
|
496
|
+
last: item.node.name.last,
|
|
497
|
+
full: item.node.name.full,
|
|
498
|
+
native: item.node.name.native,
|
|
499
|
+
userPreferred: item.node.name.userPreferred,
|
|
500
|
+
},
|
|
501
|
+
image: item.node.image.large ?? item.node.image.medium,
|
|
502
|
+
imageHash: getHashFromImage(item.node.image.large ?? item.node.image.medium),
|
|
503
|
+
voiceActors: item.voiceActors.map((voiceActor: any) => ({
|
|
504
|
+
id: voiceActor.id,
|
|
505
|
+
language: voiceActor.languageV2,
|
|
506
|
+
name: {
|
|
507
|
+
first: voiceActor.name.first,
|
|
508
|
+
last: voiceActor.name.last,
|
|
509
|
+
full: voiceActor.name.full,
|
|
510
|
+
native: voiceActor.name.native,
|
|
511
|
+
userPreferred: voiceActor.name.userPreferred,
|
|
512
|
+
},
|
|
513
|
+
image: voiceActor.image.large ?? voiceActor.image.medium,
|
|
514
|
+
imageHash: getHashFromImage(voiceActor.image.large ?? voiceActor.image.medium),
|
|
515
|
+
})),
|
|
516
|
+
}));
|
|
517
|
+
|
|
518
|
+
animeInfo.relations = data.data?.Media?.relations?.edges?.map((item: any) => ({
|
|
519
|
+
id: item.node.id,
|
|
520
|
+
relationType: item.relationType,
|
|
521
|
+
malId: item.node.idMal,
|
|
522
|
+
title: {
|
|
523
|
+
romaji: item.node.title.romaji,
|
|
524
|
+
english: item.node.title.english,
|
|
525
|
+
native: item.node.title.native,
|
|
526
|
+
userPreferred: item.node.title.userPreferred,
|
|
527
|
+
},
|
|
528
|
+
status:
|
|
529
|
+
item.node.status === 'RELEASING'
|
|
530
|
+
? MediaStatus.ONGOING
|
|
531
|
+
: item.node.status === 'FINISHED'
|
|
532
|
+
? MediaStatus.COMPLETED
|
|
533
|
+
: item.node.status === 'NOT_YET_RELEASED'
|
|
534
|
+
? MediaStatus.NOT_YET_AIRED
|
|
535
|
+
: item.node.status === 'CANCELLED'
|
|
536
|
+
? MediaStatus.CANCELLED
|
|
537
|
+
: item.node.status === 'HIATUS'
|
|
538
|
+
? MediaStatus.HIATUS
|
|
539
|
+
: MediaStatus.UNKNOWN,
|
|
540
|
+
episodes: item.node.episodes,
|
|
541
|
+
image: item.node.coverImage.extraLarge ?? item.node.coverImage.large ?? item.node.coverImage.medium,
|
|
542
|
+
imageHash: getHashFromImage(
|
|
543
|
+
item.node.coverImage.extraLarge ?? item.node.coverImage.large ?? item.node.coverImage.medium
|
|
544
|
+
),
|
|
545
|
+
color: item.node.coverImage?.color,
|
|
546
|
+
type: item.node.format,
|
|
547
|
+
cover:
|
|
548
|
+
item.node.bannerImage ??
|
|
549
|
+
item.node.coverImage.extraLarge ??
|
|
550
|
+
item.node.coverImage.large ??
|
|
551
|
+
item.node.coverImage.medium,
|
|
552
|
+
coverHash: getHashFromImage(
|
|
553
|
+
item.node.bannerImage ??
|
|
554
|
+
item.node.coverImage.extraLarge ??
|
|
555
|
+
item.node.coverImage.large ??
|
|
556
|
+
item.node.coverImage.medium
|
|
557
|
+
),
|
|
558
|
+
rating: item.node.meanScore,
|
|
559
|
+
}));
|
|
560
|
+
if (this.provider instanceof Zoro) {
|
|
561
|
+
try {
|
|
562
|
+
const anifyInfo = await new Anify(
|
|
563
|
+
this.proxyConfig,
|
|
564
|
+
undefined,
|
|
565
|
+
this.provider.name.toLowerCase() as 'gogoanime' | 'zoro' | 'animepahe' | '9anime'
|
|
566
|
+
).fetchAnimeInfo(id);
|
|
567
|
+
animeInfo.mappings = anifyInfo.mappings;
|
|
568
|
+
animeInfo.artwork = anifyInfo.artwork;
|
|
569
|
+
animeInfo.episodes = anifyInfo.episodes?.map((item: any) => ({
|
|
570
|
+
id: item.id,
|
|
571
|
+
title: item.title,
|
|
572
|
+
description: item.description,
|
|
573
|
+
number: item.number,
|
|
574
|
+
image: item.image,
|
|
575
|
+
imageHash: getHashFromImage(item.image),
|
|
576
|
+
airDate: item.airDate ?? null,
|
|
577
|
+
}));
|
|
578
|
+
if (!animeInfo.episodes?.length) {
|
|
579
|
+
animeInfo.episodes = await this.fetchDefaultEpisodeList({
|
|
580
|
+
idMal: animeInfo.malId! as number,
|
|
581
|
+
season: data.data.Media.season,
|
|
582
|
+
startDate: { year: parseInt(animeInfo.releaseDate!) },
|
|
583
|
+
title: {
|
|
584
|
+
english: animeInfo.title?.english!,
|
|
585
|
+
romaji: animeInfo.title?.romaji!,
|
|
586
|
+
},
|
|
587
|
+
});
|
|
588
|
+
animeInfo.episodes = animeInfo.episodes?.map((episode: IAnimeEpisode) => {
|
|
589
|
+
if (!episode.image) {
|
|
590
|
+
episode.image = animeInfo.image;
|
|
591
|
+
episode.imageHash = animeInfo.imageHash;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
return episode;
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
} catch (err) {
|
|
598
|
+
animeInfo.episodes = await this.fetchDefaultEpisodeList({
|
|
599
|
+
idMal: animeInfo.malId! as number,
|
|
600
|
+
season: data.data.Media.season,
|
|
601
|
+
startDate: { year: parseInt(animeInfo.releaseDate!) },
|
|
602
|
+
title: {
|
|
603
|
+
english: animeInfo.title?.english!,
|
|
604
|
+
romaji: animeInfo.title?.romaji!,
|
|
605
|
+
},
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
animeInfo.episodes = animeInfo.episodes?.map((episode: IAnimeEpisode) => {
|
|
609
|
+
if (!episode.image) {
|
|
610
|
+
episode.image = animeInfo.image;
|
|
611
|
+
episode.imageHash = animeInfo.imageHash;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
return episode;
|
|
615
|
+
});
|
|
616
|
+
|
|
617
|
+
return animeInfo;
|
|
618
|
+
}
|
|
619
|
+
} else
|
|
620
|
+
animeInfo.episodes = await this.fetchDefaultEpisodeList({
|
|
621
|
+
idMal: animeInfo.malId! as number,
|
|
622
|
+
season: data.data.Media.season,
|
|
623
|
+
startDate: { year: parseInt(animeInfo.releaseDate!) },
|
|
624
|
+
title: {
|
|
625
|
+
english: animeInfo.title?.english!,
|
|
626
|
+
romaji: animeInfo.title?.romaji!,
|
|
627
|
+
},
|
|
628
|
+
externalLinks: data.data.Media.externalLinks.filter((link: any) => link.type === 'STREAMING'),
|
|
629
|
+
});
|
|
630
|
+
|
|
631
|
+
if (fetchFiller) {
|
|
632
|
+
const { data: fillerData } = await axios.get(
|
|
633
|
+
`https://raw.githubusercontent.com/saikou-app/mal-id-filler-list/main/fillers/${animeInfo.malId}.json`,
|
|
634
|
+
{ validateStatus: () => true }
|
|
635
|
+
);
|
|
636
|
+
|
|
637
|
+
if (!fillerData.toString().startsWith('404')) {
|
|
638
|
+
fillerEpisodes = [];
|
|
639
|
+
fillerEpisodes?.push(
|
|
640
|
+
...(fillerData.episodes as {
|
|
641
|
+
'number': string;
|
|
642
|
+
'filler-bool': boolean;
|
|
643
|
+
}[])
|
|
644
|
+
);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
animeInfo.episodes = animeInfo.episodes?.map((episode: IAnimeEpisode) => {
|
|
649
|
+
if (!episode.image) {
|
|
650
|
+
episode.image = animeInfo.image;
|
|
651
|
+
episode.imageHash = animeInfo.imageHash;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
if (fetchFiller && fillerEpisodes?.length > 0 && fillerEpisodes?.length >= animeInfo.episodes!.length) {
|
|
655
|
+
if (fillerEpisodes[episode.number! - 1])
|
|
656
|
+
episode.isFiller = new Boolean(fillerEpisodes?.[episode.number! - 1]!['filler-bool']).valueOf();
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
return episode;
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
return animeInfo;
|
|
663
|
+
} catch (err) {
|
|
664
|
+
throw new Error((err as Error).message);
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
*
|
|
670
|
+
* @param episodeId Episode id
|
|
671
|
+
*/
|
|
672
|
+
override fetchEpisodeSources = async (episodeId: string, ...args: any): Promise<ISource> => {
|
|
673
|
+
try {
|
|
674
|
+
if (this.provider instanceof Anify) return new Anify().fetchEpisodeSources(episodeId, args[0], args[1]);
|
|
675
|
+
return this.provider.fetchEpisodeSources(episodeId, ...args);
|
|
676
|
+
} catch (err) {
|
|
677
|
+
throw new Error(`Failed to fetch episode sources from ${this.provider.name}: ${err}`);
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
*
|
|
683
|
+
* @param episodeId Episode id
|
|
684
|
+
*/
|
|
685
|
+
override fetchEpisodeServers = async (episodeId: string): Promise<IEpisodeServer[]> => {
|
|
686
|
+
try {
|
|
687
|
+
return this.provider.fetchEpisodeServers(episodeId);
|
|
688
|
+
} catch (err) {
|
|
689
|
+
throw new Error(`Failed to fetch episode servers from ${this.provider.name}: ${err}`);
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* @param page page number to search for (optional)
|
|
695
|
+
* @param perPage number of results per page (optional)
|
|
696
|
+
*/
|
|
697
|
+
fetchTrendingAnime = async (page: number = 1, perPage: number = 10): Promise<ISearch<IAnimeResult>> => {
|
|
698
|
+
const options = {
|
|
699
|
+
headers: {
|
|
700
|
+
'Content-Type': 'application/json',
|
|
701
|
+
'Accept': 'application/json',
|
|
702
|
+
},
|
|
703
|
+
query: anilistTrendingQuery(page, perPage),
|
|
704
|
+
};
|
|
705
|
+
|
|
706
|
+
try {
|
|
707
|
+
const { data } = await axios.post(this.anilistGraphqlUrl, options);
|
|
708
|
+
|
|
709
|
+
const res: ISearch<IAnimeResult> = {
|
|
710
|
+
currentPage: data.data.Page.pageInfo.currentPage,
|
|
711
|
+
hasNextPage: data.data.Page.pageInfo.hasNextPage,
|
|
712
|
+
results: data.data.Page.media.map((item: any) => ({
|
|
713
|
+
id: item.id.toString(),
|
|
714
|
+
malId: item.idMal,
|
|
715
|
+
title: item.title
|
|
716
|
+
? {
|
|
717
|
+
romaji: item.title.romaji,
|
|
718
|
+
english: item.title.english,
|
|
719
|
+
native: item.title.native,
|
|
720
|
+
userPreferred: item.title.userPreferred,
|
|
721
|
+
}
|
|
722
|
+
: item.title.romaji,
|
|
723
|
+
image: item.coverImage.extraLarge ?? item.coverImage.large ?? item.coverImage.medium,
|
|
724
|
+
imageHash: getHashFromImage(item.coverImage.extraLarge ?? item.coverImage.large ?? item.coverImage.medium),
|
|
725
|
+
trailer: {
|
|
726
|
+
id: item.trailer?.id,
|
|
727
|
+
site: item.trailer?.site,
|
|
728
|
+
thumbnail: item.trailer?.thumbnail,
|
|
729
|
+
thumbnailHash: getHashFromImage(item.trailer?.thumbnail),
|
|
730
|
+
},
|
|
731
|
+
description: item.description,
|
|
732
|
+
status:
|
|
733
|
+
item.status === 'RELEASING'
|
|
734
|
+
? MediaStatus.ONGOING
|
|
735
|
+
: item.status === 'FINISHED'
|
|
736
|
+
? MediaStatus.COMPLETED
|
|
737
|
+
: item.status === 'NOT_YET_RELEASED'
|
|
738
|
+
? MediaStatus.NOT_YET_AIRED
|
|
739
|
+
: item.status === 'CANCELLED'
|
|
740
|
+
? MediaStatus.CANCELLED
|
|
741
|
+
: item.status === 'HIATUS'
|
|
742
|
+
? MediaStatus.HIATUS
|
|
743
|
+
: MediaStatus.UNKNOWN,
|
|
744
|
+
cover: item.bannerImage ?? item.coverImage.extraLarge ?? item.coverImage.large ?? item.coverImage.medium,
|
|
745
|
+
coverHash: getHashFromImage(
|
|
746
|
+
item.bannerImage ?? item.coverImage.extraLarge ?? item.coverImage.large ?? item.coverImage.medium
|
|
747
|
+
),
|
|
748
|
+
rating: item.averageScore,
|
|
749
|
+
releaseDate: item.seasonYear,
|
|
750
|
+
color: item.coverImage?.color,
|
|
751
|
+
genres: item.genres,
|
|
752
|
+
totalEpisodes: isNaN(item.episodes)
|
|
753
|
+
? 0
|
|
754
|
+
: (item.episodes ?? (item.nextAiringEpisode?.episode ? item.nextAiringEpisode.episode - 1 : 0)),
|
|
755
|
+
duration: item.duration,
|
|
756
|
+
type: item.format,
|
|
757
|
+
})),
|
|
758
|
+
};
|
|
759
|
+
return res;
|
|
760
|
+
} catch (err) {
|
|
761
|
+
throw new Error((err as Error).message);
|
|
762
|
+
}
|
|
763
|
+
};
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
*
|
|
767
|
+
* @param page page number to search for (optional)
|
|
768
|
+
* @param perPage number of results per page (optional)
|
|
769
|
+
*/
|
|
770
|
+
fetchPopularAnime = async (page: number = 1, perPage: number = 10): Promise<ISearch<IAnimeResult>> => {
|
|
771
|
+
const options = {
|
|
772
|
+
headers: {
|
|
773
|
+
'Content-Type': 'application/json',
|
|
774
|
+
'Accept': 'application/json',
|
|
775
|
+
},
|
|
776
|
+
query: anilistPopularQuery(page, perPage),
|
|
777
|
+
};
|
|
778
|
+
|
|
779
|
+
try {
|
|
780
|
+
const { data } = await axios.post(this.anilistGraphqlUrl, options);
|
|
781
|
+
|
|
782
|
+
const res: ISearch<IAnimeResult> = {
|
|
783
|
+
currentPage: data.data.Page.pageInfo.currentPage,
|
|
784
|
+
hasNextPage: data.data.Page.pageInfo.hasNextPage,
|
|
785
|
+
results: data.data.Page.media.map((item: any) => ({
|
|
786
|
+
id: item.id.toString(),
|
|
787
|
+
malId: item.idMal,
|
|
788
|
+
title: item.title
|
|
789
|
+
? {
|
|
790
|
+
romaji: item.title.romaji,
|
|
791
|
+
english: item.title.english,
|
|
792
|
+
native: item.title.native,
|
|
793
|
+
userPreferred: item.title.userPreferred,
|
|
794
|
+
}
|
|
795
|
+
: item.title.romaji,
|
|
796
|
+
image: item.coverImage.extraLarge ?? item.coverImage.large ?? item.coverImage.medium,
|
|
797
|
+
imageHash: getHashFromImage(item.coverImage.extraLarge ?? item.coverImage.large ?? item.coverImage.medium),
|
|
798
|
+
trailer: {
|
|
799
|
+
id: item.trailer?.id,
|
|
800
|
+
site: item.trailer?.site,
|
|
801
|
+
thumbnail: item.trailer?.thumbnail,
|
|
802
|
+
thumbnailHash: getHashFromImage(item.trailer?.thumbnail),
|
|
803
|
+
},
|
|
804
|
+
description: item.description,
|
|
805
|
+
status:
|
|
806
|
+
item.status === 'RELEASING'
|
|
807
|
+
? MediaStatus.ONGOING
|
|
808
|
+
: item.status === 'FINISHED'
|
|
809
|
+
? MediaStatus.COMPLETED
|
|
810
|
+
: item.status === 'NOT_YET_RELEASED'
|
|
811
|
+
? MediaStatus.NOT_YET_AIRED
|
|
812
|
+
: item.status === 'CANCELLED'
|
|
813
|
+
? MediaStatus.CANCELLED
|
|
814
|
+
: item.status === 'HIATUS'
|
|
815
|
+
? MediaStatus.HIATUS
|
|
816
|
+
: MediaStatus.UNKNOWN,
|
|
817
|
+
cover: item.bannerImage ?? item.coverImage.extraLarge ?? item.coverImage.large ?? item.coverImage.medium,
|
|
818
|
+
coverHash: getHashFromImage(
|
|
819
|
+
item.bannerImage ?? item.coverImage.extraLarge ?? item.coverImage.large ?? item.coverImage.medium
|
|
820
|
+
),
|
|
821
|
+
rating: item.averageScore,
|
|
822
|
+
releaseDate: item.seasonYear,
|
|
823
|
+
color: item.coverImage?.color,
|
|
824
|
+
genres: item.genres,
|
|
825
|
+
totalEpisodes: isNaN(item.episodes)
|
|
826
|
+
? 0
|
|
827
|
+
: (item.episodes ?? (item.nextAiringEpisode?.episode ? item.nextAiringEpisode.episode - 1 : 0)),
|
|
828
|
+
duration: item.duration,
|
|
829
|
+
type: item.format,
|
|
830
|
+
})),
|
|
831
|
+
};
|
|
832
|
+
return res;
|
|
833
|
+
} catch (err) {
|
|
834
|
+
throw new Error((err as Error).message);
|
|
835
|
+
}
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
*
|
|
840
|
+
* @param page page number (optional)
|
|
841
|
+
* @param perPage number of results per page (optional)
|
|
842
|
+
* @param weekStart Filter by the start of the week (optional) (default: todays date) (options: 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, 0 = Saturday, 1 = Sunday) you can use either the number or the string
|
|
843
|
+
* @param weekEnd Filter by the end of the week (optional) similar to weekStart
|
|
844
|
+
* @param notYetAired if true will return anime that have not yet aired (optional)
|
|
845
|
+
* @returns the next airing episodes
|
|
846
|
+
*/
|
|
847
|
+
fetchAiringSchedule = async (
|
|
848
|
+
page: number = 1,
|
|
849
|
+
perPage: number = 20,
|
|
850
|
+
weekStart: number | string = (new Date().getDay() + 1) % 7,
|
|
851
|
+
weekEnd: number | string = (new Date().getDay() + 7) % 7,
|
|
852
|
+
notYetAired: boolean = false
|
|
853
|
+
): Promise<ISearch<IAnimeResult>> => {
|
|
854
|
+
let day1, day2;
|
|
855
|
+
|
|
856
|
+
if (typeof weekStart === 'string' && typeof weekEnd === 'string')
|
|
857
|
+
[day1, day2] = getDays(
|
|
858
|
+
capitalizeFirstLetter(weekStart.toLowerCase()),
|
|
859
|
+
capitalizeFirstLetter(weekEnd.toLowerCase())
|
|
860
|
+
);
|
|
861
|
+
else if (typeof weekStart === 'number' && typeof weekEnd === 'number') [day1, day2] = [weekStart, weekEnd];
|
|
862
|
+
else throw new Error('Invalid weekStart or weekEnd');
|
|
863
|
+
|
|
864
|
+
const options = {
|
|
865
|
+
headers: {
|
|
866
|
+
'Content-Type': 'application/json',
|
|
867
|
+
'Accept': 'application/json',
|
|
868
|
+
},
|
|
869
|
+
query: anilistAiringScheduleQuery(page, perPage, day1!, day2!, notYetAired),
|
|
870
|
+
};
|
|
871
|
+
|
|
872
|
+
try {
|
|
873
|
+
const { data } = await axios.post(this.anilistGraphqlUrl, options);
|
|
874
|
+
|
|
875
|
+
const res: ISearch<IAnimeResult> = {
|
|
876
|
+
currentPage: data.data.Page.pageInfo.currentPage,
|
|
877
|
+
hasNextPage: data.data.Page.pageInfo.hasNextPage,
|
|
878
|
+
results: data.data.Page.airingSchedules.map((item: any) => ({
|
|
879
|
+
id: item.media.id.toString(),
|
|
880
|
+
malId: item.media.idMal,
|
|
881
|
+
episode: item.episode,
|
|
882
|
+
airingAt: item.airingAt,
|
|
883
|
+
title: item.media.title
|
|
884
|
+
? {
|
|
885
|
+
romaji: item.media.title.romaji,
|
|
886
|
+
english: item.media.title.english,
|
|
887
|
+
native: item.media.title.native,
|
|
888
|
+
userPreferred: item.media.title.userPreferred,
|
|
889
|
+
}
|
|
890
|
+
: item.media.title.romaji,
|
|
891
|
+
country: item.media.countryOfOrigin,
|
|
892
|
+
image: item.media.coverImage.extraLarge ?? item.media.coverImage.large ?? item.media.coverImage.medium,
|
|
893
|
+
imageHash: getHashFromImage(
|
|
894
|
+
item.media.coverImage.extraLarge ?? item.media.coverImage.large ?? item.media.coverImage.medium
|
|
895
|
+
),
|
|
896
|
+
description: item.media.description,
|
|
897
|
+
cover:
|
|
898
|
+
item.media.bannerImage ??
|
|
899
|
+
item.media.coverImage.extraLarge ??
|
|
900
|
+
item.media.coverImage.large ??
|
|
901
|
+
item.media.coverImage.medium,
|
|
902
|
+
coverHash: getHashFromImage(
|
|
903
|
+
item.media.bannerImage ??
|
|
904
|
+
item.media.coverImage.extraLarge ??
|
|
905
|
+
item.media.coverImage.large ??
|
|
906
|
+
item.media.coverImage.medium
|
|
907
|
+
),
|
|
908
|
+
genres: item.media.genres,
|
|
909
|
+
color: item.media.coverImage?.color,
|
|
910
|
+
rating: item.media.averageScore,
|
|
911
|
+
releaseDate: item.media.seasonYear,
|
|
912
|
+
type: item.media.format,
|
|
913
|
+
})),
|
|
914
|
+
};
|
|
915
|
+
return res;
|
|
916
|
+
} catch (err) {
|
|
917
|
+
throw new Error((err as Error).message);
|
|
918
|
+
}
|
|
919
|
+
};
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
*
|
|
923
|
+
* @param genres An array of genres to filter by (optional) genres: [`Action`, `Adventure`, `Cars`, `Comedy`, `Drama`, `Fantasy`, `Horror`, `Mahou Shoujo`, `Mecha`, `Music`, `Mystery`, `Psychological`, `Romance`, `Sci-Fi`, `Slice of Life`, `Sports`, `Supernatural`, `Thriller`]
|
|
924
|
+
* @param page page number (optional)
|
|
925
|
+
* @param perPage number of results per page (optional)
|
|
926
|
+
*/
|
|
927
|
+
fetchAnimeGenres = async (genres: string[] | Genres[], page: number = 1, perPage: number = 20) => {
|
|
928
|
+
if (genres.length === 0) throw new Error('No genres specified');
|
|
929
|
+
|
|
930
|
+
for (const genre of genres) if (!Object.values(Genres).includes(genre as Genres)) throw new Error('Invalid genre');
|
|
931
|
+
|
|
932
|
+
const options = {
|
|
933
|
+
headers: {
|
|
934
|
+
'Content-Type': 'application/json',
|
|
935
|
+
'Accept': 'application/json',
|
|
936
|
+
},
|
|
937
|
+
query: anilistGenresQuery(genres, page, perPage),
|
|
938
|
+
};
|
|
939
|
+
try {
|
|
940
|
+
const { data } = await axios.post(this.anilistGraphqlUrl, options);
|
|
941
|
+
|
|
942
|
+
const res: ISearch<IAnimeResult> = {
|
|
943
|
+
currentPage: data.data.Page.pageInfo.currentPage,
|
|
944
|
+
hasNextPage: data.data.Page.pageInfo.hasNextPage,
|
|
945
|
+
results: data.data.Page.media.map((item: any) => ({
|
|
946
|
+
id: item.id.toString(),
|
|
947
|
+
malId: item.idMal,
|
|
948
|
+
title: item.title
|
|
949
|
+
? {
|
|
950
|
+
romaji: item.title.romaji,
|
|
951
|
+
english: item.title.english,
|
|
952
|
+
native: item.title.native,
|
|
953
|
+
userPreferred: item.title.userPreferred,
|
|
954
|
+
}
|
|
955
|
+
: item.title.romaji,
|
|
956
|
+
image: item.coverImage.extraLarge ?? item.coverImage.large ?? item.coverImage.medium,
|
|
957
|
+
imageHash: getHashFromImage(item.coverImage.extraLarge ?? item.coverImage.large ?? item.coverImage.medium),
|
|
958
|
+
trailer: {
|
|
959
|
+
id: item.trailer?.id,
|
|
960
|
+
site: item.trailer?.site,
|
|
961
|
+
thumbnail: item.trailer?.thumbnail,
|
|
962
|
+
thumbnailHash: getHashFromImage(item.trailer?.thumbnail),
|
|
963
|
+
},
|
|
964
|
+
description: item.description,
|
|
965
|
+
cover: item.bannerImage ?? item.coverImage.extraLarge ?? item.coverImage.large ?? item.coverImage.medium,
|
|
966
|
+
coverHash: getHashFromImage(
|
|
967
|
+
item.bannerImage ?? item.coverImage.extraLarge ?? item.coverImage.large ?? item.coverImage.medium
|
|
968
|
+
),
|
|
969
|
+
rating: item.averageScore,
|
|
970
|
+
releaseDate: item.seasonYear,
|
|
971
|
+
color: item.coverImage?.color,
|
|
972
|
+
genres: item.genres,
|
|
973
|
+
totalEpisodes: isNaN(item.episodes)
|
|
974
|
+
? 0
|
|
975
|
+
: (item.episodes ?? (item.nextAiringEpisode?.episode ? item.nextAiringEpisode.episode - 1 : 0)),
|
|
976
|
+
duration: item.duration,
|
|
977
|
+
type: item.format,
|
|
978
|
+
})),
|
|
979
|
+
};
|
|
980
|
+
return res;
|
|
981
|
+
} catch (err) {
|
|
982
|
+
throw new Error((err as Error).message);
|
|
983
|
+
}
|
|
984
|
+
};
|
|
985
|
+
|
|
986
|
+
private findAnimeRaw = async (title: ITitle) => {
|
|
987
|
+
const searchTerm = title?.romaji || title?.english || title?.userPreferred || '';
|
|
988
|
+
const findAnime = (await this.provider.search(searchTerm)) as ISearch<IAnimeResult>;
|
|
989
|
+
|
|
990
|
+
if (!findAnime?.results) {
|
|
991
|
+
return {} as IAnimeEpisode[];
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
// Run similar title searches in parallel
|
|
995
|
+
const [mappedEng, mappedRom] = await Promise.all([
|
|
996
|
+
Promise.resolve(findSimilarTitles(title?.english || '', findAnime.results)),
|
|
997
|
+
Promise.resolve(findSimilarTitles(title?.romaji || '', findAnime.results)),
|
|
998
|
+
]);
|
|
999
|
+
|
|
1000
|
+
// Use Set for efficient deduplication
|
|
1001
|
+
const uniqueResults = Array.from(new Set([...mappedEng, ...mappedRom].map((item) => JSON.stringify(item)))).map(
|
|
1002
|
+
(str) => JSON.parse(str)
|
|
1003
|
+
);
|
|
1004
|
+
|
|
1005
|
+
// Sort by similarity score
|
|
1006
|
+
uniqueResults.sort((a, b) => (b.similarity || 0) - (a.similarity || 0));
|
|
1007
|
+
const mappings: any = {};
|
|
1008
|
+
for (const obj of uniqueResults) {
|
|
1009
|
+
const match = obj.title.replace(/\(TV\)/g, '').match(/\(([^)0-9]+)\)/);
|
|
1010
|
+
const key = match ? match[1].replace(/\s+/g, '-').toLowerCase() : 'sub';
|
|
1011
|
+
|
|
1012
|
+
if (!mappings[key]) {
|
|
1013
|
+
mappings[key] = obj.id;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
// Early return if we have both sub and dub
|
|
1017
|
+
if (mappings.sub && mappings.dub) break;
|
|
1018
|
+
}
|
|
1019
|
+
// console.log('mappings', mappings);
|
|
1020
|
+
// console.time('animeinfo');
|
|
1021
|
+
const animeInfo = await this.provider.fetchAnimeInfo(mappings.sub || mappings.dub);
|
|
1022
|
+
// console.timeEnd('animeinfo');
|
|
1023
|
+
return animeInfo.episodes as IAnimeEpisode[];
|
|
1024
|
+
};
|
|
1025
|
+
/**
|
|
1026
|
+
* @returns a random anime
|
|
1027
|
+
*/
|
|
1028
|
+
fetchRandomAnime = async (): Promise<IAnimeInfo> => {
|
|
1029
|
+
const options = {
|
|
1030
|
+
headers: {
|
|
1031
|
+
'Content-Type': 'application/json',
|
|
1032
|
+
'Accept': 'application/json',
|
|
1033
|
+
},
|
|
1034
|
+
query: anilistSiteStatisticsQuery(),
|
|
1035
|
+
};
|
|
1036
|
+
|
|
1037
|
+
try {
|
|
1038
|
+
// const {
|
|
1039
|
+
// data: { data },
|
|
1040
|
+
// } = await axios.post(this.anilistGraphqlUrl, options);
|
|
1041
|
+
|
|
1042
|
+
// const selectedAnime = Math.floor(
|
|
1043
|
+
// Math.random() * data.SiteStatistics.anime.nodes[data.SiteStatistics.anime.nodes.length - 1].count
|
|
1044
|
+
// );
|
|
1045
|
+
// const { results } = await this.advancedSearch(undefined, 'ANIME', Math.ceil(selectedAnime / 50), 50);
|
|
1046
|
+
|
|
1047
|
+
const { data: data } = await axios.get('https://raw.githubusercontent.com/5H4D0WILA/IDFetch/main/ids.txt');
|
|
1048
|
+
|
|
1049
|
+
const ids = data?.trim().split('\n');
|
|
1050
|
+
const selectedAnime = Math.floor(Math.random() * ids.length);
|
|
1051
|
+
return await this.fetchAnimeInfo(ids[selectedAnime]);
|
|
1052
|
+
} catch (err) {
|
|
1053
|
+
throw new Error((err as Error).message);
|
|
1054
|
+
}
|
|
1055
|
+
};
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* @param provider The provider to get the episode Ids from (optional) default: `gogoanime` (options: `gogoanime`, `zoro`)
|
|
1059
|
+
* @param page page number (optional)
|
|
1060
|
+
* @param perPage number of results per page (optional)
|
|
1061
|
+
*/
|
|
1062
|
+
fetchRecentEpisodes = async (
|
|
1063
|
+
provider: 'gogoanime' | 'zoro' = 'gogoanime',
|
|
1064
|
+
page: number = 1,
|
|
1065
|
+
perPage: number = 25
|
|
1066
|
+
): Promise<ISearch<IAnimeResult>> => {
|
|
1067
|
+
try {
|
|
1068
|
+
const { data } = await axios.get(`${this.anifyUrl}/recent?page=${page}&perPage=${perPage}&type=anime`);
|
|
1069
|
+
|
|
1070
|
+
const results: IAnimeInfo[] = data?.map((item: any) => {
|
|
1071
|
+
return {
|
|
1072
|
+
id: item.id.toString(),
|
|
1073
|
+
malId: item.mappings.find((item: any) => item.providerType === 'META' && item.providerId === 'mal')?.id,
|
|
1074
|
+
title: {
|
|
1075
|
+
romaji: item.title?.romaji,
|
|
1076
|
+
english: item.title?.english,
|
|
1077
|
+
native: item.title?.native,
|
|
1078
|
+
// userPreferred: (_f = item.title) === null || _f === void 0 ? void 0 : _f.userPreferred,
|
|
1079
|
+
},
|
|
1080
|
+
image: item.coverImage ?? item.bannerImage,
|
|
1081
|
+
imageHash: getHashFromImage(item.coverImage ?? item.bannerImage),
|
|
1082
|
+
rating: item.averageScore,
|
|
1083
|
+
color: item.anime?.color,
|
|
1084
|
+
episodeId: `${
|
|
1085
|
+
provider === 'gogoanime'
|
|
1086
|
+
? item.episodes.data
|
|
1087
|
+
.find((source: any) => source.providerId.toLowerCase() === 'gogoanime')
|
|
1088
|
+
?.episodes.pop()?.id
|
|
1089
|
+
: item.episodes.data.find((source: any) => source.providerId.toLowerCase() === 'zoro')?.episodes.pop()?.id
|
|
1090
|
+
}`,
|
|
1091
|
+
episodeTitle: item.episodes.latest.latestTitle ?? `Episode ${item.currentEpisode}`,
|
|
1092
|
+
episodeNumber: item.currentEpisode,
|
|
1093
|
+
genres: item.genre,
|
|
1094
|
+
type: item.format,
|
|
1095
|
+
};
|
|
1096
|
+
});
|
|
1097
|
+
// results = results.filter((item) => item.episodeNumber !== 0 &&
|
|
1098
|
+
// item.episodeId.replace('-enime', '').length > 0 &&
|
|
1099
|
+
// item.episodeId.replace('-enime', '') !== 'undefined');
|
|
1100
|
+
return {
|
|
1101
|
+
currentPage: page,
|
|
1102
|
+
// hasNextPage: meta.lastPage !== page,
|
|
1103
|
+
// totalPages: meta.lastPage,
|
|
1104
|
+
totalResults: results?.length,
|
|
1105
|
+
results: results,
|
|
1106
|
+
};
|
|
1107
|
+
} catch (err) {
|
|
1108
|
+
throw new Error((err as Error).message);
|
|
1109
|
+
}
|
|
1110
|
+
};
|
|
1111
|
+
|
|
1112
|
+
private fetchDefaultEpisodeList = async (Media: {
|
|
1113
|
+
idMal: number;
|
|
1114
|
+
title: { english: string; romaji: string };
|
|
1115
|
+
season: string;
|
|
1116
|
+
startDate: { year: number };
|
|
1117
|
+
externalLinks?: any;
|
|
1118
|
+
}) => {
|
|
1119
|
+
let episodes: IAnimeEpisode[] = [];
|
|
1120
|
+
|
|
1121
|
+
episodes = await this.findAnimeRaw({ english: Media.title?.english!, romaji: Media.title?.romaji! });
|
|
1122
|
+
// console.log('fetchDefaultEpisodeList', episodes);
|
|
1123
|
+
return episodes;
|
|
1124
|
+
};
|
|
1125
|
+
|
|
1126
|
+
/**
|
|
1127
|
+
* @param id anilist id
|
|
1128
|
+
* @param fetchFiller to get filler boolean on the episode object (optional) set to `true` to get filler boolean on the episode object.
|
|
1129
|
+
* @returns episode list **(without anime info)**
|
|
1130
|
+
*/
|
|
1131
|
+
fetchEpisodesListById = async (id: string, fetchFiller: boolean = false) => {
|
|
1132
|
+
const options = {
|
|
1133
|
+
headers: {
|
|
1134
|
+
'Content-Type': 'application/json',
|
|
1135
|
+
'Accept': 'application/json',
|
|
1136
|
+
},
|
|
1137
|
+
query: `query($id: Int = ${id}){ Media(id: $id){ idMal externalLinks { site url } title { romaji english } status season episodes startDate { year month day } endDate { year month day } coverImage {extraLarge large medium} } }`,
|
|
1138
|
+
};
|
|
1139
|
+
|
|
1140
|
+
const {
|
|
1141
|
+
data: {
|
|
1142
|
+
data: { Media },
|
|
1143
|
+
},
|
|
1144
|
+
} = await axios.post(this.anilistGraphqlUrl, options);
|
|
1145
|
+
|
|
1146
|
+
let possibleAnimeEpisodes: IAnimeEpisode[] = [];
|
|
1147
|
+
let fillerEpisodes: { 'number': string; 'filler-bool': boolean }[] = [];
|
|
1148
|
+
if (this.provider instanceof Zoro || this.provider instanceof AnimeKai || this.provider instanceof AnimePahe) {
|
|
1149
|
+
try {
|
|
1150
|
+
// console.time('fetchEpisodesListById');
|
|
1151
|
+
const [animeMetaData, providerEpisodes] = await Promise.all([
|
|
1152
|
+
axios.get(`https://api.ani.zip/mappings?anilist_id=${id}`).then((res) => res.data),
|
|
1153
|
+
this.fetchDefaultEpisodeList(Media),
|
|
1154
|
+
]);
|
|
1155
|
+
// console.timeEnd('fetchEpisodesListById');
|
|
1156
|
+
//to get the actual episode ids we make use of fetchDefaultEpisodeList
|
|
1157
|
+
const normalizedEpisodes = (
|
|
1158
|
+
Object.entries(animeMetaData.episodes || {}) as [string, AniZipEpisode & IAnimeEpisode][]
|
|
1159
|
+
).map(([key, item]) => ({
|
|
1160
|
+
title: item.title.en ?? item.title['x-jat'],
|
|
1161
|
+
uniqueId: `${id}$ep=${item.episodeNumber ?? item.episode}`,
|
|
1162
|
+
description: item.overview ?? item.summary,
|
|
1163
|
+
number: item.episodeNumber ?? parseInt(item.episode),
|
|
1164
|
+
image: item.image,
|
|
1165
|
+
imageHash: getHashFromImage(item.image),
|
|
1166
|
+
releaseDate: item.airDate ?? item.airdate ?? item.airDateUtc,
|
|
1167
|
+
}));
|
|
1168
|
+
|
|
1169
|
+
function mergeEpisodes(normalizedEpisodes: any[], providerEpisodes: IAnimeEpisode[]): IAnimeEpisode[] {
|
|
1170
|
+
const numberMap = new Map<number, any>();
|
|
1171
|
+
const dateMap = new Map<number, any>();
|
|
1172
|
+
const usedNormalized = new Set<string>();
|
|
1173
|
+
|
|
1174
|
+
normalizedEpisodes.forEach((ep) => {
|
|
1175
|
+
if (ep.number) numberMap.set(ep.number, ep);
|
|
1176
|
+
if (ep.releaseDate) {
|
|
1177
|
+
const ts = new Date(ep.releaseDate).getTime();
|
|
1178
|
+
dateMap.set(ts, ep);
|
|
1179
|
+
}
|
|
1180
|
+
});
|
|
1181
|
+
|
|
1182
|
+
return providerEpisodes.map((providerEp, index) => {
|
|
1183
|
+
let normalizedEp: any = null;
|
|
1184
|
+
|
|
1185
|
+
const matchIfNotUsed = (ep: any) => ep && !usedNormalized.has(ep.uniqueId);
|
|
1186
|
+
|
|
1187
|
+
// Match by release date (within ±1 day)
|
|
1188
|
+
if (providerEp.releaseDate) {
|
|
1189
|
+
const ts = new Date(providerEp.releaseDate).getTime();
|
|
1190
|
+
for (let [normTs, normEp] of dateMap) {
|
|
1191
|
+
if (Math.abs(ts - normTs) <= 86400000 && matchIfNotUsed(normEp)) {
|
|
1192
|
+
normalizedEp = normEp;
|
|
1193
|
+
break;
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
// Match by episode number
|
|
1199
|
+
if (!normalizedEp && providerEp.number != null) {
|
|
1200
|
+
const ep = numberMap.get(providerEp.number);
|
|
1201
|
+
if (matchIfNotUsed(ep)) normalizedEp = ep;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
// Match by title similarity
|
|
1205
|
+
if (!normalizedEp && providerEp.title) {
|
|
1206
|
+
normalizedEp = normalizedEpisodes.find(
|
|
1207
|
+
(normEp) => matchIfNotUsed(normEp) && normEp.title?.includes(providerEp.title)
|
|
1208
|
+
);
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
// Fallback to same index
|
|
1212
|
+
if (!normalizedEp && matchIfNotUsed(normalizedEpisodes[index])) {
|
|
1213
|
+
normalizedEp = normalizedEpisodes[index];
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
// Mark this normalized episode as used
|
|
1217
|
+
if (normalizedEp) {
|
|
1218
|
+
usedNormalized.add(normalizedEp.uniqueId);
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
if (!normalizedEp) return providerEp;
|
|
1222
|
+
|
|
1223
|
+
return {
|
|
1224
|
+
...providerEp,
|
|
1225
|
+
number: normalizedEp.number || providerEp.number,
|
|
1226
|
+
uniqueId: normalizedEp.uniqueId || providerEp.uniqueId,
|
|
1227
|
+
title: normalizedEp.title || providerEp.title,
|
|
1228
|
+
description: normalizedEp.description || providerEp.description,
|
|
1229
|
+
image: normalizedEp.image || providerEp.image,
|
|
1230
|
+
imageHash: normalizedEp.imageHash || providerEp.imageHash,
|
|
1231
|
+
releaseDate: normalizedEp.releaseDate || providerEp.releaseDate,
|
|
1232
|
+
};
|
|
1233
|
+
});
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
// console.log({
|
|
1237
|
+
// normalizedEpisodes,
|
|
1238
|
+
// providerEpisodes,
|
|
1239
|
+
// merged: mergeEpisodes(normalizedEpisodes, providerEpisodes),
|
|
1240
|
+
// });
|
|
1241
|
+
possibleAnimeEpisodes = mergeEpisodes(normalizedEpisodes, providerEpisodes);
|
|
1242
|
+
if (!possibleAnimeEpisodes.length) {
|
|
1243
|
+
possibleAnimeEpisodes = await this.fetchDefaultEpisodeList(Media);
|
|
1244
|
+
possibleAnimeEpisodes = possibleAnimeEpisodes?.map((episode: IAnimeEpisode) => {
|
|
1245
|
+
if (!episode.image) {
|
|
1246
|
+
episode.image = Media.coverImage.extraLarge ?? Media.coverImage.large ?? Media.coverImage.medium;
|
|
1247
|
+
episode.imageHash = getHashFromImage(
|
|
1248
|
+
Media.coverImage.extraLarge ?? Media.coverImage.large ?? Media.coverImage.medium
|
|
1249
|
+
);
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
return episode;
|
|
1253
|
+
});
|
|
1254
|
+
}
|
|
1255
|
+
} catch (err) {
|
|
1256
|
+
possibleAnimeEpisodes = await this.fetchDefaultEpisodeList(Media);
|
|
1257
|
+
|
|
1258
|
+
possibleAnimeEpisodes = possibleAnimeEpisodes?.map((episode: IAnimeEpisode) => {
|
|
1259
|
+
if (!episode.image) {
|
|
1260
|
+
episode.image = Media.coverImage.extraLarge ?? Media.coverImage.large ?? Media.coverImage.medium;
|
|
1261
|
+
episode.imageHash = getHashFromImage(
|
|
1262
|
+
Media.coverImage.extraLarge ?? Media.coverImage.large ?? Media.coverImage.medium
|
|
1263
|
+
);
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
return episode;
|
|
1267
|
+
});
|
|
1268
|
+
return possibleAnimeEpisodes;
|
|
1269
|
+
}
|
|
1270
|
+
} else possibleAnimeEpisodes = await this.fetchDefaultEpisodeList(Media);
|
|
1271
|
+
|
|
1272
|
+
if (fetchFiller) {
|
|
1273
|
+
const { data: fillerData } = await axios.get(
|
|
1274
|
+
`https://raw.githubusercontent.com/saikou-app/mal-id-filler-list/main/fillers/${Media.idMal}.json`,
|
|
1275
|
+
{
|
|
1276
|
+
validateStatus: () => true,
|
|
1277
|
+
}
|
|
1278
|
+
);
|
|
1279
|
+
|
|
1280
|
+
if (!fillerData.toString().startsWith('404')) {
|
|
1281
|
+
fillerEpisodes = [];
|
|
1282
|
+
fillerEpisodes?.push(
|
|
1283
|
+
...(fillerData.episodes as {
|
|
1284
|
+
'number': string;
|
|
1285
|
+
'filler-bool': boolean;
|
|
1286
|
+
}[])
|
|
1287
|
+
);
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
possibleAnimeEpisodes = possibleAnimeEpisodes?.map((episode: IAnimeEpisode) => {
|
|
1292
|
+
if (!episode.image) {
|
|
1293
|
+
episode.image = Media.coverImage.extraLarge ?? Media.coverImage.large ?? Media.coverImage.medium;
|
|
1294
|
+
episode.imageHash = getHashFromImage(
|
|
1295
|
+
Media.coverImage.extraLarge ?? Media.coverImage.large ?? Media.coverImage.medium
|
|
1296
|
+
);
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
if (fetchFiller && fillerEpisodes?.length > 0 && fillerEpisodes?.length >= Media.episodes) {
|
|
1300
|
+
if (fillerEpisodes[episode.number! - 1])
|
|
1301
|
+
episode.isFiller = new Boolean(fillerEpisodes[episode.number! - 1]!['filler-bool']).valueOf();
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
return episode;
|
|
1305
|
+
});
|
|
1306
|
+
|
|
1307
|
+
return possibleAnimeEpisodes;
|
|
1308
|
+
};
|
|
1309
|
+
|
|
1310
|
+
/**
|
|
1311
|
+
* @param id anilist id
|
|
1312
|
+
* @returns anilist data for the anime **(without episodes)** (use `fetchEpisodesListById` to get the episodes) (use `fetchAnimeInfo` to get both)
|
|
1313
|
+
*/
|
|
1314
|
+
fetchAnilistInfoById = async (id: string) => {
|
|
1315
|
+
const animeInfo: IAnimeInfo = {
|
|
1316
|
+
id: id,
|
|
1317
|
+
title: '',
|
|
1318
|
+
};
|
|
1319
|
+
|
|
1320
|
+
const options = {
|
|
1321
|
+
headers: {
|
|
1322
|
+
'Content-Type': 'application/json',
|
|
1323
|
+
'Accept': 'application/json',
|
|
1324
|
+
},
|
|
1325
|
+
query: anilistMediaDetailQuery(id),
|
|
1326
|
+
};
|
|
1327
|
+
|
|
1328
|
+
try {
|
|
1329
|
+
const { data } = await axios.post(this.anilistGraphqlUrl, options).catch(() => {
|
|
1330
|
+
throw new Error('Media not found');
|
|
1331
|
+
});
|
|
1332
|
+
animeInfo.malId = data.data.Media.idMal;
|
|
1333
|
+
animeInfo.title = {
|
|
1334
|
+
romaji: data.data.Media.title.romaji,
|
|
1335
|
+
english: data.data.Media.title.english,
|
|
1336
|
+
native: data.data.Media.title.native,
|
|
1337
|
+
userPreferred: data.data.Media.title.userPreferred,
|
|
1338
|
+
};
|
|
1339
|
+
|
|
1340
|
+
if (data.data.Media.trailer?.id) {
|
|
1341
|
+
animeInfo.trailer = {
|
|
1342
|
+
id: data.data.Media.trailer?.id,
|
|
1343
|
+
site: data.data.Media.trailer?.site,
|
|
1344
|
+
thumbnail: data.data.Media.trailer?.thumbnail,
|
|
1345
|
+
thumbnailHash: getHashFromImage(data.data.Media.trailer?.thumbnail),
|
|
1346
|
+
};
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
animeInfo.synonyms = data.data.Media.synonyms;
|
|
1350
|
+
animeInfo.isLicensed = data.data.Media.isLicensed;
|
|
1351
|
+
animeInfo.isAdult = data.data.Media.isAdult;
|
|
1352
|
+
animeInfo.countryOfOrigin = data.data.Media.countryOfOrigin;
|
|
1353
|
+
|
|
1354
|
+
animeInfo.image =
|
|
1355
|
+
data.data.Media.coverImage.extraLarge ?? data.data.Media.coverImage.large ?? data.data.Media.coverImage.medium;
|
|
1356
|
+
|
|
1357
|
+
animeInfo.imageHash = getHashFromImage(
|
|
1358
|
+
data.data.Media.coverImage.extraLarge ?? data.data.Media.coverImage.large ?? data.data.Media.coverImage.medium
|
|
1359
|
+
);
|
|
1360
|
+
animeInfo.cover = data.data.Media.bannerImage ?? animeInfo.image;
|
|
1361
|
+
animeInfo.coverHash = getHashFromImage(data.data.Media.bannerImage ?? animeInfo.image);
|
|
1362
|
+
animeInfo.description = data.data.Media.description;
|
|
1363
|
+
switch (data.data.Media.status) {
|
|
1364
|
+
case 'RELEASING':
|
|
1365
|
+
animeInfo.status = MediaStatus.ONGOING;
|
|
1366
|
+
break;
|
|
1367
|
+
case 'FINISHED':
|
|
1368
|
+
animeInfo.status = MediaStatus.COMPLETED;
|
|
1369
|
+
break;
|
|
1370
|
+
case 'NOT_YET_RELEASED':
|
|
1371
|
+
animeInfo.status = MediaStatus.NOT_YET_AIRED;
|
|
1372
|
+
break;
|
|
1373
|
+
case 'CANCELLED':
|
|
1374
|
+
animeInfo.status = MediaStatus.CANCELLED;
|
|
1375
|
+
break;
|
|
1376
|
+
case 'HIATUS':
|
|
1377
|
+
animeInfo.status = MediaStatus.HIATUS;
|
|
1378
|
+
break;
|
|
1379
|
+
default:
|
|
1380
|
+
animeInfo.status = MediaStatus.UNKNOWN;
|
|
1381
|
+
}
|
|
1382
|
+
animeInfo.releaseDate = data.data.Media.startDate.year;
|
|
1383
|
+
if (data.data.Media.nextAiringEpisode?.airingAt)
|
|
1384
|
+
animeInfo.nextAiringEpisode = {
|
|
1385
|
+
airingTime: data.data.Media.nextAiringEpisode?.airingAt,
|
|
1386
|
+
timeUntilAiring: data.data.Media.nextAiringEpisode?.timeUntilAiring,
|
|
1387
|
+
episode: data.data.Media.nextAiringEpisode?.episode,
|
|
1388
|
+
};
|
|
1389
|
+
|
|
1390
|
+
animeInfo.totalEpisodes = data.data.Media?.episodes ?? data.data.Media.nextAiringEpisode?.episode - 1;
|
|
1391
|
+
animeInfo.currentEpisode = data.data.Media?.nextAiringEpisode?.episode
|
|
1392
|
+
? data.data.Media.nextAiringEpisode?.episode - 1
|
|
1393
|
+
: data.data.Media?.episodes || undefined;
|
|
1394
|
+
animeInfo.rating = data.data.Media.averageScore;
|
|
1395
|
+
animeInfo.duration = data.data.Media.duration;
|
|
1396
|
+
animeInfo.genres = data.data.Media.genres;
|
|
1397
|
+
animeInfo.studios = data.data.Media.studios.edges.map((item: any) => item.node.name);
|
|
1398
|
+
animeInfo.season = data.data.Media.season;
|
|
1399
|
+
animeInfo.popularity = data.data.Media.popularity;
|
|
1400
|
+
animeInfo.type = data.data.Media.format;
|
|
1401
|
+
animeInfo.startDate = {
|
|
1402
|
+
year: data.data.Media.startDate?.year,
|
|
1403
|
+
month: data.data.Media.startDate?.month,
|
|
1404
|
+
day: data.data.Media.startDate?.day,
|
|
1405
|
+
};
|
|
1406
|
+
animeInfo.endDate = {
|
|
1407
|
+
year: data.data.Media.endDate?.year,
|
|
1408
|
+
month: data.data.Media.endDate?.month,
|
|
1409
|
+
day: data.data.Media.endDate?.day,
|
|
1410
|
+
};
|
|
1411
|
+
animeInfo.recommendations = data.data.Media.recommendations.edges.map((item: any) => ({
|
|
1412
|
+
id: item.node.mediaRecommendation.id,
|
|
1413
|
+
malId: item.node.mediaRecommendation.idMal,
|
|
1414
|
+
title: {
|
|
1415
|
+
romaji: item.node.mediaRecommendation.title.romaji,
|
|
1416
|
+
english: item.node.mediaRecommendation.title.english,
|
|
1417
|
+
native: item.node.mediaRecommendation.title.native,
|
|
1418
|
+
userPreferred: item.node.mediaRecommendation.title.userPreferred,
|
|
1419
|
+
},
|
|
1420
|
+
status:
|
|
1421
|
+
item.node.mediaRecommendation.status === 'RELEASING'
|
|
1422
|
+
? MediaStatus.ONGOING
|
|
1423
|
+
: item.node.mediaRecommendation.status === 'FINISHED'
|
|
1424
|
+
? MediaStatus.COMPLETED
|
|
1425
|
+
: item.node.mediaRecommendation.status === 'NOT_YET_RELEASED'
|
|
1426
|
+
? MediaStatus.NOT_YET_AIRED
|
|
1427
|
+
: item.node.mediaRecommendation.status === 'CANCELLED'
|
|
1428
|
+
? MediaStatus.CANCELLED
|
|
1429
|
+
: item.node.mediaRecommendation.status === 'HIATUS'
|
|
1430
|
+
? MediaStatus.HIATUS
|
|
1431
|
+
: MediaStatus.UNKNOWN,
|
|
1432
|
+
episodes: item.node.mediaRecommendation.episodes,
|
|
1433
|
+
image:
|
|
1434
|
+
item.node.mediaRecommendation.coverImage.extraLarge ??
|
|
1435
|
+
item.node.mediaRecommendation.coverImage.large ??
|
|
1436
|
+
item.node.mediaRecommendation.coverImage.medium,
|
|
1437
|
+
imageHash: getHashFromImage(
|
|
1438
|
+
item.node.mediaRecommendation.coverImage.extraLarge ??
|
|
1439
|
+
item.node.mediaRecommendation.coverImage.large ??
|
|
1440
|
+
item.node.mediaRecommendation.coverImage.medium
|
|
1441
|
+
),
|
|
1442
|
+
cover:
|
|
1443
|
+
item.node.mediaRecommendation.bannerImage ??
|
|
1444
|
+
item.node.mediaRecommendation.coverImage.extraLarge ??
|
|
1445
|
+
item.node.mediaRecommendation.coverImage.large ??
|
|
1446
|
+
item.node.mediaRecommendation.coverImage.medium,
|
|
1447
|
+
coverHash:
|
|
1448
|
+
item.node.mediaRecommendation.bannerImage ??
|
|
1449
|
+
item.node.mediaRecommendation.coverImage.extraLarge ??
|
|
1450
|
+
item.node.mediaRecommendation.coverImage.large ??
|
|
1451
|
+
item.node.mediaRecommendation.coverImage.medium,
|
|
1452
|
+
rating: item.node.mediaRecommendation.meanScore,
|
|
1453
|
+
type: item.node.mediaRecommendation.format,
|
|
1454
|
+
}));
|
|
1455
|
+
|
|
1456
|
+
animeInfo.characters = data.data.Media.characters.edges.map((item: any) => ({
|
|
1457
|
+
id: item.node.id,
|
|
1458
|
+
role: item.role,
|
|
1459
|
+
name: {
|
|
1460
|
+
first: item.node.name.first,
|
|
1461
|
+
last: item.node.name.last,
|
|
1462
|
+
full: item.node.name.full,
|
|
1463
|
+
native: item.node.name.native,
|
|
1464
|
+
userPreferred: item.node.name.userPreferred,
|
|
1465
|
+
},
|
|
1466
|
+
image: item.node.image.large ?? item.node.image.medium,
|
|
1467
|
+
imageHash: getHashFromImage(item.node.image.large ?? item.node.image.medium),
|
|
1468
|
+
voiceActors: item.voiceActors.map((voiceActor: any) => ({
|
|
1469
|
+
id: voiceActor.id,
|
|
1470
|
+
language: voiceActor.languageV2,
|
|
1471
|
+
name: {
|
|
1472
|
+
first: voiceActor.name.first,
|
|
1473
|
+
last: voiceActor.name.last,
|
|
1474
|
+
full: voiceActor.name.full,
|
|
1475
|
+
native: voiceActor.name.native,
|
|
1476
|
+
userPreferred: voiceActor.name.userPreferred,
|
|
1477
|
+
},
|
|
1478
|
+
image: voiceActor.image.large ?? voiceActor.image.medium,
|
|
1479
|
+
imageHash: getHashFromImage(voiceActor.image.large ?? voiceActor.image.medium),
|
|
1480
|
+
})),
|
|
1481
|
+
}));
|
|
1482
|
+
animeInfo.color = data.data.Media.coverImage?.color;
|
|
1483
|
+
animeInfo.relations = data.data.Media.relations.edges.map((item: any) => ({
|
|
1484
|
+
id: item.node.id,
|
|
1485
|
+
malId: item.node.idMal,
|
|
1486
|
+
relationType: item.relationType,
|
|
1487
|
+
title: {
|
|
1488
|
+
romaji: item.node.title.romaji,
|
|
1489
|
+
english: item.node.title.english,
|
|
1490
|
+
native: item.node.title.native,
|
|
1491
|
+
userPreferred: item.node.title.userPreferred,
|
|
1492
|
+
},
|
|
1493
|
+
status:
|
|
1494
|
+
item.node.status === 'RELEASING'
|
|
1495
|
+
? MediaStatus.ONGOING
|
|
1496
|
+
: item.node.status === 'FINISHED'
|
|
1497
|
+
? MediaStatus.COMPLETED
|
|
1498
|
+
: item.node.status === 'NOT_YET_RELEASED'
|
|
1499
|
+
? MediaStatus.NOT_YET_AIRED
|
|
1500
|
+
: item.node.status === 'CANCELLED'
|
|
1501
|
+
? MediaStatus.CANCELLED
|
|
1502
|
+
: item.node.status === 'HIATUS'
|
|
1503
|
+
? MediaStatus.HIATUS
|
|
1504
|
+
: MediaStatus.UNKNOWN,
|
|
1505
|
+
episodes: item.node.episodes,
|
|
1506
|
+
|
|
1507
|
+
image: item.node.coverImage.extraLarge ?? item.node.coverImage.large ?? item.node.coverImage.medium,
|
|
1508
|
+
imageHash: getHashFromImage(
|
|
1509
|
+
item.node.coverImage.extraLarge ?? item.node.coverImage.large ?? item.node.coverImage.medium
|
|
1510
|
+
),
|
|
1511
|
+
cover:
|
|
1512
|
+
item.node.bannerImage ??
|
|
1513
|
+
item.node.coverImage.extraLarge ??
|
|
1514
|
+
item.node.coverImage.large ??
|
|
1515
|
+
item.node.coverImage.medium,
|
|
1516
|
+
coverHash: getHashFromImage(
|
|
1517
|
+
item.node.bannerImage ??
|
|
1518
|
+
item.node.coverImage.extraLarge ??
|
|
1519
|
+
item.node.coverImage.large ??
|
|
1520
|
+
item.node.coverImage.medium
|
|
1521
|
+
),
|
|
1522
|
+
rating: item.node.meanScore,
|
|
1523
|
+
type: item.node.format,
|
|
1524
|
+
}));
|
|
1525
|
+
|
|
1526
|
+
return animeInfo;
|
|
1527
|
+
} catch (err) {
|
|
1528
|
+
throw new Error((err as Error).message);
|
|
1529
|
+
}
|
|
1530
|
+
};
|
|
1531
|
+
|
|
1532
|
+
/**
|
|
1533
|
+
* To get Staff details by anilistId
|
|
1534
|
+
* @param id staff id from anilist
|
|
1535
|
+
*
|
|
1536
|
+
*/
|
|
1537
|
+
fetchStaffById = async (id: number) => {
|
|
1538
|
+
const staffInfo: IStaff = {
|
|
1539
|
+
id: String(id),
|
|
1540
|
+
name: { first: '', last: '', native: '', full: '' },
|
|
1541
|
+
};
|
|
1542
|
+
|
|
1543
|
+
const options = {
|
|
1544
|
+
headers: {
|
|
1545
|
+
'Content-Type': 'application/json',
|
|
1546
|
+
'Accept': 'application/json',
|
|
1547
|
+
},
|
|
1548
|
+
query: anilistStaffInfoQuery(id),
|
|
1549
|
+
};
|
|
1550
|
+
|
|
1551
|
+
try {
|
|
1552
|
+
const { data } = await axios.post(this.anilistGraphqlUrl, options).catch((err) => {
|
|
1553
|
+
throw new Error((err as Error).message);
|
|
1554
|
+
});
|
|
1555
|
+
const staff = data.data.Staff;
|
|
1556
|
+
|
|
1557
|
+
staffInfo.id = staff?.id;
|
|
1558
|
+
staffInfo.name = staff?.name;
|
|
1559
|
+
staffInfo.image = staff?.image;
|
|
1560
|
+
staffInfo.description = staff?.description;
|
|
1561
|
+
staffInfo.siteUrl = staff?.siteUrl;
|
|
1562
|
+
|
|
1563
|
+
staffInfo.roles = staff?.staffMedia.edges.map((media: any) => ({
|
|
1564
|
+
id: media?.node?.id,
|
|
1565
|
+
title: media?.node?.title,
|
|
1566
|
+
type: media?.node?.type,
|
|
1567
|
+
image: {
|
|
1568
|
+
extraLarge: media?.node?.coverImage?.extraLarge,
|
|
1569
|
+
large: media?.node?.coverImage?.large,
|
|
1570
|
+
medium: media?.node?.coverImage?.medium,
|
|
1571
|
+
},
|
|
1572
|
+
color: media?.node?.coverImage?.color,
|
|
1573
|
+
}));
|
|
1574
|
+
|
|
1575
|
+
return staffInfo;
|
|
1576
|
+
} catch (err) {
|
|
1577
|
+
throw new Error((err as Error).message);
|
|
1578
|
+
}
|
|
1579
|
+
};
|
|
1580
|
+
|
|
1581
|
+
/**
|
|
1582
|
+
*
|
|
1583
|
+
* @param id character id from anilist
|
|
1584
|
+
*/
|
|
1585
|
+
fetchCharacterInfoById = async (id: string) => {
|
|
1586
|
+
const options = {
|
|
1587
|
+
headers: {
|
|
1588
|
+
'Content-Type': 'application/json',
|
|
1589
|
+
'Accept': 'application/json',
|
|
1590
|
+
},
|
|
1591
|
+
query: anilistCharacterQuery(),
|
|
1592
|
+
variables: {
|
|
1593
|
+
id: id,
|
|
1594
|
+
},
|
|
1595
|
+
};
|
|
1596
|
+
|
|
1597
|
+
try {
|
|
1598
|
+
const {
|
|
1599
|
+
data: {
|
|
1600
|
+
data: { Character },
|
|
1601
|
+
},
|
|
1602
|
+
} = await axios.post(this.anilistGraphqlUrl, options);
|
|
1603
|
+
|
|
1604
|
+
const height = Character.description.match(/__Height:__(.*)/)?.[1].trim();
|
|
1605
|
+
const weight = Character.description.match(/__Weight:__(.*)/)?.[1].trim();
|
|
1606
|
+
const hairColor = Character.description.match(/__Hair Color:__(.*)/)?.[1].trim();
|
|
1607
|
+
const eyeColor = Character.description.match(/__Eye Color:__(.*)/)?.[1].trim();
|
|
1608
|
+
const relatives = Character.description
|
|
1609
|
+
.match(/__Relatives:__(.*)/)?.[1]
|
|
1610
|
+
.trim()
|
|
1611
|
+
.split(/(, \[)/g)
|
|
1612
|
+
.filter((g: string) => !g.includes(', ['))
|
|
1613
|
+
.map((r: string) => ({
|
|
1614
|
+
id: r.match(/\/(\d+)/)?.[1],
|
|
1615
|
+
name: r.match(/([^)]+)\]/)?.[1]!.replace(/\[/g, ''),
|
|
1616
|
+
relationship: r.match(/\(([^)]+)\).*?(\(([^)]+)\))/)?.[3],
|
|
1617
|
+
}));
|
|
1618
|
+
const race = Character.description
|
|
1619
|
+
.match(/__Race:__(.*)/)?.[1]
|
|
1620
|
+
.split(', ')
|
|
1621
|
+
.map((r: string) => r.trim());
|
|
1622
|
+
const rank = Character.description.match(/__Rank:__(.*)/)?.[1];
|
|
1623
|
+
const occupation = Character.description.match(/__Occupation:__(.*)/)?.[1];
|
|
1624
|
+
const previousPosition = Character.description.match(/__Previous Position:__(.*)/)?.[1]?.trim();
|
|
1625
|
+
const partner = Character.description
|
|
1626
|
+
.match(/__Partner:__(.*)/)?.[1]
|
|
1627
|
+
.split(/(, \[)/g)
|
|
1628
|
+
.filter((g: string) => !g.includes(', ['))
|
|
1629
|
+
.map((r: string) => ({
|
|
1630
|
+
id: r.match(/\/(\d+)/)?.[1],
|
|
1631
|
+
name: r.match(/([^)]+)\]/)?.[1]!.replace(/\[/g, ''),
|
|
1632
|
+
}));
|
|
1633
|
+
const dislikes = Character.description.match(/__Dislikes:__(.*)/)?.[1];
|
|
1634
|
+
const sign = Character.description.match(/__Sign:__(.*)/)?.[1];
|
|
1635
|
+
const zodicSign = Character.description.match(/__Zodiac sign:__(.*)/)?.[1]?.trim();
|
|
1636
|
+
const zodicAnimal = Character.description.match(/__Zodiac Animal:__(.*)/)?.[1]?.trim();
|
|
1637
|
+
const themeSong = Character.description.match(/__Theme Song:__(.*)/)?.[1]?.trim();
|
|
1638
|
+
Character.description = Character.description.replace(
|
|
1639
|
+
/__Theme Song:__(.*)\n|__Race:__(.*)\n|__Height:__(.*)\n|__Relatives:__(.*)\n|__Rank:__(.*)\n|__Zodiac sign:__(.*)\n|__Zodiac Animal:__(.*)\n|__Weight:__(.*)\n|__Eye Color:__(.*)\n|__Hair Color:__(.*)\n|__Dislikes:__(.*)\n|__Sign:__(.*)\n|__Partner:__(.*)\n|__Previous Position:__(.*)\n|__Occupation:__(.*)\n/gm,
|
|
1640
|
+
''
|
|
1641
|
+
);
|
|
1642
|
+
|
|
1643
|
+
const characterInfo = {
|
|
1644
|
+
id: Character.id,
|
|
1645
|
+
name: {
|
|
1646
|
+
first: Character.name?.first,
|
|
1647
|
+
last: Character.name?.last,
|
|
1648
|
+
full: Character.name?.full,
|
|
1649
|
+
native: Character.name?.native,
|
|
1650
|
+
userPreferred: Character.name?.userPreferred,
|
|
1651
|
+
alternative: Character.name?.alternative,
|
|
1652
|
+
alternativeSpoiler: Character.name?.alternativeSpoiler,
|
|
1653
|
+
},
|
|
1654
|
+
image: Character.image?.large ?? Character.image?.medium,
|
|
1655
|
+
imageHash: getHashFromImage(Character.image?.large ?? Character.image?.medium),
|
|
1656
|
+
description: Character.description,
|
|
1657
|
+
gender: Character.gender,
|
|
1658
|
+
dateOfBirth: {
|
|
1659
|
+
year: Character.dateOfBirth?.year,
|
|
1660
|
+
month: Character.dateOfBirth?.month,
|
|
1661
|
+
day: Character.dateOfBirth?.day,
|
|
1662
|
+
},
|
|
1663
|
+
bloodType: Character.bloodType,
|
|
1664
|
+
age: Character.age,
|
|
1665
|
+
hairColor: hairColor,
|
|
1666
|
+
eyeColor: eyeColor,
|
|
1667
|
+
height: height,
|
|
1668
|
+
weight: weight,
|
|
1669
|
+
occupation: occupation,
|
|
1670
|
+
partner: partner,
|
|
1671
|
+
relatives: relatives,
|
|
1672
|
+
race: race,
|
|
1673
|
+
rank: rank,
|
|
1674
|
+
previousPosition: previousPosition,
|
|
1675
|
+
dislikes: dislikes,
|
|
1676
|
+
sign: sign,
|
|
1677
|
+
zodicSign: zodicSign,
|
|
1678
|
+
zodicAnimal: zodicAnimal,
|
|
1679
|
+
themeSong: themeSong,
|
|
1680
|
+
relations: Character.media.edges?.map((v: any) => ({
|
|
1681
|
+
id: v.node.id,
|
|
1682
|
+
malId: v.node.idMal,
|
|
1683
|
+
role: v.characterRole,
|
|
1684
|
+
title: {
|
|
1685
|
+
romaji: v.node.title?.romaji,
|
|
1686
|
+
english: v.node.title?.english,
|
|
1687
|
+
native: v.node.title?.native,
|
|
1688
|
+
userPreferred: v.node.title?.userPreferred,
|
|
1689
|
+
},
|
|
1690
|
+
status:
|
|
1691
|
+
v.node.status === 'RELEASING'
|
|
1692
|
+
? MediaStatus.ONGOING
|
|
1693
|
+
: v.node.status === 'FINISHED'
|
|
1694
|
+
? MediaStatus.COMPLETED
|
|
1695
|
+
: v.node.status === 'NOT_YET_RELEASED'
|
|
1696
|
+
? MediaStatus.NOT_YET_AIRED
|
|
1697
|
+
: v.node.status === 'CANCELLED'
|
|
1698
|
+
? MediaStatus.CANCELLED
|
|
1699
|
+
: v.node.status === 'HIATUS'
|
|
1700
|
+
? MediaStatus.HIATUS
|
|
1701
|
+
: MediaStatus.UNKNOWN,
|
|
1702
|
+
episodes: v.node.episodes,
|
|
1703
|
+
image: v.node.coverImage?.extraLarge ?? v.node.coverImage?.large ?? v.node.coverImage?.medium,
|
|
1704
|
+
imageHash: getHashFromImage(
|
|
1705
|
+
v.node.coverImage?.extraLarge ?? v.node.coverImage?.large ?? v.node.coverImage?.medium
|
|
1706
|
+
),
|
|
1707
|
+
rating: v.node.averageScore,
|
|
1708
|
+
releaseDate: v.node.startDate?.year,
|
|
1709
|
+
type: v.node.format,
|
|
1710
|
+
color: v.node.coverImage?.color,
|
|
1711
|
+
})),
|
|
1712
|
+
};
|
|
1713
|
+
|
|
1714
|
+
return characterInfo;
|
|
1715
|
+
} catch (err) {
|
|
1716
|
+
throw new Error((err as Error).message);
|
|
1717
|
+
}
|
|
1718
|
+
};
|
|
1719
|
+
|
|
1720
|
+
/**
|
|
1721
|
+
* Anilist Anime class
|
|
1722
|
+
*/
|
|
1723
|
+
static Anime = this;
|
|
1724
|
+
|
|
1725
|
+
/**
|
|
1726
|
+
* Anilist Manga Class
|
|
1727
|
+
*/
|
|
1728
|
+
static Manga = class Manga {
|
|
1729
|
+
provider: MangaParser;
|
|
1730
|
+
|
|
1731
|
+
/**
|
|
1732
|
+
* Maps anilist manga to any manga provider (mangadex, mangasee, etc)
|
|
1733
|
+
* @param provider MangaParser
|
|
1734
|
+
*/
|
|
1735
|
+
constructor(provider?: MangaParser) {
|
|
1736
|
+
this.provider = provider || new Mangasee123();
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
/**
|
|
1740
|
+
*
|
|
1741
|
+
* @param query query to search for
|
|
1742
|
+
* @param page (optional) page number (default: `1`)
|
|
1743
|
+
* @param perPage (optional) number of results per page (default: `20`)
|
|
1744
|
+
*/
|
|
1745
|
+
search = async (query: string, page: number = 1, perPage: number = 20): Promise<ISearch<IMangaResult>> => {
|
|
1746
|
+
const options = {
|
|
1747
|
+
headers: {
|
|
1748
|
+
'Content-Type': 'application/json',
|
|
1749
|
+
'Accept': 'application/json',
|
|
1750
|
+
},
|
|
1751
|
+
query: anilistSearchQuery(query, page, perPage, 'MANGA'),
|
|
1752
|
+
};
|
|
1753
|
+
|
|
1754
|
+
try {
|
|
1755
|
+
const { data } = await axios.post(new Anilist().anilistGraphqlUrl, options);
|
|
1756
|
+
|
|
1757
|
+
const res: ISearch<IMangaResult> = {
|
|
1758
|
+
currentPage: data.data.Page.pageInfo.currentPage,
|
|
1759
|
+
hasNextPage: data.data.Page.pageInfo.hasNextPage,
|
|
1760
|
+
results: data.data.Page.media.map(
|
|
1761
|
+
(item: any): IMangaResult => ({
|
|
1762
|
+
id: item.id.toString(),
|
|
1763
|
+
malId: item.idMal,
|
|
1764
|
+
title: item.title
|
|
1765
|
+
? {
|
|
1766
|
+
romaji: item.title.romaji,
|
|
1767
|
+
english: item.title.english,
|
|
1768
|
+
native: item.title.native,
|
|
1769
|
+
userPreferred: item.title.userPreferred,
|
|
1770
|
+
}
|
|
1771
|
+
: item.title.romaji,
|
|
1772
|
+
status:
|
|
1773
|
+
item.status === 'RELEASING'
|
|
1774
|
+
? MediaStatus.ONGOING
|
|
1775
|
+
: item.status === 'FINISHED'
|
|
1776
|
+
? MediaStatus.COMPLETED
|
|
1777
|
+
: item.status === 'NOT_YET_RELEASED'
|
|
1778
|
+
? MediaStatus.NOT_YET_AIRED
|
|
1779
|
+
: item.status === 'CANCELLED'
|
|
1780
|
+
? MediaStatus.CANCELLED
|
|
1781
|
+
: item.status === 'HIATUS'
|
|
1782
|
+
? MediaStatus.HIATUS
|
|
1783
|
+
: MediaStatus.UNKNOWN,
|
|
1784
|
+
image: item.coverImage?.extraLarge ?? item.coverImage?.large ?? item.coverImage?.medium,
|
|
1785
|
+
imageHash: getHashFromImage(
|
|
1786
|
+
item.coverImage?.extraLarge ?? item.coverImage?.large ?? item.coverImage?.medium
|
|
1787
|
+
),
|
|
1788
|
+
cover: item.bannerImage,
|
|
1789
|
+
coverHash: getHashFromImage(item.bannerImage),
|
|
1790
|
+
popularity: item.popularity,
|
|
1791
|
+
description: item.description,
|
|
1792
|
+
rating: item.averageScore,
|
|
1793
|
+
genres: item.genres,
|
|
1794
|
+
color: item.coverImage?.color,
|
|
1795
|
+
totalChapters: item.chapters,
|
|
1796
|
+
volumes: item.volumes,
|
|
1797
|
+
type: item.format,
|
|
1798
|
+
releaseDate: item.seasonYear,
|
|
1799
|
+
})
|
|
1800
|
+
),
|
|
1801
|
+
};
|
|
1802
|
+
|
|
1803
|
+
return res;
|
|
1804
|
+
} catch (err) {
|
|
1805
|
+
throw new Error((err as Error).message);
|
|
1806
|
+
}
|
|
1807
|
+
};
|
|
1808
|
+
|
|
1809
|
+
/**
|
|
1810
|
+
*
|
|
1811
|
+
* @param chapterId chapter id
|
|
1812
|
+
* @param args args to pass to the provider (if any)
|
|
1813
|
+
* @returns
|
|
1814
|
+
*/
|
|
1815
|
+
fetchChapterPages = (chapterId: string, ...args: any): Promise<IMangaChapterPage[]> => {
|
|
1816
|
+
return this.provider.fetchChapterPages(chapterId, ...args);
|
|
1817
|
+
};
|
|
1818
|
+
|
|
1819
|
+
fetchMangaInfo = async (id: string, ...args: any): Promise<IMangaInfo> => {
|
|
1820
|
+
const mangaInfo: IMangaInfo = {
|
|
1821
|
+
id: id,
|
|
1822
|
+
title: '',
|
|
1823
|
+
};
|
|
1824
|
+
|
|
1825
|
+
const options = {
|
|
1826
|
+
headers: {
|
|
1827
|
+
'Content-Type': 'application/json',
|
|
1828
|
+
'Accept': 'application/json',
|
|
1829
|
+
},
|
|
1830
|
+
query: anilistMediaDetailQuery(id),
|
|
1831
|
+
};
|
|
1832
|
+
|
|
1833
|
+
try {
|
|
1834
|
+
const { data } = await axios.post(new Anilist().anilistGraphqlUrl, options).catch((err) => {
|
|
1835
|
+
throw new Error('Media not found');
|
|
1836
|
+
});
|
|
1837
|
+
mangaInfo.malId = data.data.Media.idMal;
|
|
1838
|
+
mangaInfo.title = {
|
|
1839
|
+
romaji: data.data.Media.title.romaji,
|
|
1840
|
+
english: data.data.Media.title.english,
|
|
1841
|
+
native: data.data.Media.title.native,
|
|
1842
|
+
userPreferred: data.data.Media.title.userPreferred,
|
|
1843
|
+
};
|
|
1844
|
+
|
|
1845
|
+
if (data.data.Media.trailer?.id) {
|
|
1846
|
+
mangaInfo.trailer = {
|
|
1847
|
+
id: data.data.Media.trailer.id,
|
|
1848
|
+
site: data.data.Media.trailer?.site,
|
|
1849
|
+
thumbnail: data.data.Media.trailer?.thumbnail,
|
|
1850
|
+
thumbnailHash: getHashFromImage(data.data.Media.trailer?.thumbnail),
|
|
1851
|
+
};
|
|
1852
|
+
}
|
|
1853
|
+
mangaInfo.image =
|
|
1854
|
+
data.data.Media.coverImage.extraLarge ??
|
|
1855
|
+
data.data.Media.coverImage.large ??
|
|
1856
|
+
data.data.Media.coverImage.medium;
|
|
1857
|
+
|
|
1858
|
+
mangaInfo.imageHash = getHashFromImage(
|
|
1859
|
+
data.data.Media.coverImage.extraLarge ?? data.data.Media.coverImage.large ?? data.data.Media.coverImage.medium
|
|
1860
|
+
);
|
|
1861
|
+
mangaInfo.popularity = data.data.Media.popularity;
|
|
1862
|
+
mangaInfo.color = data.data.Media.coverImage?.color;
|
|
1863
|
+
mangaInfo.cover = data.data.Media.bannerImage ?? mangaInfo.image;
|
|
1864
|
+
mangaInfo.coverHash = getHashFromImage(data.data.Media.bannerImage ?? mangaInfo.image);
|
|
1865
|
+
mangaInfo.description = data.data.Media.description;
|
|
1866
|
+
switch (data.data.Media.status) {
|
|
1867
|
+
case 'RELEASING':
|
|
1868
|
+
mangaInfo.status = MediaStatus.ONGOING;
|
|
1869
|
+
break;
|
|
1870
|
+
case 'FINISHED':
|
|
1871
|
+
mangaInfo.status = MediaStatus.COMPLETED;
|
|
1872
|
+
break;
|
|
1873
|
+
case 'NOT_YET_RELEASED':
|
|
1874
|
+
mangaInfo.status = MediaStatus.NOT_YET_AIRED;
|
|
1875
|
+
break;
|
|
1876
|
+
case 'CANCELLED':
|
|
1877
|
+
mangaInfo.status = MediaStatus.CANCELLED;
|
|
1878
|
+
break;
|
|
1879
|
+
case 'HIATUS':
|
|
1880
|
+
mangaInfo.status = MediaStatus.HIATUS;
|
|
1881
|
+
break;
|
|
1882
|
+
default:
|
|
1883
|
+
mangaInfo.status = MediaStatus.UNKNOWN;
|
|
1884
|
+
}
|
|
1885
|
+
mangaInfo.releaseDate = data.data.Media.startDate.year;
|
|
1886
|
+
mangaInfo.startDate = {
|
|
1887
|
+
year: data.data.Media.startDate.year,
|
|
1888
|
+
month: data.data.Media.startDate.month,
|
|
1889
|
+
day: data.data.Media.startDate.day,
|
|
1890
|
+
};
|
|
1891
|
+
mangaInfo.endDate = {
|
|
1892
|
+
year: data.data.Media.endDate.year,
|
|
1893
|
+
month: data.data.Media.endDate.month,
|
|
1894
|
+
day: data.data.Media.endDate.day,
|
|
1895
|
+
};
|
|
1896
|
+
mangaInfo.rating = data.data.Media.averageScore;
|
|
1897
|
+
mangaInfo.genres = data.data.Media.genres;
|
|
1898
|
+
mangaInfo.season = data.data.Media.season;
|
|
1899
|
+
mangaInfo.studios = data.data.Media.studios.edges.map((item: any) => item.node.name);
|
|
1900
|
+
mangaInfo.type = data.data.Media.format;
|
|
1901
|
+
mangaInfo.recommendations = data.data.Media.recommendations.edges.map((item: any) => ({
|
|
1902
|
+
id: item.node.mediaRecommendation?.id,
|
|
1903
|
+
malId: item.node.mediaRecommendation?.idMal,
|
|
1904
|
+
title: {
|
|
1905
|
+
romaji: item.node.mediaRecommendation?.title?.romaji,
|
|
1906
|
+
english: item.node.mediaRecommendation?.title?.english,
|
|
1907
|
+
native: item.node.mediaRecommendation?.title?.native,
|
|
1908
|
+
userPreferred: item.node.mediaRecommendation?.title?.userPreferred,
|
|
1909
|
+
},
|
|
1910
|
+
status:
|
|
1911
|
+
item.node.mediaRecommendation?.status === 'RELEASING'
|
|
1912
|
+
? MediaStatus.ONGOING
|
|
1913
|
+
: item.node.mediaRecommendation?.status === 'FINISHED'
|
|
1914
|
+
? MediaStatus.COMPLETED
|
|
1915
|
+
: item.node.mediaRecommendation?.status === 'NOT_YET_RELEASED'
|
|
1916
|
+
? MediaStatus.NOT_YET_AIRED
|
|
1917
|
+
: item.node.mediaRecommendation?.status === 'CANCELLED'
|
|
1918
|
+
? MediaStatus.CANCELLED
|
|
1919
|
+
: item.node.mediaRecommendation?.status === 'HIATUS'
|
|
1920
|
+
? MediaStatus.HIATUS
|
|
1921
|
+
: MediaStatus.UNKNOWN,
|
|
1922
|
+
chapters: item.node.mediaRecommendation?.chapters,
|
|
1923
|
+
image:
|
|
1924
|
+
item.node.mediaRecommendation?.coverImage?.extraLarge ??
|
|
1925
|
+
item.node.mediaRecommendation?.coverImage?.large ??
|
|
1926
|
+
item.node.mediaRecommendation?.coverImage?.medium,
|
|
1927
|
+
imageHash: getHashFromImage(
|
|
1928
|
+
item.node.mediaRecommendation?.coverImage?.extraLarge ??
|
|
1929
|
+
item.node.mediaRecommendation?.coverImage?.large ??
|
|
1930
|
+
item.node.mediaRecommendation?.coverImage?.medium
|
|
1931
|
+
),
|
|
1932
|
+
cover:
|
|
1933
|
+
item.node.mediaRecommendation?.bannerImage ??
|
|
1934
|
+
item.node.mediaRecommendation?.coverImage?.extraLarge ??
|
|
1935
|
+
item.node.mediaRecommendation?.coverImage?.large ??
|
|
1936
|
+
item.node.mediaRecommendation?.coverImage?.medium,
|
|
1937
|
+
coverHash: getHashFromImage(
|
|
1938
|
+
item.node.mediaRecommendation?.bannerImage ??
|
|
1939
|
+
item.node.mediaRecommendation?.coverImage?.extraLarge ??
|
|
1940
|
+
item.node.mediaRecommendation?.coverImage?.large ??
|
|
1941
|
+
item.node.mediaRecommendation?.coverImage?.medium
|
|
1942
|
+
),
|
|
1943
|
+
rating: item.node.mediaRecommendation?.meanScore,
|
|
1944
|
+
type: item.node.mediaRecommendation?.format,
|
|
1945
|
+
}));
|
|
1946
|
+
|
|
1947
|
+
mangaInfo.characters = data.data.Media.characters.edges.map((item: any) => ({
|
|
1948
|
+
id: item.node?.id,
|
|
1949
|
+
role: item.role,
|
|
1950
|
+
name: {
|
|
1951
|
+
first: item.node.name.first,
|
|
1952
|
+
last: item.node.name.last,
|
|
1953
|
+
full: item.node.name.full,
|
|
1954
|
+
native: item.node.name.native,
|
|
1955
|
+
userPreferred: item.node.name.userPreferred,
|
|
1956
|
+
},
|
|
1957
|
+
image: item.node.image.large ?? item.node.image.medium,
|
|
1958
|
+
imageHash: getHashFromImage(item.node.image.large ?? item.node.image.medium),
|
|
1959
|
+
}));
|
|
1960
|
+
|
|
1961
|
+
mangaInfo.relations = data.data.Media.relations.edges.map((item: any) => ({
|
|
1962
|
+
id: item.node.id,
|
|
1963
|
+
relationType: item.relationType,
|
|
1964
|
+
malId: item.node.idMal,
|
|
1965
|
+
title: {
|
|
1966
|
+
romaji: item.node.title.romaji,
|
|
1967
|
+
english: item.node.title.english,
|
|
1968
|
+
native: item.node.title.native,
|
|
1969
|
+
userPreferred: item.node.title.userPreferred,
|
|
1970
|
+
},
|
|
1971
|
+
status:
|
|
1972
|
+
item.node.status === 'RELEASING'
|
|
1973
|
+
? MediaStatus.ONGOING
|
|
1974
|
+
: item.node.status === 'FINISHED'
|
|
1975
|
+
? MediaStatus.COMPLETED
|
|
1976
|
+
: item.node.status === 'NOT_YET_RELEASED'
|
|
1977
|
+
? MediaStatus.NOT_YET_AIRED
|
|
1978
|
+
: item.node.status === 'CANCELLED'
|
|
1979
|
+
? MediaStatus.CANCELLED
|
|
1980
|
+
: item.node.status === 'HIATUS'
|
|
1981
|
+
? MediaStatus.HIATUS
|
|
1982
|
+
: MediaStatus.UNKNOWN,
|
|
1983
|
+
chapters: item.node.chapters,
|
|
1984
|
+
image: item.node.coverImage.extraLarge ?? item.node.coverImage.large ?? item.node.coverImage.medium,
|
|
1985
|
+
imageHash: getHashFromImage(
|
|
1986
|
+
item.node.coverImage.extraLarge ?? item.node.coverImage.large ?? item.node.coverImage.medium
|
|
1987
|
+
),
|
|
1988
|
+
color: item.node.coverImage?.color,
|
|
1989
|
+
type: item.node.format,
|
|
1990
|
+
cover:
|
|
1991
|
+
item.node.bannerImage ??
|
|
1992
|
+
item.node.coverImage.extraLarge ??
|
|
1993
|
+
item.node.coverImage.large ??
|
|
1994
|
+
item.node.coverImage.medium,
|
|
1995
|
+
coverHash: getHashFromImage(
|
|
1996
|
+
item.node.bannerImage ??
|
|
1997
|
+
item.node.coverImage.extraLarge ??
|
|
1998
|
+
item.node.coverImage.large ??
|
|
1999
|
+
item.node.coverImage.medium
|
|
2000
|
+
),
|
|
2001
|
+
rating: item.node.meanScore,
|
|
2002
|
+
}));
|
|
2003
|
+
|
|
2004
|
+
mangaInfo.chapters = await new Anilist().findManga(
|
|
2005
|
+
this.provider,
|
|
2006
|
+
{
|
|
2007
|
+
english: mangaInfo.title.english!,
|
|
2008
|
+
romaji: mangaInfo.title.romaji!,
|
|
2009
|
+
},
|
|
2010
|
+
mangaInfo.malId as number
|
|
2011
|
+
);
|
|
2012
|
+
mangaInfo.chapters = mangaInfo.chapters.reverse();
|
|
2013
|
+
|
|
2014
|
+
return mangaInfo;
|
|
2015
|
+
} catch (error) {
|
|
2016
|
+
throw Error((error as Error).message);
|
|
2017
|
+
}
|
|
2018
|
+
};
|
|
2019
|
+
};
|
|
2020
|
+
|
|
2021
|
+
private findMangaSlug = async (provider: MangaParser, title: string, malId: number): Promise<IMangaChapter[]> => {
|
|
2022
|
+
const slug = title.replace(/[^0-9a-zA-Z]+/g, ' ');
|
|
2023
|
+
|
|
2024
|
+
let possibleManga: any;
|
|
2025
|
+
|
|
2026
|
+
if (malId) {
|
|
2027
|
+
const malAsyncReq = await axios.get(`${this.malSyncUrl}/mal/manga/${malId}`, {
|
|
2028
|
+
validateStatus: () => true,
|
|
2029
|
+
});
|
|
2030
|
+
|
|
2031
|
+
if (malAsyncReq.status === 200) {
|
|
2032
|
+
const sitesT = malAsyncReq.data.Sites as {
|
|
2033
|
+
[k: string]: {
|
|
2034
|
+
[k: string]: { url: string; page: string; title: string };
|
|
2035
|
+
};
|
|
2036
|
+
};
|
|
2037
|
+
let sites = Object.values(sitesT).map((v, i) => {
|
|
2038
|
+
const obj: any = [...Object.values(Object.values(sitesT)[i]!)];
|
|
2039
|
+
const pages: any = obj.map((v: any) => ({
|
|
2040
|
+
page: v.page,
|
|
2041
|
+
url: v.url,
|
|
2042
|
+
title: v.title,
|
|
2043
|
+
}));
|
|
2044
|
+
return pages;
|
|
2045
|
+
}) as any[];
|
|
2046
|
+
|
|
2047
|
+
sites = sites.flat();
|
|
2048
|
+
|
|
2049
|
+
const possibleSource = sites.find((s) => s.page.toLowerCase() === provider.name.toLowerCase());
|
|
2050
|
+
|
|
2051
|
+
if (possibleSource) possibleManga = await provider.fetchMangaInfo(possibleSource.url.split('/').pop()!);
|
|
2052
|
+
else possibleManga = await this.findMangaRaw(provider, slug, title);
|
|
2053
|
+
} else possibleManga = await this.findMangaRaw(provider, slug, title);
|
|
2054
|
+
} else possibleManga = await this.findMangaRaw(provider, slug, title);
|
|
2055
|
+
|
|
2056
|
+
const possibleProviderChapters = possibleManga.chapters;
|
|
2057
|
+
|
|
2058
|
+
return possibleProviderChapters;
|
|
2059
|
+
};
|
|
2060
|
+
|
|
2061
|
+
private findMangaRaw = async (provider: MangaParser, slug: string, title: string) => {
|
|
2062
|
+
const findAnime = (await provider.search(slug)) as ISearch<IMangaResult>;
|
|
2063
|
+
|
|
2064
|
+
if (findAnime.results.length === 0) return [];
|
|
2065
|
+
// TODO: use much better way than this
|
|
2066
|
+
|
|
2067
|
+
const possibleManga = findAnime.results.find(
|
|
2068
|
+
(manga: IMangaResult) =>
|
|
2069
|
+
title.toLowerCase() === (typeof manga.title === 'string' ? manga.title.toLowerCase() : '')
|
|
2070
|
+
);
|
|
2071
|
+
|
|
2072
|
+
if (!possibleManga) return (await provider.fetchMangaInfo(findAnime.results[0]!.id)) as IMangaInfo;
|
|
2073
|
+
return (await provider.fetchMangaInfo(possibleManga.id)) as IMangaInfo;
|
|
2074
|
+
};
|
|
2075
|
+
|
|
2076
|
+
private findManga = async (
|
|
2077
|
+
provider: MangaParser,
|
|
2078
|
+
title: { romaji: string; english: string },
|
|
2079
|
+
malId: number
|
|
2080
|
+
): Promise<IMangaChapter[]> => {
|
|
2081
|
+
title.english = title.english ?? title.romaji;
|
|
2082
|
+
title.romaji = title.romaji ?? title.english;
|
|
2083
|
+
|
|
2084
|
+
title.english = title.english.toLowerCase();
|
|
2085
|
+
title.romaji = title.romaji.toLowerCase();
|
|
2086
|
+
|
|
2087
|
+
if (title.english === title.romaji) return await this.findMangaSlug(provider, title.english, malId);
|
|
2088
|
+
|
|
2089
|
+
const romajiPossibleEpisodes = this.findMangaSlug(provider, title.romaji, malId);
|
|
2090
|
+
|
|
2091
|
+
if (romajiPossibleEpisodes) {
|
|
2092
|
+
return romajiPossibleEpisodes;
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
const englishPossibleEpisodes = this.findMangaSlug(provider, title.english, malId);
|
|
2096
|
+
return englishPossibleEpisodes;
|
|
2097
|
+
};
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
// (async () => {
|
|
2101
|
+
// const ani = new Anilist(new Zoro());
|
|
2102
|
+
// const anime = await ani.fetchAnimeInfo('21');
|
|
2103
|
+
// console.log(anime.episodes);
|
|
2104
|
+
// const sources = await ani.fetchEpisodeSources(anime.episodes![0]!.id, anime.episodes![0]!.number, anime.id);
|
|
2105
|
+
// console.log(sources);
|
|
2106
|
+
// })();
|
|
2107
|
+
|
|
2108
|
+
export default Anilist;
|