react-native-consumet 1.3.1 → 1.4.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 +102 -102
- 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 +63 -63
- package/android/src/main/java/com/consumet/ConsumetPackage.kt +33 -33
- package/android/src/main/java/com/consumet/DdosGuardModule.kt +213 -213
- package/android/src/main/java/com/consumet/DeobfuscatorModule.kt +89 -89
- package/android/src/main/java/com/consumet/HttpRequestModule.kt +417 -417
- package/ios/Consumet.h +6 -6
- package/ios/Consumet.mm +18 -18
- package/lib/commonjs/extension-registry.json +69 -3
- package/lib/commonjs/extractors/{streamp2p.js → StreamP2P.js} +1 -1
- package/lib/commonjs/extractors/StreamP2P.js.map +1 -0
- package/lib/commonjs/extractors/asianload.js.map +1 -1
- package/lib/commonjs/extractors/filemoon.js.map +1 -1
- package/lib/commonjs/extractors/gdflix.js +167 -0
- package/lib/commonjs/extractors/gdflix.js.map +1 -0
- package/lib/commonjs/extractors/gofile.js +152 -0
- package/lib/commonjs/extractors/gofile.js.map +1 -0
- package/lib/commonjs/extractors/gogocdn.js.map +1 -1
- package/lib/commonjs/extractors/hubcloud.js +320 -0
- package/lib/commonjs/extractors/hubcloud.js.map +1 -0
- package/lib/commonjs/extractors/index.js +28 -0
- package/lib/commonjs/extractors/index.js.map +1 -1
- package/lib/commonjs/extractors/kisskh/kkey.js.map +1 -1
- package/lib/commonjs/extractors/kisskh/staticdata.js.map +1 -1
- package/lib/commonjs/extractors/kwik.js.map +1 -1
- package/lib/commonjs/extractors/megacloud.js.map +1 -1
- package/lib/commonjs/extractors/megaplay.js +169 -0
- package/lib/commonjs/extractors/megaplay.js.map +1 -0
- package/lib/commonjs/extractors/megaup.js.map +1 -1
- package/lib/commonjs/extractors/mixdrop.js.map +1 -1
- package/lib/commonjs/extractors/mp4player.js.map +1 -1
- package/lib/commonjs/extractors/mp4upload.js.map +1 -1
- package/lib/commonjs/extractors/rapidcloud.js.map +1 -1
- package/lib/commonjs/extractors/streamhub.js.map +1 -1
- package/lib/commonjs/extractors/streamlare.js.map +1 -1
- package/lib/commonjs/extractors/streamsb.js.map +1 -1
- package/lib/commonjs/extractors/streamtape.js.map +1 -1
- package/lib/commonjs/extractors/streamwish.js.map +1 -1
- package/lib/commonjs/extractors/vidhide.js.map +1 -1
- package/lib/commonjs/extractors/vidmoly.js.map +1 -1
- package/lib/commonjs/extractors/vizcloud.js.map +1 -1
- package/lib/commonjs/extractors/voe.js.map +1 -1
- package/lib/commonjs/index.js +24 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/anime-parser.js.map +1 -1
- package/lib/commonjs/models/base-parser.js.map +1 -1
- package/lib/commonjs/models/base-provider.js.map +1 -1
- package/lib/commonjs/models/base-types.js.map +1 -1
- package/lib/commonjs/models/extension-manifest.js.map +1 -1
- package/lib/commonjs/models/extractor-context.js.map +1 -1
- package/lib/commonjs/models/index.js.map +1 -1
- package/lib/commonjs/models/lightnovel-parser.js.map +1 -1
- package/lib/commonjs/models/manga-parser.js.map +1 -1
- package/lib/commonjs/models/movie-parser.js.map +1 -1
- package/lib/commonjs/models/provider-context.js.map +1 -1
- package/lib/commonjs/models/types.js +4 -0
- package/lib/commonjs/models/types.js.map +1 -1
- package/lib/commonjs/models/video-extractor.js.map +1 -1
- package/lib/commonjs/providers/anime/anify.js.map +1 -1
- package/lib/commonjs/providers/anime/anikoto/anikoto.js +62 -63
- package/lib/commonjs/providers/anime/anikoto/anikoto.js.map +1 -1
- package/lib/commonjs/providers/anime/anikoto/create-anikoto.js +359 -406
- package/lib/commonjs/providers/anime/anikoto/create-anikoto.js.map +1 -1
- package/lib/commonjs/providers/anime/animedrive.js.map +1 -1
- package/lib/commonjs/providers/anime/animekai/animekai.js.map +1 -1
- package/lib/commonjs/providers/anime/animekai/create-animekai.js.map +1 -1
- package/lib/commonjs/providers/anime/animepahe/animepahe.js.map +1 -1
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/commonjs/providers/anime/animesuge/animesuge.js.map +1 -1
- package/lib/commonjs/providers/anime/animesuge/create-animesuge.js.map +1 -1
- package/lib/commonjs/providers/anime/animeunity.js.map +1 -1
- package/lib/commonjs/providers/anime/index.js.map +1 -1
- package/lib/commonjs/providers/anime/kickassanime.js.map +1 -1
- package/lib/commonjs/providers/anime/marin.js.map +1 -1
- package/lib/commonjs/providers/anime/zoro/create-zoro.js.map +1 -1
- package/lib/commonjs/providers/anime/zoro/zoro.js.map +1 -1
- package/lib/commonjs/providers/index.js.map +1 -1
- package/lib/commonjs/providers/light-novels/index.js.map +1 -1
- package/lib/commonjs/providers/light-novels/novelupdates.js.map +1 -1
- package/lib/commonjs/providers/light-novels/readlightnovels.js.map +1 -1
- package/lib/commonjs/providers/manga/asurascans.js.map +1 -1
- package/lib/commonjs/providers/manga/brmangas.js.map +1 -1
- package/lib/commonjs/providers/manga/comick.js.map +1 -1
- package/lib/commonjs/providers/manga/flamescans.js.map +1 -1
- package/lib/commonjs/providers/manga/index.js.map +1 -1
- package/lib/commonjs/providers/manga/mangadex.js.map +1 -1
- package/lib/commonjs/providers/manga/mangahere.js.map +1 -1
- package/lib/commonjs/providers/manga/mangahost.js.map +1 -1
- package/lib/commonjs/providers/manga/mangakakalot.js.map +1 -1
- package/lib/commonjs/providers/manga/mangapark.js.map +1 -1
- package/lib/commonjs/providers/manga/mangapill.js.map +1 -1
- package/lib/commonjs/providers/manga/mangareader.js.map +1 -1
- package/lib/commonjs/providers/manga/mangasee123.js.map +1 -1
- package/lib/commonjs/providers/manga/readmanga.js.map +1 -1
- package/lib/commonjs/providers/manga/vyvymanga.js.map +1 -1
- package/lib/commonjs/providers/meta/anilist.js.map +1 -1
- package/lib/commonjs/providers/meta/index.js.map +1 -1
- package/lib/commonjs/providers/meta/mal.js.map +1 -1
- package/lib/commonjs/providers/meta/tmdb.js.map +1 -1
- package/lib/commonjs/providers/movies/dramacool.js.map +1 -1
- package/lib/commonjs/providers/movies/himovies/create-himovies.js.map +1 -1
- package/lib/commonjs/providers/movies/himovies/himovies.js.map +1 -1
- package/lib/commonjs/providers/movies/index.js +18 -1
- package/lib/commonjs/providers/movies/index.js.map +1 -1
- package/lib/commonjs/providers/movies/multimovies/create-multimovies.js.map +1 -1
- package/lib/commonjs/providers/movies/multimovies/multimovies.js.map +1 -1
- package/lib/commonjs/providers/movies/multistream/index.js.map +1 -1
- package/lib/commonjs/providers/movies/multistream/utils.js.map +1 -1
- package/lib/commonjs/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -1
- package/lib/commonjs/providers/movies/netflixmirror/netflixmirror.js.map +1 -1
- package/lib/commonjs/providers/movies/vegamovies/create-vegamovies.js +812 -0
- package/lib/commonjs/providers/movies/vegamovies/create-vegamovies.js.map +1 -0
- package/lib/commonjs/providers/movies/vegamovies/vegamovies.js +56 -0
- package/lib/commonjs/providers/movies/vegamovies/vegamovies.js.map +1 -0
- package/lib/commonjs/providers/movies/yflix/create-yflix.js.map +1 -1
- package/lib/commonjs/providers/movies/yflix/yflix.js.map +1 -1
- package/lib/commonjs/providers/movies/yflix.js.map +1 -1
- package/lib/commonjs/utils/ExtractorManager.js +10 -2
- package/lib/commonjs/utils/ExtractorManager.js.map +1 -1
- package/lib/commonjs/utils/ProviderManager.js.map +1 -1
- package/lib/commonjs/utils/constants.js.map +1 -1
- package/lib/commonjs/utils/create-extractor-context.js.map +1 -1
- package/lib/commonjs/utils/create-provider-context.js.map +1 -1
- package/lib/commonjs/utils/extension-utils.js +11 -2
- package/lib/commonjs/utils/extension-utils.js.map +1 -1
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/provider-maps.js +3 -0
- package/lib/commonjs/utils/provider-maps.js.map +1 -1
- package/lib/commonjs/utils/queries.js.map +1 -1
- package/lib/commonjs/utils/url-polyfill.js.map +1 -1
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/extension-registry.json +69 -3
- package/lib/module/extractors/{streamp2p.js → StreamP2P.js} +1 -1
- package/lib/module/extractors/StreamP2P.js.map +1 -0
- package/lib/module/extractors/asianload.js.map +1 -1
- package/lib/module/extractors/filemoon.js.map +1 -1
- package/lib/module/extractors/gdflix.js +162 -0
- package/lib/module/extractors/gdflix.js.map +1 -0
- package/lib/module/extractors/gofile.js +147 -0
- package/lib/module/extractors/gofile.js.map +1 -0
- package/lib/module/extractors/gogocdn.js.map +1 -1
- package/lib/module/extractors/hubcloud.js +315 -0
- package/lib/module/extractors/hubcloud.js.map +1 -0
- package/lib/module/extractors/index.js +5 -1
- package/lib/module/extractors/index.js.map +1 -1
- package/lib/module/extractors/kisskh/kkey.js.map +1 -1
- package/lib/module/extractors/kisskh/staticdata.js.map +1 -1
- package/lib/module/extractors/kwik.js.map +1 -1
- package/lib/module/extractors/megacloud.js.map +1 -1
- package/lib/module/extractors/megaplay.js +163 -0
- package/lib/module/extractors/megaplay.js.map +1 -0
- package/lib/module/extractors/megaup.js.map +1 -1
- package/lib/module/extractors/mixdrop.js.map +1 -1
- package/lib/module/extractors/mp4player.js.map +1 -1
- package/lib/module/extractors/mp4upload.js.map +1 -1
- package/lib/module/extractors/rapidcloud.js.map +1 -1
- package/lib/module/extractors/streamhub.js.map +1 -1
- package/lib/module/extractors/streamlare.js.map +1 -1
- package/lib/module/extractors/streamsb.js.map +1 -1
- package/lib/module/extractors/streamtape.js.map +1 -1
- package/lib/module/extractors/streamwish.js.map +1 -1
- package/lib/module/extractors/vidhide.js.map +1 -1
- package/lib/module/extractors/vidmoly.js.map +1 -1
- package/lib/module/extractors/vizcloud.js.map +1 -1
- package/lib/module/extractors/voe.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/anime-parser.js.map +1 -1
- package/lib/module/models/base-parser.js.map +1 -1
- package/lib/module/models/base-provider.js.map +1 -1
- package/lib/module/models/base-types.js.map +1 -1
- package/lib/module/models/extension-manifest.js.map +1 -1
- package/lib/module/models/extractor-context.js.map +1 -1
- package/lib/module/models/index.js.map +1 -1
- package/lib/module/models/lightnovel-parser.js.map +1 -1
- package/lib/module/models/manga-parser.js.map +1 -1
- package/lib/module/models/movie-parser.js.map +1 -1
- package/lib/module/models/provider-context.js.map +1 -1
- package/lib/module/models/types.js +4 -0
- package/lib/module/models/types.js.map +1 -1
- package/lib/module/models/video-extractor.js.map +1 -1
- package/lib/module/providers/anime/anify.js.map +1 -1
- package/lib/module/providers/anime/anikoto/anikoto.js +61 -64
- package/lib/module/providers/anime/anikoto/anikoto.js.map +1 -1
- package/lib/module/providers/anime/anikoto/create-anikoto.js +359 -407
- package/lib/module/providers/anime/anikoto/create-anikoto.js.map +1 -1
- package/lib/module/providers/anime/animedrive.js.map +1 -1
- package/lib/module/providers/anime/animekai/animekai.js.map +1 -1
- package/lib/module/providers/anime/animekai/create-animekai.js.map +1 -1
- package/lib/module/providers/anime/animepahe/animepahe.js.map +1 -1
- package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/module/providers/anime/animesuge/animesuge.js.map +1 -1
- package/lib/module/providers/anime/animesuge/create-animesuge.js.map +1 -1
- package/lib/module/providers/anime/animeunity.js.map +1 -1
- package/lib/module/providers/anime/index.js.map +1 -1
- package/lib/module/providers/anime/kickassanime.js.map +1 -1
- package/lib/module/providers/anime/marin.js.map +1 -1
- package/lib/module/providers/anime/zoro/create-zoro.js.map +1 -1
- package/lib/module/providers/anime/zoro/zoro.js.map +1 -1
- package/lib/module/providers/index.js.map +1 -1
- package/lib/module/providers/light-novels/index.js.map +1 -1
- package/lib/module/providers/light-novels/novelupdates.js.map +1 -1
- package/lib/module/providers/light-novels/readlightnovels.js.map +1 -1
- package/lib/module/providers/manga/asurascans.js.map +1 -1
- package/lib/module/providers/manga/brmangas.js.map +1 -1
- package/lib/module/providers/manga/comick.js.map +1 -1
- package/lib/module/providers/manga/flamescans.js.map +1 -1
- package/lib/module/providers/manga/index.js.map +1 -1
- package/lib/module/providers/manga/mangadex.js.map +1 -1
- package/lib/module/providers/manga/mangahere.js.map +1 -1
- package/lib/module/providers/manga/mangahost.js.map +1 -1
- package/lib/module/providers/manga/mangakakalot.js.map +1 -1
- package/lib/module/providers/manga/mangapark.js.map +1 -1
- package/lib/module/providers/manga/mangapill.js.map +1 -1
- package/lib/module/providers/manga/mangareader.js.map +1 -1
- package/lib/module/providers/manga/mangasee123.js.map +1 -1
- package/lib/module/providers/manga/readmanga.js.map +1 -1
- package/lib/module/providers/manga/vyvymanga.js.map +1 -1
- package/lib/module/providers/meta/anilist.js.map +1 -1
- package/lib/module/providers/meta/index.js.map +1 -1
- package/lib/module/providers/meta/mal.js.map +1 -1
- package/lib/module/providers/meta/tmdb.js.map +1 -1
- package/lib/module/providers/movies/dramacool.js.map +1 -1
- package/lib/module/providers/movies/himovies/create-himovies.js.map +1 -1
- package/lib/module/providers/movies/himovies/himovies.js.map +1 -1
- package/lib/module/providers/movies/index.js +6 -1
- package/lib/module/providers/movies/index.js.map +1 -1
- package/lib/module/providers/movies/multimovies/create-multimovies.js.map +1 -1
- package/lib/module/providers/movies/multimovies/multimovies.js.map +1 -1
- package/lib/module/providers/movies/multistream/index.js.map +1 -1
- package/lib/module/providers/movies/multistream/utils.js.map +1 -1
- package/lib/module/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -1
- package/lib/module/providers/movies/netflixmirror/netflixmirror.js.map +1 -1
- package/lib/module/providers/movies/vegamovies/create-vegamovies.js +808 -0
- package/lib/module/providers/movies/vegamovies/create-vegamovies.js.map +1 -0
- package/lib/module/providers/movies/vegamovies/vegamovies.js +47 -0
- package/lib/module/providers/movies/vegamovies/vegamovies.js.map +1 -0
- package/lib/module/providers/movies/yflix/create-yflix.js.map +1 -1
- package/lib/module/providers/movies/yflix/yflix.js.map +1 -1
- package/lib/module/providers/movies/yflix.js.map +1 -1
- package/lib/module/utils/ExtractorManager.js +10 -2
- package/lib/module/utils/ExtractorManager.js.map +1 -1
- package/lib/module/utils/ProviderManager.js.map +1 -1
- package/lib/module/utils/constants.js.map +1 -1
- package/lib/module/utils/create-extractor-context.js.map +1 -1
- package/lib/module/utils/create-provider-context.js.map +1 -1
- package/lib/module/utils/extension-utils.js +12 -3
- package/lib/module/utils/extension-utils.js.map +1 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/provider-maps.js +3 -0
- package/lib/module/utils/provider-maps.js.map +1 -1
- package/lib/module/utils/queries.js.map +1 -1
- package/lib/module/utils/url-polyfill.js.map +1 -1
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/commonjs/src/extractors/{streamp2p.d.ts → StreamP2P.d.ts} +1 -1
- package/lib/typescript/commonjs/src/extractors/{streamp2p.d.ts.map → StreamP2P.d.ts.map} +1 -1
- package/lib/typescript/commonjs/src/extractors/gdflix.d.ts +8 -0
- package/lib/typescript/commonjs/src/extractors/gdflix.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/extractors/gofile.d.ts +8 -0
- package/lib/typescript/commonjs/src/extractors/gofile.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/extractors/hubcloud.d.ts +8 -0
- package/lib/typescript/commonjs/src/extractors/hubcloud.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/extractors/index.d.ts +5 -1
- package/lib/typescript/commonjs/src/extractors/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/megaplay.d.ts +9 -0
- package/lib/typescript/commonjs/src/extractors/megaplay.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +2 -2
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/provider-context.d.ts +12 -0
- package/lib/typescript/commonjs/src/models/provider-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/types.d.ts +9 -1
- package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/anikoto/anikoto.d.ts +59 -49
- package/lib/typescript/commonjs/src/providers/anime/anikoto/anikoto.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/anikoto/create-anikoto.d.ts +6 -8
- package/lib/typescript/commonjs/src/providers/anime/anikoto/create-anikoto.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/index.d.ts +5 -0
- package/lib/typescript/commonjs/src/providers/movies/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/vegamovies/create-vegamovies.d.ts +22 -0
- package/lib/typescript/commonjs/src/providers/movies/vegamovies/create-vegamovies.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/vegamovies/vegamovies.d.ts +25 -0
- package/lib/typescript/commonjs/src/providers/movies/vegamovies/vegamovies.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/ExtractorManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/extension-utils.d.ts +9 -0
- package/lib/typescript/commonjs/src/utils/extension-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/provider-maps.d.ts +1 -0
- package/lib/typescript/commonjs/src/utils/provider-maps.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/{streamp2p.d.ts → StreamP2P.d.ts} +1 -1
- package/lib/typescript/module/src/extractors/{streamp2p.d.ts.map → StreamP2P.d.ts.map} +1 -1
- package/lib/typescript/module/src/extractors/gdflix.d.ts +8 -0
- package/lib/typescript/module/src/extractors/gdflix.d.ts.map +1 -0
- package/lib/typescript/module/src/extractors/gofile.d.ts +8 -0
- package/lib/typescript/module/src/extractors/gofile.d.ts.map +1 -0
- package/lib/typescript/module/src/extractors/hubcloud.d.ts +8 -0
- package/lib/typescript/module/src/extractors/hubcloud.d.ts.map +1 -0
- package/lib/typescript/module/src/extractors/index.d.ts +5 -1
- package/lib/typescript/module/src/extractors/index.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/megaplay.d.ts +9 -0
- package/lib/typescript/module/src/extractors/megaplay.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +2 -2
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/provider-context.d.ts +12 -0
- package/lib/typescript/module/src/models/provider-context.d.ts.map +1 -1
- package/lib/typescript/module/src/models/types.d.ts +9 -1
- package/lib/typescript/module/src/models/types.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/anikoto/anikoto.d.ts +59 -49
- package/lib/typescript/module/src/providers/anime/anikoto/anikoto.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/anikoto/create-anikoto.d.ts +6 -8
- package/lib/typescript/module/src/providers/anime/anikoto/create-anikoto.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/index.d.ts +5 -0
- package/lib/typescript/module/src/providers/movies/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/vegamovies/create-vegamovies.d.ts +22 -0
- package/lib/typescript/module/src/providers/movies/vegamovies/create-vegamovies.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/vegamovies/vegamovies.d.ts +25 -0
- package/lib/typescript/module/src/providers/movies/vegamovies/vegamovies.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/ExtractorManager.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/extension-utils.d.ts +9 -0
- package/lib/typescript/module/src/utils/extension-utils.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/provider-maps.d.ts +1 -0
- package/lib/typescript/module/src/utils/provider-maps.d.ts.map +1 -1
- package/package.json +217 -217
- package/react-native.config.js +12 -12
- package/src/extension-registry.json +69 -3
- package/src/extractors/gdflix.ts +167 -0
- package/src/extractors/gofile.ts +182 -0
- package/src/extractors/hubcloud.ts +357 -0
- package/src/extractors/index.ts +8 -0
- package/src/extractors/megaplay.ts +182 -0
- package/src/index.tsx +8 -0
- package/src/models/provider-context.ts +12 -0
- package/src/models/types.ts +8 -0
- package/src/providers/anime/anikoto/anikoto.ts +84 -67
- package/src/providers/anime/anikoto/create-anikoto.ts +413 -419
- package/src/providers/movies/index.ts +6 -0
- package/src/providers/movies/vegamovies/create-vegamovies.ts +921 -0
- package/src/providers/movies/vegamovies/vegamovies.ts +63 -0
- package/src/utils/ExtractorManager.ts +7 -1
- package/src/utils/extension-utils.ts +13 -0
- package/src/utils/provider-maps.ts +3 -0
- package/lib/commonjs/extractors/streamp2p.js.map +0 -1
- package/lib/module/extractors/streamp2p.js.map +0 -1
- /package/src/extractors/{streamp2p.ts → StreamP2P.ts} +0 -0
|
@@ -0,0 +1,921 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type IMovieInfo,
|
|
3
|
+
type IEpisodeServer,
|
|
4
|
+
type StreamingServers,
|
|
5
|
+
type ISource,
|
|
6
|
+
type IVideo,
|
|
7
|
+
type IMovieResult,
|
|
8
|
+
type ISearch,
|
|
9
|
+
type ProviderContext,
|
|
10
|
+
type ProviderConfig,
|
|
11
|
+
type IMovieEpisode,
|
|
12
|
+
} from '../../../models';
|
|
13
|
+
|
|
14
|
+
const cleanTitle = (raw: string): string => {
|
|
15
|
+
let t = raw;
|
|
16
|
+
|
|
17
|
+
// 1. Remove leading "Download" or "Watch"
|
|
18
|
+
t = t.replace(/^(?:Download|Watch)\s+/i, '');
|
|
19
|
+
|
|
20
|
+
// 2. Truncate at season indicators (e.g. " - Season 1", " (Season 1 – 3)", " Season 1", " S01-S03")
|
|
21
|
+
t = t.replace(/\s*[-–—:]?\s*\(?\b(?:Season\s*\d+|S\d{1,2})\b.*$/i, '');
|
|
22
|
+
|
|
23
|
+
// 3. Truncate at 4-digit year in parentheses e.g. "(2025)", "(1999)"
|
|
24
|
+
t = t.replace(/\s*\(\s*(?:19\d{2}|20\d{2})\s*\).*$/, '');
|
|
25
|
+
|
|
26
|
+
// 4. Truncate at curly braces e.g. "{Hindi-English-Korean}" or "{E110 - Added}"
|
|
27
|
+
t = t.replace(/\s*\{.*?\}$/, '');
|
|
28
|
+
|
|
29
|
+
// 5. Truncate at bracketed metadata e.g. "[S04 E15 Added]", "[320MB]"
|
|
30
|
+
t = t.replace(/\s*\[.*?\]$/, '');
|
|
31
|
+
|
|
32
|
+
// 6. Truncate at quality / release / audio / network tags if still present
|
|
33
|
+
t = t.replace(
|
|
34
|
+
/\s*[-–—:]?\s*\b(?:Dual[- ]Audio|Multi[- ]Audio|Hindi[- ](?:Dubbed|ORG)|ORG\s+Dubbed|Blu[- ]?Ray|WEB[- ]?DL|HDRip|HDTC|PreDVDRip|CAMRip|DVDRip|Anime\s+Series|K-DRAMA\s+Series|C-Drama\s+Series|Turkish-Drama\s+Series|Netflix[- ]Series|Disney\+|Hotstar|Amazon\s+Prime|IMAX|Extended|Edition|x264|x265|HEVC|10Bit|480p|720p|1080p|2160p|4k)\b.*$/i,
|
|
35
|
+
''
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
// 7. Remove any trailing punctuation or leftover dashes/colons/slashes
|
|
39
|
+
return t
|
|
40
|
+
.replace(/[\r\n\t]+/g, ' ')
|
|
41
|
+
.replace(/\s+/g, ' ')
|
|
42
|
+
.trim()
|
|
43
|
+
.replace(/[-–—:|/]+$/, '')
|
|
44
|
+
.trim();
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export function createVegaMovies(ctx: ProviderContext, customBaseURL?: string) {
|
|
48
|
+
const { load, extractors, enums, axios, createCustomBaseUrl, PolyURL, USER_AGENT } = ctx;
|
|
49
|
+
const { HubCloud } = extractors;
|
|
50
|
+
const { StreamingServers: StreamingServersEnum, TvType: TvTypeEnum } = enums;
|
|
51
|
+
|
|
52
|
+
const baseUrl = createCustomBaseUrl('https://new2.vegamovies.futbol', customBaseURL);
|
|
53
|
+
|
|
54
|
+
const config: ProviderConfig = {
|
|
55
|
+
name: 'VegaMovies',
|
|
56
|
+
languages: 'all',
|
|
57
|
+
classPath: 'MOVIES.VegaMovies',
|
|
58
|
+
logo: `${baseUrl}/images/favicon-32x32.png`,
|
|
59
|
+
baseUrl,
|
|
60
|
+
isNSFW: false,
|
|
61
|
+
isWorking: true,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const defaultHeaders: Record<string, string> = {
|
|
65
|
+
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8',
|
|
66
|
+
'Accept-Language': 'en-US,en;q=0.9',
|
|
67
|
+
'Cookie': 'xla=s4t',
|
|
68
|
+
'User-Agent':
|
|
69
|
+
USER_AGENT ||
|
|
70
|
+
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const supportedTypes = new Set([TvTypeEnum.MOVIE, TvTypeEnum.TVSERIES]);
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Parse year from title string
|
|
77
|
+
*/
|
|
78
|
+
const extractYear = (text: string): string | undefined => {
|
|
79
|
+
const match = text.match(/\b(19\d{2}|20\d{2})\b/);
|
|
80
|
+
return match ? match[1] : undefined;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Parse season number from title/text
|
|
85
|
+
*/
|
|
86
|
+
const extractSeasonNumber = (text: string): number => {
|
|
87
|
+
const match = text.match(/season\s*(\d+)|s(\d+)/i);
|
|
88
|
+
if (match) {
|
|
89
|
+
const num = match[1] || match[2];
|
|
90
|
+
if (num) return parseInt(num, 10);
|
|
91
|
+
}
|
|
92
|
+
return 1;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Helper to parse HTML grid items into IMovieResult list
|
|
97
|
+
*/
|
|
98
|
+
const parseHtmlGrid = (html: string): IMovieResult[] => {
|
|
99
|
+
const $ = load(html);
|
|
100
|
+
const results: IMovieResult[] = [];
|
|
101
|
+
const seen = new Set<string>();
|
|
102
|
+
|
|
103
|
+
const items = $('.movies-grid, #moviesGridMain, .blog-items, .post-list, #archive-container').children(
|
|
104
|
+
'a, article, .entry-list-item, .poster-card'
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
items.each((_, el) => {
|
|
108
|
+
const element = $(el);
|
|
109
|
+
const linkEl = element.is('a') ? element : element.find('a').first();
|
|
110
|
+
const href = linkEl.attr('href') || element.attr('href') || '';
|
|
111
|
+
if (!href || href === '#' || href === '/') return;
|
|
112
|
+
|
|
113
|
+
const postUrl = new PolyURL(href, `${config.baseUrl}/`);
|
|
114
|
+
const cleanId = postUrl.pathname.replace(/^\/|\/$/g, '');
|
|
115
|
+
if (!cleanId || seen.has(cleanId)) return;
|
|
116
|
+
seen.add(cleanId);
|
|
117
|
+
|
|
118
|
+
const rawTitle =
|
|
119
|
+
element.find('.poster-title, .entry-title, .post-title').text().trim() ||
|
|
120
|
+
element.find('img').attr('alt') ||
|
|
121
|
+
linkEl.attr('aria-label') ||
|
|
122
|
+
linkEl.attr('title') ||
|
|
123
|
+
'';
|
|
124
|
+
|
|
125
|
+
const releaseDate = extractYear(rawTitle);
|
|
126
|
+
const isSeries =
|
|
127
|
+
/\b(?:season|s\d+|web series|series)\b/i.test(rawTitle) || href.includes('season') || href.includes('series');
|
|
128
|
+
|
|
129
|
+
const title = cleanTitle(rawTitle);
|
|
130
|
+
if (!title) return;
|
|
131
|
+
|
|
132
|
+
let image =
|
|
133
|
+
element.find('img').attr('data-lazy-src') ||
|
|
134
|
+
element.find('img').attr('data-src') ||
|
|
135
|
+
element.find('img').attr('src') ||
|
|
136
|
+
'';
|
|
137
|
+
if (image.startsWith('//')) {
|
|
138
|
+
image = `https:${image}`;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
results.push({
|
|
142
|
+
id: cleanId,
|
|
143
|
+
title,
|
|
144
|
+
url: postUrl.href,
|
|
145
|
+
image,
|
|
146
|
+
releaseDate,
|
|
147
|
+
type: isSeries ? TvTypeEnum.TVSERIES : TvTypeEnum.MOVIE,
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
return results;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Search for movies/TV shows
|
|
156
|
+
* @param query search query string
|
|
157
|
+
* @param page page number (default 1)
|
|
158
|
+
*/
|
|
159
|
+
const search = async (query: string, page: number = 1): Promise<ISearch<IMovieResult>> => {
|
|
160
|
+
const searchResult: ISearch<IMovieResult> = {
|
|
161
|
+
currentPage: page,
|
|
162
|
+
hasNextPage: false,
|
|
163
|
+
results: [],
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// Primary: Typesense search.php endpoint
|
|
167
|
+
try {
|
|
168
|
+
const searchUrl = `${config.baseUrl}/search.php?q=${encodeURIComponent(query)}&page=${page}`;
|
|
169
|
+
const { data } = await axios.get(searchUrl, {
|
|
170
|
+
headers: {
|
|
171
|
+
...defaultHeaders,
|
|
172
|
+
Referer: config.baseUrl,
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
if (data && Array.isArray(data.hits) && data.hits.length > 0) {
|
|
177
|
+
const perPage = data.request_params?.per_page || 15;
|
|
178
|
+
const total = typeof data.found === 'number' ? data.found : 0;
|
|
179
|
+
searchResult.hasNextPage = page * perPage < total;
|
|
180
|
+
|
|
181
|
+
for (const hit of data.hits) {
|
|
182
|
+
const doc = hit.document;
|
|
183
|
+
if (!doc) continue;
|
|
184
|
+
|
|
185
|
+
const permalink = doc.permalink || '';
|
|
186
|
+
const postUrl = new PolyURL(permalink, `${config.baseUrl}/`);
|
|
187
|
+
const cleanId = postUrl.pathname.replace(/^\/|\/$/g, '');
|
|
188
|
+
const rawPostTitle = doc.post_title || '';
|
|
189
|
+
const title = cleanTitle(rawPostTitle);
|
|
190
|
+
|
|
191
|
+
const categories: string[] = Array.isArray(doc.category) ? doc.category : [];
|
|
192
|
+
const isSeries =
|
|
193
|
+
categories.some((c) => /series/i.test(c)) || /\b(?:season|s\d+|web series|series)\b/i.test(rawPostTitle);
|
|
194
|
+
|
|
195
|
+
searchResult.results.push({
|
|
196
|
+
id: cleanId,
|
|
197
|
+
title,
|
|
198
|
+
url: postUrl.href,
|
|
199
|
+
image: doc.post_thumbnail || '',
|
|
200
|
+
releaseDate: extractYear(rawPostTitle) || doc.post_date,
|
|
201
|
+
type: isSeries ? TvTypeEnum.TVSERIES : TvTypeEnum.MOVIE,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return searchResult;
|
|
206
|
+
}
|
|
207
|
+
} catch {
|
|
208
|
+
// Fallback to HTML scraping search
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Fallback: WordPress HTML search
|
|
212
|
+
try {
|
|
213
|
+
const fallbackUrl =
|
|
214
|
+
page === 1
|
|
215
|
+
? `${config.baseUrl}/?s=${encodeURIComponent(query)}`
|
|
216
|
+
: `${config.baseUrl}/page/${page}/?s=${encodeURIComponent(query)}`;
|
|
217
|
+
|
|
218
|
+
const { data } = await axios.get(fallbackUrl, {
|
|
219
|
+
headers: {
|
|
220
|
+
...defaultHeaders,
|
|
221
|
+
Referer: config.baseUrl,
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
const $ = load(data);
|
|
226
|
+
searchResult.results = parseHtmlGrid(data);
|
|
227
|
+
|
|
228
|
+
const navSelector = '.pagination, .nav-links';
|
|
229
|
+
searchResult.hasNextPage = $(navSelector).find('.next, a:contains("Next")').length > 0;
|
|
230
|
+
|
|
231
|
+
return searchResult;
|
|
232
|
+
} catch (err: any) {
|
|
233
|
+
throw new Error((err as Error).message);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Fetch media information (including seasons and episodes)
|
|
239
|
+
* @param mediaId media link or slug ID
|
|
240
|
+
*/
|
|
241
|
+
const fetchMediaInfo = async (mediaId: string): Promise<IMovieInfo> => {
|
|
242
|
+
let fullUrl = mediaId;
|
|
243
|
+
if (!fullUrl.startsWith('http')) {
|
|
244
|
+
fullUrl = `${config.baseUrl}/${mediaId.replace(/^\//, '')}`;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const cleanId = fullUrl.replace(/^https?:\/\/[^/]+\//, '').replace(/^\/|\/$/g, '');
|
|
248
|
+
|
|
249
|
+
const movieInfo: IMovieInfo = {
|
|
250
|
+
id: cleanId,
|
|
251
|
+
title: '',
|
|
252
|
+
url: fullUrl,
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
try {
|
|
256
|
+
const { data } = await axios.get(fullUrl, {
|
|
257
|
+
headers: {
|
|
258
|
+
...defaultHeaders,
|
|
259
|
+
Referer: config.baseUrl,
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
const $ = load(data);
|
|
264
|
+
|
|
265
|
+
// Title extraction
|
|
266
|
+
const rawTitle =
|
|
267
|
+
$('h1.entry-title').text().trim() ||
|
|
268
|
+
$('meta[property="og:title"]').attr('content') ||
|
|
269
|
+
$('h1').first().text().trim() ||
|
|
270
|
+
'';
|
|
271
|
+
movieInfo.title = cleanTitle((rawTitle.split('|')[0] || '').trim());
|
|
272
|
+
|
|
273
|
+
// Poster image
|
|
274
|
+
let image =
|
|
275
|
+
$('meta[property="og:image"]').attr('content') ||
|
|
276
|
+
$('.entry-content img[data-lazy-src]').attr('data-lazy-src') ||
|
|
277
|
+
$('.entry-content img[data-src]').attr('data-src') ||
|
|
278
|
+
$('.entry-content img').first().attr('src') ||
|
|
279
|
+
'';
|
|
280
|
+
if (image.startsWith('//')) {
|
|
281
|
+
image = `https:${image}`;
|
|
282
|
+
}
|
|
283
|
+
movieInfo.image = image;
|
|
284
|
+
|
|
285
|
+
// Synopsis / description
|
|
286
|
+
let synopsis = '';
|
|
287
|
+
const synopsisHeader = $('h3, h4, h5').filter((_, el) => /synopsis|plot/i.test($(el).text()));
|
|
288
|
+
if (synopsisHeader.length > 0) {
|
|
289
|
+
synopsis = synopsisHeader.next('p').text().trim();
|
|
290
|
+
}
|
|
291
|
+
if (!synopsis) {
|
|
292
|
+
synopsis = $('meta[property="og:description"]').attr('content')?.trim() || '';
|
|
293
|
+
}
|
|
294
|
+
movieInfo.description = synopsis;
|
|
295
|
+
|
|
296
|
+
// IMDb ID
|
|
297
|
+
const imdbMatch = $('a[href*="imdb.com"]').attr('href')?.match(/tt\d+/) || data.match(/tt\d{7,}/);
|
|
298
|
+
if (imdbMatch?.[0]) {
|
|
299
|
+
movieInfo.imdbId = imdbMatch[0];
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// Rating
|
|
303
|
+
const ratingText = $('.imdb-score, .starstruck-rating').text();
|
|
304
|
+
const ratingMatch = ratingText.match(/(\d+(?:\.\d+)?)/);
|
|
305
|
+
if (ratingMatch?.[1]) {
|
|
306
|
+
movieInfo.rating = parseFloat(ratingMatch[1]);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// Release year
|
|
310
|
+
movieInfo.releaseDate = extractYear(movieInfo.title);
|
|
311
|
+
|
|
312
|
+
// Genres
|
|
313
|
+
movieInfo.genres = $('a[rel="category tag"], .category a')
|
|
314
|
+
.map((_, el) => $(el).text().trim())
|
|
315
|
+
.get()
|
|
316
|
+
.filter((g) => g && !g.includes('1080p') && !g.includes('720p') && !g.includes('480p'));
|
|
317
|
+
|
|
318
|
+
// Determine type
|
|
319
|
+
const pageText = `${movieInfo.title} ${$('.entry-content').text()}`;
|
|
320
|
+
const isSeries =
|
|
321
|
+
/\b(?:web\s*series|season\s*\d+|s\d+\s*e\d+)\b/i.test(pageText) ||
|
|
322
|
+
$('a:contains("V-Cloud"), a:contains("vcloud")').length > 1;
|
|
323
|
+
movieInfo.type = isSeries ? TvTypeEnum.TVSERIES : TvTypeEnum.MOVIE;
|
|
324
|
+
|
|
325
|
+
// Extract quality blocks and download buttons
|
|
326
|
+
const episodesList: IMovieEpisode[] = [];
|
|
327
|
+
|
|
328
|
+
if (movieInfo.type === TvTypeEnum.TVSERIES) {
|
|
329
|
+
// Collect season intermediate links
|
|
330
|
+
type SeasonPack = {
|
|
331
|
+
title: string;
|
|
332
|
+
season: number;
|
|
333
|
+
url: string;
|
|
334
|
+
};
|
|
335
|
+
const seasonPacks: SeasonPack[] = [];
|
|
336
|
+
|
|
337
|
+
$('h3, h4, h5, p').each((_, element) => {
|
|
338
|
+
const el = $(element);
|
|
339
|
+
const blockText = el.text().trim();
|
|
340
|
+
if (/season\s*\d+|s\d+/i.test(blockText)) {
|
|
341
|
+
const seasonNum = extractSeasonNumber(blockText);
|
|
342
|
+
|
|
343
|
+
let nextP = el.next();
|
|
344
|
+
while (nextP.length && !nextP.is('p') && !nextP.find('a[href]').length) {
|
|
345
|
+
nextP = nextP.next();
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// Prefer V-Cloud link, avoid Zip / Batch
|
|
349
|
+
let btn = nextP.find('a:contains("V-Cloud"), a:contains("vcloud"), a[href*="vcloud"]').first();
|
|
350
|
+
if (!btn.length) {
|
|
351
|
+
btn = nextP
|
|
352
|
+
.find('a')
|
|
353
|
+
.filter((_, a) => {
|
|
354
|
+
const txt = $(a).text().toLowerCase();
|
|
355
|
+
const href = ($(a).attr('href') || '').toLowerCase();
|
|
356
|
+
return (
|
|
357
|
+
!txt.includes('zip') && !txt.includes('batch') && !href.includes('zip') && !href.includes('batch')
|
|
358
|
+
);
|
|
359
|
+
})
|
|
360
|
+
.first();
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
const btnHref = btn.attr('href');
|
|
364
|
+
if (btnHref && btnHref.startsWith('http')) {
|
|
365
|
+
seasonPacks.push({
|
|
366
|
+
title: blockText,
|
|
367
|
+
season: seasonNum,
|
|
368
|
+
url: btnHref,
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
const getPackPriority = (t: string): number => {
|
|
375
|
+
if (/1080p|2160p|4k/i.test(t)) return 3;
|
|
376
|
+
if (/720p/i.test(t)) return 2;
|
|
377
|
+
if (/480p/i.test(t)) return 1;
|
|
378
|
+
return 0;
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
// Deduplicate season packs: pick highest quality pack per season
|
|
382
|
+
const selectedPacksBySeason = new Map<number, SeasonPack>();
|
|
383
|
+
for (const pack of seasonPacks) {
|
|
384
|
+
if (!selectedPacksBySeason.has(pack.season)) {
|
|
385
|
+
selectedPacksBySeason.set(pack.season, pack);
|
|
386
|
+
} else {
|
|
387
|
+
const existing = selectedPacksBySeason.get(pack.season)!;
|
|
388
|
+
if (getPackPriority(pack.title) > getPackPriority(existing.title)) {
|
|
389
|
+
selectedPacksBySeason.set(pack.season, pack);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// Fetch episodes from each season pack's intermediate page
|
|
395
|
+
const packResults = await Promise.allSettled(
|
|
396
|
+
Array.from(selectedPacksBySeason.values()).map(async (pack) => {
|
|
397
|
+
const res = await axios.get(pack.url, {
|
|
398
|
+
headers: {
|
|
399
|
+
...defaultHeaders,
|
|
400
|
+
Referer: fullUrl,
|
|
401
|
+
},
|
|
402
|
+
});
|
|
403
|
+
const $ep = load(res.data);
|
|
404
|
+
const eps: IMovieEpisode[] = [];
|
|
405
|
+
|
|
406
|
+
$ep('h3, h4, h5, p').each((_, element) => {
|
|
407
|
+
const el = $ep(element);
|
|
408
|
+
const text = el.text().trim();
|
|
409
|
+
if (/episodes?\s*[:\d\-]/i.test(text) || /e\d{1,3}\b/i.test(text) || /^episode\s*\d+/i.test(text)) {
|
|
410
|
+
const epTitle = text
|
|
411
|
+
.replace(/\s+/g, ' ')
|
|
412
|
+
.trim()
|
|
413
|
+
.replace(/^[-:\s]+|[-:\s]+$/g, '')
|
|
414
|
+
.replace(/^episodes?\s*:\s*/i, 'Episode ');
|
|
415
|
+
|
|
416
|
+
const epNumMatch = epTitle.match(/\b(?:episode|e)\s*(\d+)/i);
|
|
417
|
+
const epNumber = epNumMatch && epNumMatch[1] ? parseInt(epNumMatch[1], 10) : undefined;
|
|
418
|
+
|
|
419
|
+
let nextP = el.next();
|
|
420
|
+
while (nextP.length && !nextP.is('p') && !nextP.find('a[href]').length) {
|
|
421
|
+
nextP = nextP.next();
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
const link =
|
|
425
|
+
nextP.find('a[href*="vcloud"]').attr('href') ||
|
|
426
|
+
nextP.find('a[href*="hubcloud"]').attr('href') ||
|
|
427
|
+
nextP.find('a[href*="fastdl"]').attr('href') ||
|
|
428
|
+
nextP.find('.btn-outline').parent().attr('href') ||
|
|
429
|
+
nextP.find('.btn-outline').attr('href') ||
|
|
430
|
+
nextP.find('a[href]').first().attr('href');
|
|
431
|
+
|
|
432
|
+
if (link && link.startsWith('http') && !eps.some((e) => e.url === link)) {
|
|
433
|
+
eps.push({
|
|
434
|
+
id: link,
|
|
435
|
+
title: epTitle,
|
|
436
|
+
number: epNumber,
|
|
437
|
+
season: pack.season,
|
|
438
|
+
url: link,
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
return eps;
|
|
445
|
+
})
|
|
446
|
+
);
|
|
447
|
+
|
|
448
|
+
for (const r of packResults) {
|
|
449
|
+
if (r.status === 'fulfilled' && Array.isArray(r.value)) {
|
|
450
|
+
episodesList.push(...r.value);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// Fallback: If no episodes resolved from intermediate page, expose season pack links as episodes
|
|
455
|
+
if (episodesList.length === 0 && seasonPacks.length > 0) {
|
|
456
|
+
for (let i = 0; i < seasonPacks.length; i++) {
|
|
457
|
+
const sp = seasonPacks[i];
|
|
458
|
+
if (sp) {
|
|
459
|
+
episodesList.push({
|
|
460
|
+
id: sp.url,
|
|
461
|
+
title: sp.title || `Season ${sp.season}`,
|
|
462
|
+
season: sp.season,
|
|
463
|
+
number: i + 1,
|
|
464
|
+
url: sp.url,
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
} else {
|
|
470
|
+
// Movie: extract quality options
|
|
471
|
+
let count = 0;
|
|
472
|
+
$('h3, h4, h5, p').each((_, element) => {
|
|
473
|
+
const el = $(element);
|
|
474
|
+
const text = el.text().trim();
|
|
475
|
+
const qualityMatch = text.match(/\d+p\b/i);
|
|
476
|
+
|
|
477
|
+
let nextP = el.next();
|
|
478
|
+
while (nextP.length && !nextP.is('p') && !nextP.find('a[href]').length) {
|
|
479
|
+
nextP = nextP.next();
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
const btn =
|
|
483
|
+
nextP.find('a[href*="nexdrive"], a[href*="vcloud"], a[href*="hubcloud"], a[href*="fastdl"]').first()
|
|
484
|
+
.length > 0
|
|
485
|
+
? nextP.find('a[href*="nexdrive"], a[href*="vcloud"], a[href*="hubcloud"], a[href*="fastdl"]').first()
|
|
486
|
+
: nextP.find('.dwd-button, .btn-outline').first().is('a')
|
|
487
|
+
? nextP.find('.dwd-button, .btn-outline').first()
|
|
488
|
+
: nextP.find('.dwd-button, .btn-outline').first().parent('a');
|
|
489
|
+
|
|
490
|
+
const btnHref = btn.attr('href');
|
|
491
|
+
if (btnHref && btnHref.startsWith('http') && !episodesList.some((e) => e.url === btnHref)) {
|
|
492
|
+
count++;
|
|
493
|
+
episodesList.push({
|
|
494
|
+
id: btnHref,
|
|
495
|
+
title: text || `${movieInfo.title} ${qualityMatch ? qualityMatch[0] : 'HD'}`,
|
|
496
|
+
number: count,
|
|
497
|
+
season: 1,
|
|
498
|
+
url: btnHref,
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
});
|
|
502
|
+
|
|
503
|
+
// If no quality blocks found, check for generic download buttons
|
|
504
|
+
if (episodesList.length === 0) {
|
|
505
|
+
$('a[href*="nexdrive.fit"], a[href*="vcloud"], a[href*="hubcloud"]').each((i, el) => {
|
|
506
|
+
const href = $(el).attr('href');
|
|
507
|
+
if (href && href.startsWith('http') && !episodesList.some((e) => e.url === href)) {
|
|
508
|
+
episodesList.push({
|
|
509
|
+
id: href,
|
|
510
|
+
title: `${movieInfo.title} Option ${i + 1}`,
|
|
511
|
+
number: i + 1,
|
|
512
|
+
season: 1,
|
|
513
|
+
url: href,
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
// Final fallback: at least 1 episode pointing to the media URL
|
|
521
|
+
if (episodesList.length === 0) {
|
|
522
|
+
episodesList.push({
|
|
523
|
+
id: movieInfo.url || fullUrl,
|
|
524
|
+
title: movieInfo.title || 'Movie',
|
|
525
|
+
url: movieInfo.url || fullUrl,
|
|
526
|
+
number: 1,
|
|
527
|
+
season: 1,
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
movieInfo.episodes = episodesList;
|
|
532
|
+
movieInfo.totalEpisodes = episodesList.length;
|
|
533
|
+
|
|
534
|
+
return movieInfo;
|
|
535
|
+
} catch (err: any) {
|
|
536
|
+
throw new Error((err as Error).message);
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Fetch available servers for a given episode
|
|
542
|
+
* @param episodeId episode URL or intermediate link
|
|
543
|
+
* @param mediaId optional media link or slug
|
|
544
|
+
*/
|
|
545
|
+
const fetchEpisodeServers = async (episodeId: string, mediaId?: string): Promise<IEpisodeServer[]> => {
|
|
546
|
+
const servers: IEpisodeServer[] = [];
|
|
547
|
+
|
|
548
|
+
let resolvedUrl = episodeId;
|
|
549
|
+
if (!resolvedUrl.startsWith('http')) {
|
|
550
|
+
try {
|
|
551
|
+
const info = await fetchMediaInfo(episodeId);
|
|
552
|
+
const firstEp = info.episodes?.[0];
|
|
553
|
+
if (firstEp?.url) {
|
|
554
|
+
resolvedUrl = firstEp.url;
|
|
555
|
+
}
|
|
556
|
+
} catch {}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
if (!resolvedUrl.startsWith('http')) {
|
|
560
|
+
return [{ name: 'HubCloud', url: episodeId }];
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// If already direct V-Cloud / HubCloud link
|
|
564
|
+
if (resolvedUrl.includes('vcloud') || resolvedUrl.includes('hubcloud')) {
|
|
565
|
+
try {
|
|
566
|
+
const hubCloudExtractor = HubCloud(ctx);
|
|
567
|
+
const hubRes = await hubCloudExtractor.extract(new PolyURL(resolvedUrl));
|
|
568
|
+
if (hubRes?.sources && hubRes.sources.length > 0) {
|
|
569
|
+
for (const s of hubRes.sources) {
|
|
570
|
+
const sName = (s as any).server || s.quality || 'HubCloud';
|
|
571
|
+
if (!servers.some((srv) => srv.name === sName)) {
|
|
572
|
+
servers.push({
|
|
573
|
+
name: sName,
|
|
574
|
+
url: s.url,
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
} catch {}
|
|
580
|
+
|
|
581
|
+
if (!servers.some((s) => s.name.toLowerCase() === 'hubcloud')) {
|
|
582
|
+
servers.push({ name: 'HubCloud', url: resolvedUrl });
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
return servers;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
// If intermediate page (e.g. nexdrive.fit)
|
|
589
|
+
try {
|
|
590
|
+
const { data } = await axios.get(resolvedUrl, {
|
|
591
|
+
headers: {
|
|
592
|
+
...defaultHeaders,
|
|
593
|
+
Referer: config.baseUrl,
|
|
594
|
+
},
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
const $ = load(data);
|
|
598
|
+
|
|
599
|
+
const vcloudLink = $('a[href*="vcloud"], a[href*="hubcloud"]').attr('href');
|
|
600
|
+
if (vcloudLink) {
|
|
601
|
+
try {
|
|
602
|
+
const hubCloudExtractor = HubCloud(ctx);
|
|
603
|
+
const hubRes = await hubCloudExtractor.extract(new PolyURL(vcloudLink));
|
|
604
|
+
if (hubRes?.sources && hubRes.sources.length > 0) {
|
|
605
|
+
for (const s of hubRes.sources) {
|
|
606
|
+
const sName = (s as any).server || s.quality || 'HubCloud';
|
|
607
|
+
if (!servers.some((srv) => srv.name === sName)) {
|
|
608
|
+
servers.push({
|
|
609
|
+
name: sName,
|
|
610
|
+
url: s.url,
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
} catch {}
|
|
616
|
+
|
|
617
|
+
if (!servers.some((s) => s.name.toLowerCase() === 'hubcloud')) {
|
|
618
|
+
servers.push({ name: 'HubCloud', url: vcloudLink });
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
const gdirectLink = $('a[href*="fastdl"], a:contains("G-Direct")').attr('href');
|
|
623
|
+
if (gdirectLink) {
|
|
624
|
+
servers.push({ name: 'FastDL', url: gdirectLink });
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
const filepressLink = $('a[href*="filebee"], a[href*="filepress"]').attr('href');
|
|
628
|
+
if (filepressLink) {
|
|
629
|
+
servers.push({ name: 'Filepress', url: filepressLink });
|
|
630
|
+
}
|
|
631
|
+
} catch {
|
|
632
|
+
// Ignore intermediate page parse error
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
if (servers.length === 0) {
|
|
636
|
+
servers.push({ name: 'HubCloud', url: resolvedUrl });
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
return servers;
|
|
640
|
+
};
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* Fetch streaming sources for an episode
|
|
644
|
+
* @param episodeId episode URL (vcloud link, nexdrive intermediate link, or slug)
|
|
645
|
+
* @param mediaId media link or slug (optional)
|
|
646
|
+
* @param server requested server (default HubCloud)
|
|
647
|
+
*/
|
|
648
|
+
const fetchEpisodeSources = async (
|
|
649
|
+
episodeId: string,
|
|
650
|
+
mediaId?: string,
|
|
651
|
+
server: StreamingServers | string = StreamingServersEnum.HubCloud
|
|
652
|
+
): Promise<ISource> => {
|
|
653
|
+
let resolvedUrl = episodeId;
|
|
654
|
+
|
|
655
|
+
// If episodeId is not an HTTP URL, resolve via fetchMediaInfo
|
|
656
|
+
if (!resolvedUrl.startsWith('http')) {
|
|
657
|
+
const info = await fetchMediaInfo(episodeId);
|
|
658
|
+
const firstEp = info.episodes?.[0];
|
|
659
|
+
if (firstEp?.url) {
|
|
660
|
+
resolvedUrl = firstEp.url;
|
|
661
|
+
} else {
|
|
662
|
+
throw new Error(`Unable to resolve episode source for ${episodeId}`);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
const epQualityMatch = resolvedUrl.match(/\b(2160p|4k|1080p|720p|480p|360p)\b/i);
|
|
667
|
+
const epQuality = epQualityMatch
|
|
668
|
+
? epQualityMatch[1]!.toLowerCase() === '4k'
|
|
669
|
+
? '2160p'
|
|
670
|
+
: epQualityMatch[1]!.toLowerCase()
|
|
671
|
+
: 'auto';
|
|
672
|
+
|
|
673
|
+
const extraSources: IVideo[] = [];
|
|
674
|
+
|
|
675
|
+
// If not a direct cloud link (e.g. intermediate dotlink / nexdrive page)
|
|
676
|
+
if (!resolvedUrl.includes('cloud')) {
|
|
677
|
+
try {
|
|
678
|
+
const dotlinkRes = await axios.get(resolvedUrl, { headers: defaultHeaders });
|
|
679
|
+
const dotlinkText = dotlinkRes.data;
|
|
680
|
+
|
|
681
|
+
// Extract vlink (HubCloud / V-Cloud)
|
|
682
|
+
const vlinkMatch = dotlinkText.match(/<a\s+href="([^"]*cloud\.[^"]*)"/i);
|
|
683
|
+
if (vlinkMatch?.[1]) {
|
|
684
|
+
resolvedUrl = vlinkMatch[1];
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
// Extract FastDL direct stream if available
|
|
688
|
+
const fastdlMatch = dotlinkText.match(/<a\s+href="([^"]*fastdl\.[^"]*)"/i);
|
|
689
|
+
if (fastdlMatch?.[1]) {
|
|
690
|
+
try {
|
|
691
|
+
const fdlRes = await axios.get(fastdlMatch[1], {
|
|
692
|
+
headers: { ...defaultHeaders, Referer: resolvedUrl },
|
|
693
|
+
});
|
|
694
|
+
const reurlMatch = fdlRes.data.match(/var\s+reurl\s*=\s*['"]([^'"]+)['"]/);
|
|
695
|
+
if (reurlMatch?.[1]) {
|
|
696
|
+
extraSources.push({
|
|
697
|
+
url: reurlMatch[1],
|
|
698
|
+
server: 'FastDL',
|
|
699
|
+
quality: epQuality,
|
|
700
|
+
isM3U8: false,
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
} catch {}
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// Extract Filepress stream if available (as in reference stream.ts)
|
|
707
|
+
try {
|
|
708
|
+
const $ = load(dotlinkText);
|
|
709
|
+
const filepressLink =
|
|
710
|
+
$('.btn.btn-sm.btn-outline[style*="rgb(252,185,0)"]').parent().attr('href') ||
|
|
711
|
+
$('a[href*="filebee"], a[href*="filepress"]').attr('href');
|
|
712
|
+
|
|
713
|
+
if (filepressLink) {
|
|
714
|
+
const filepressID = filepressLink.split('/').filter(Boolean).pop();
|
|
715
|
+
const filepressBaseUrl = filepressLink.split('/').slice(0, 3).join('/');
|
|
716
|
+
|
|
717
|
+
const fpRes1 = await axios.post(
|
|
718
|
+
`${filepressBaseUrl}/api/file/downlaod/`,
|
|
719
|
+
{ id: filepressID, method: 'indexDownlaod', captchaValue: null },
|
|
720
|
+
{
|
|
721
|
+
headers: {
|
|
722
|
+
'Content-Type': 'application/json',
|
|
723
|
+
'Referer': filepressBaseUrl,
|
|
724
|
+
},
|
|
725
|
+
}
|
|
726
|
+
);
|
|
727
|
+
|
|
728
|
+
if (fpRes1.data?.status && fpRes1.data?.data) {
|
|
729
|
+
const fpToken = fpRes1.data.data;
|
|
730
|
+
const fpRes2 = await axios.post(
|
|
731
|
+
`${filepressBaseUrl}/api/file/downlaod2/`,
|
|
732
|
+
{ id: fpToken, method: 'indexDownlaod', captchaValue: null },
|
|
733
|
+
{
|
|
734
|
+
headers: {
|
|
735
|
+
'Content-Type': 'application/json',
|
|
736
|
+
'Referer': filepressBaseUrl,
|
|
737
|
+
},
|
|
738
|
+
}
|
|
739
|
+
);
|
|
740
|
+
|
|
741
|
+
const fpStreamUrl = fpRes2.data?.data?.[0];
|
|
742
|
+
if (fpStreamUrl && fpStreamUrl.startsWith('http')) {
|
|
743
|
+
extraSources.push({
|
|
744
|
+
url: fpStreamUrl,
|
|
745
|
+
server: 'Filepress',
|
|
746
|
+
quality: epQuality,
|
|
747
|
+
isM3U8: false,
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
} catch {}
|
|
753
|
+
} catch {}
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
// If resolvedUrl is a FastDL link directly
|
|
757
|
+
if (resolvedUrl.includes('fastdl.zip')) {
|
|
758
|
+
try {
|
|
759
|
+
const { data } = await axios.get(resolvedUrl, {
|
|
760
|
+
headers: {
|
|
761
|
+
...defaultHeaders,
|
|
762
|
+
Referer: 'https://nexdrive.fit/',
|
|
763
|
+
},
|
|
764
|
+
});
|
|
765
|
+
|
|
766
|
+
const reurlMatch = data.match(/var\s+reurl\s*=\s*['"]([^'"]+)['"]/);
|
|
767
|
+
const directUrl = reurlMatch ? reurlMatch[1] : resolvedUrl;
|
|
768
|
+
|
|
769
|
+
return {
|
|
770
|
+
headers: { Referer: 'https://fastdl.zip/' },
|
|
771
|
+
sources: [{ url: directUrl, server: 'FastDL', quality: epQuality, isM3U8: false }, ...extraSources],
|
|
772
|
+
download: directUrl,
|
|
773
|
+
};
|
|
774
|
+
} catch {}
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
// HubCloud extraction
|
|
778
|
+
let hubCloudSources: IVideo[] = [];
|
|
779
|
+
let hubHeaders: Record<string, string> = { Referer: config.baseUrl };
|
|
780
|
+
|
|
781
|
+
if (resolvedUrl.includes('cloud')) {
|
|
782
|
+
try {
|
|
783
|
+
const hubCloudExtractor = HubCloud(ctx);
|
|
784
|
+
const hubCloudRes = await hubCloudExtractor.extract(new PolyURL(resolvedUrl));
|
|
785
|
+
if (hubCloudRes?.sources && Array.isArray(hubCloudRes.sources)) {
|
|
786
|
+
hubCloudSources = hubCloudRes.sources.map((s: IVideo) => ({
|
|
787
|
+
...s,
|
|
788
|
+
server: (s as any).server || s.quality || 'HubCloud',
|
|
789
|
+
quality:
|
|
790
|
+
s.quality && s.quality !== 'auto' && !/\b(?:server|worker|storage|drain|bot|cloud)\b/i.test(s.quality)
|
|
791
|
+
? s.quality
|
|
792
|
+
: epQuality !== 'auto'
|
|
793
|
+
? epQuality
|
|
794
|
+
: 'auto',
|
|
795
|
+
}));
|
|
796
|
+
if (hubCloudRes.headers) {
|
|
797
|
+
hubHeaders = hubCloudRes.headers;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
} catch {}
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
let allSources = [...extraSources, ...hubCloudSources];
|
|
804
|
+
|
|
805
|
+
// Filter or prioritize requested server if specified and not 'hubcloud'
|
|
806
|
+
if (server && server.toLowerCase() !== 'hubcloud') {
|
|
807
|
+
const serverLower = server.toLowerCase();
|
|
808
|
+
const matched = allSources.filter((s) => (s.server || '').toLowerCase().includes(serverLower));
|
|
809
|
+
if (matched.length > 0) {
|
|
810
|
+
const others = allSources.filter((s) => !(s.server || '').toLowerCase().includes(serverLower));
|
|
811
|
+
allSources = [...matched, ...others];
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
if (allSources.length === 0) {
|
|
816
|
+
throw new Error(`[VegaMovies] No streamable video sources found for ${episodeId}`);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
return {
|
|
820
|
+
headers: hubHeaders,
|
|
821
|
+
sources: allSources,
|
|
822
|
+
download: allSources[0]?.url,
|
|
823
|
+
};
|
|
824
|
+
};
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Fetch latest releases from homepage
|
|
828
|
+
* @param page page number (default 1)
|
|
829
|
+
*/
|
|
830
|
+
const fetchLatest = async (page: number = 1): Promise<ISearch<IMovieResult>> => {
|
|
831
|
+
const searchResult: ISearch<IMovieResult> = {
|
|
832
|
+
currentPage: page,
|
|
833
|
+
hasNextPage: false,
|
|
834
|
+
results: [],
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
try {
|
|
838
|
+
const url = page === 1 ? `${config.baseUrl}/` : `${config.baseUrl}/page/${page}/`;
|
|
839
|
+
const { data } = await axios.get(url, {
|
|
840
|
+
headers: {
|
|
841
|
+
...defaultHeaders,
|
|
842
|
+
Referer: config.baseUrl,
|
|
843
|
+
},
|
|
844
|
+
});
|
|
845
|
+
|
|
846
|
+
const $ = load(data);
|
|
847
|
+
searchResult.results = parseHtmlGrid(data);
|
|
848
|
+
|
|
849
|
+
const navSelector = '.pagination, .nav-links';
|
|
850
|
+
searchResult.hasNextPage = $(navSelector).find('.next, a:contains("Next")').length > 0;
|
|
851
|
+
|
|
852
|
+
return searchResult;
|
|
853
|
+
} catch (err: any) {
|
|
854
|
+
throw new Error((err as Error).message);
|
|
855
|
+
}
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
/**
|
|
859
|
+
* Fetch recent movies
|
|
860
|
+
*/
|
|
861
|
+
const fetchRecentMovies = async (page: number = 1): Promise<ISearch<IMovieResult>> => {
|
|
862
|
+
return fetchByFilter('category/movies-by-genres', page);
|
|
863
|
+
};
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Fetch recent TV shows
|
|
867
|
+
*/
|
|
868
|
+
const fetchRecentTVShows = async (page: number = 1): Promise<ISearch<IMovieResult>> => {
|
|
869
|
+
return fetchByFilter('web-series', page);
|
|
870
|
+
};
|
|
871
|
+
|
|
872
|
+
/**
|
|
873
|
+
* Fetch movies/shows by category filter
|
|
874
|
+
* @param filter path filter (e.g. 'web-series/netflix')
|
|
875
|
+
* @param page page number (default 1)
|
|
876
|
+
*/
|
|
877
|
+
const fetchByFilter = async (filter: string, page: number = 1): Promise<ISearch<IMovieResult>> => {
|
|
878
|
+
const searchResult: ISearch<IMovieResult> = {
|
|
879
|
+
currentPage: page,
|
|
880
|
+
hasNextPage: false,
|
|
881
|
+
results: [],
|
|
882
|
+
};
|
|
883
|
+
|
|
884
|
+
try {
|
|
885
|
+
const cleanFilter = filter.replace(/^\/|\/$/g, '');
|
|
886
|
+
const url = page === 1 ? `${config.baseUrl}/${cleanFilter}/` : `${config.baseUrl}/${cleanFilter}/page/${page}/`;
|
|
887
|
+
|
|
888
|
+
const { data } = await axios.get(url, {
|
|
889
|
+
headers: {
|
|
890
|
+
...defaultHeaders,
|
|
891
|
+
Referer: config.baseUrl,
|
|
892
|
+
},
|
|
893
|
+
});
|
|
894
|
+
|
|
895
|
+
const $ = load(data);
|
|
896
|
+
searchResult.results = parseHtmlGrid(data);
|
|
897
|
+
|
|
898
|
+
const navSelector = '.pagination, .nav-links';
|
|
899
|
+
searchResult.hasNextPage = $(navSelector).find('.next, a:contains("Next")').length > 0;
|
|
900
|
+
|
|
901
|
+
return searchResult;
|
|
902
|
+
} catch (err: any) {
|
|
903
|
+
throw new Error((err as Error).message);
|
|
904
|
+
}
|
|
905
|
+
};
|
|
906
|
+
|
|
907
|
+
return {
|
|
908
|
+
...config,
|
|
909
|
+
supportedTypes,
|
|
910
|
+
search,
|
|
911
|
+
fetchMediaInfo,
|
|
912
|
+
fetchEpisodeServers,
|
|
913
|
+
fetchEpisodeSources,
|
|
914
|
+
fetchLatest,
|
|
915
|
+
fetchRecentMovies,
|
|
916
|
+
fetchRecentTVShows,
|
|
917
|
+
fetchByFilter,
|
|
918
|
+
};
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
export type VegaMoviesProviderInstance = ReturnType<typeof createVegaMovies>;
|