From 4dd72058c24866bb05245628195319fea5d2e3ba Mon Sep 17 00:00:00 2001 From: LagradOst <11805592+LagradOst@users.noreply.github.com> Date: Sun, 31 Jul 2022 17:02:22 +0200 Subject: [PATCH] updated mainapi --- .../com/lagradost/cloudstream3/MainAPI.kt | 37 ++++++++++++++++++- .../animeproviders/AllAnimeProvider.kt | 2 +- .../animeproviders/AniPlayProvider.kt | 2 +- .../animeproviders/AniflixProvider.kt | 2 +- .../animeproviders/AnimeIndoProvider.kt | 2 +- .../animeproviders/AnimePaheProvider.kt | 2 +- .../animeproviders/AnimeSailProvider.kt | 2 +- .../animeproviders/AnimeSaturnProvider.kt | 2 +- .../animeproviders/AnimeWorldProvider.kt | 2 +- .../animeproviders/AnimefenixProvider.kt | 2 +- .../animeproviders/AnimeflvIOProvider.kt | 2 +- .../animeproviders/AnimeflvProvider.kt | 2 +- .../animeproviders/AnimekisaProvider.kt | 2 +- .../animeproviders/DubbedAnimeProvider.kt | 2 +- .../animeproviders/GogoanimeProvider.kt | 9 ++--- .../animeproviders/GomunimeProvider.kt | 2 +- .../animeproviders/JKAnimeProvider.kt | 2 +- .../animeproviders/KawaiifuProvider.kt | 2 +- .../animeproviders/KimCartoonProvider.kt | 2 +- .../animeproviders/KuramanimeProvider.kt | 2 +- .../animeproviders/KuronimeProvider.kt | 2 +- .../animeproviders/MonoschinosProvider.kt | 2 +- .../animeproviders/MundoDonghuaProvider.kt | 2 +- .../animeproviders/NeonimeProvider.kt | 2 +- .../animeproviders/NineAnimeProvider.kt | 14 +++---- .../animeproviders/NontonAnimeIDProvider.kt | 2 +- .../animeproviders/OploverzProvider.kt | 2 +- .../animeproviders/OtakudesuProvider.kt | 3 +- .../animeproviders/TenshiProvider.kt | 2 +- .../animeproviders/TocanimeProvider.kt | 2 +- .../animeproviders/WcoProvider.kt | 2 +- .../animeproviders/ZoroProvider.kt | 2 +- .../cloudstream3/liveproviders/EjaTv.kt | 2 +- .../metaproviders/TmdbProvider.kt | 2 +- .../movieproviders/AkwamProvider.kt | 2 +- .../movieproviders/AllMoviesForYouProvider.kt | 2 +- .../movieproviders/AltadefinizioneProvider.kt | 10 ++--- .../movieproviders/AsiaFlixProvider.kt | 2 +- .../movieproviders/BflixProvider.kt | 2 +- .../movieproviders/CimaNowProvider.kt | 2 +- .../movieproviders/CineblogProvider.kt | 7 ++-- .../movieproviders/CinecalidadProvider.kt | 7 ++-- .../movieproviders/CuevanaProvider.kt | 2 +- .../movieproviders/DoramasYTProvider.kt | 2 +- .../movieproviders/DramaSeeProvider.kt | 2 +- .../movieproviders/DramaidProvider.kt | 2 +- .../movieproviders/EgyBestProvider.kt | 2 +- .../movieproviders/ElifilmsProvider.kt | 2 +- .../EntrepeliculasyseriesProvider.kt | 7 ++-- .../movieproviders/EstrenosDoramasProvider.kt | 2 +- .../movieproviders/FaselHDProvider.kt | 2 +- .../movieproviders/FilmanProvider.kt | 2 +- .../movieproviders/FilmpertuttiProvider.kt | 8 ++-- .../movieproviders/FrenchStreamProvider.kt | 2 +- .../movieproviders/HDMProvider.kt | 2 +- .../cloudstream3/movieproviders/HDMovie5.kt | 2 +- .../movieproviders/HDrezkaProvider.kt | 2 +- .../movieproviders/IHaveNoTvProvider.kt | 2 +- .../movieproviders/IdlixProvider.kt | 2 +- .../movieproviders/KdramaHoodProvider.kt | 2 +- .../movieproviders/LayarKacaProvider.kt | 2 +- .../movieproviders/MultiplexProvider.kt | 2 +- .../movieproviders/MyCimaProvider.kt | 2 +- .../movieproviders/NginxProvider.kt | 2 +- .../movieproviders/PeliSmartProvider.kt | 2 +- .../movieproviders/PelisflixProvider.kt | 2 +- .../movieproviders/PelisplusHDProvider.kt | 2 +- .../PelisplusProviderTemplate.kt | 2 +- .../movieproviders/PhimmoichillProvider.kt | 2 +- .../movieproviders/PinoyHDXyzProvider.kt | 2 +- .../movieproviders/PinoyMoviePediaProvider.kt | 2 +- .../movieproviders/PinoyMoviesEsProvider.kt | 2 +- .../movieproviders/RebahinProvider.kt | 2 +- .../movieproviders/SeriesflixProvider.kt | 2 +- .../movieproviders/SflixProvider.kt | 2 +- .../movieproviders/SoaptwoDayProvider.kt | 7 ++-- .../StreamingcommunityProvider.kt | 2 +- .../movieproviders/TantiFilmProvider.kt | 7 ++-- .../movieproviders/TheFlixToProvider.kt | 2 +- .../movieproviders/UakinoProvider.kt | 2 +- .../VidstreamProviderTemplate.kt | 2 +- .../movieproviders/WatchAsianProvider.kt | 2 +- .../movieproviders/XcineProvider.kt | 2 +- .../movieproviders/YomoviesProvider.kt | 2 +- .../cloudstream3/ui/APIRepository.kt | 4 +- 85 files changed, 143 insertions(+), 123 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt b/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt index 2b393a05..8e3d8975 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt @@ -382,6 +382,11 @@ data class MainPageData( val data: String, ) +data class MainPageRequest( + val name: String, + val data: String, +) + /** return list of MainPageData with url to name, make for more readable code */ fun mainPageOf(vararg elements: Pair): List { return elements.map { (url, name) -> MainPageData(name = name, data = url) } @@ -462,8 +467,7 @@ abstract class MainAPI { @WorkerThread open suspend fun getMainPage( page: Int, - categoryName: String, - categoryData: String + request: MainPageRequest, ): HomePageResponse? { throw NotImplementedError() } @@ -957,6 +961,7 @@ interface LoadResponse { var comingSoon: Boolean var syncData: MutableMap var posterHeaders: Map? + var backgroundPosterUrl: String? companion object { private val malIdPrefix = malApi.idPrefix @@ -1100,9 +1105,30 @@ data class NextAiring( val unixTime: Long, ) +data class SeasonData( + val season: Int, + val name: String? = null, +) + interface EpisodeResponse { var showStatus: ShowStatus? var nextAiring: NextAiring? + var seasonNames: List? +} + +@JvmName("addSeasonNamesString") +fun EpisodeResponse.addSeasonNames(names: List) { + this.seasonNames = if (names.isEmpty()) null else names.mapIndexed { index, s -> + SeasonData( + season = index + 1, + s + ) + } +} + +@JvmName("addSeasonNamesSeasonData") +fun EpisodeResponse.addSeasonNames(names: List) { + this.seasonNames = names.ifEmpty { null } } data class TorrentLoadResponse( @@ -1124,6 +1150,7 @@ data class TorrentLoadResponse( override var comingSoon: Boolean = false, override var syncData: MutableMap = mutableMapOf(), override var posterHeaders: Map? = null, + override var backgroundPosterUrl: String? = null, ) : LoadResponse data class AnimeLoadResponse( @@ -1153,6 +1180,8 @@ data class AnimeLoadResponse( override var syncData: MutableMap = mutableMapOf(), override var posterHeaders: Map? = null, override var nextAiring: NextAiring? = null, + override var seasonNames: List? = null, + override var backgroundPosterUrl: String? = null, ) : LoadResponse, EpisodeResponse fun AnimeLoadResponse.addEpisodes(status: DubStatus, episodes: List?) { @@ -1200,6 +1229,7 @@ data class LiveStreamLoadResponse( override var comingSoon: Boolean = false, override var syncData: MutableMap = mutableMapOf(), override var posterHeaders: Map? = null, + override var backgroundPosterUrl: String? = null, ) : LoadResponse data class MovieLoadResponse( @@ -1222,6 +1252,7 @@ data class MovieLoadResponse( override var comingSoon: Boolean = false, override var syncData: MutableMap = mutableMapOf(), override var posterHeaders: Map? = null, + override var backgroundPosterUrl: String? = null, ) : LoadResponse suspend fun MainAPI.newMovieLoadResponse( @@ -1344,6 +1375,8 @@ data class TvSeriesLoadResponse( override var syncData: MutableMap = mutableMapOf(), override var posterHeaders: Map? = null, override var nextAiring: NextAiring? = null, + override var seasonNames: List? = null, + override var backgroundPosterUrl: String? = null, ) : LoadResponse, EpisodeResponse suspend fun MainAPI.newTvSeriesLoadResponse( diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AllAnimeProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AllAnimeProvider.kt index fe207cd3..836b5f10 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AllAnimeProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AllAnimeProvider.kt @@ -104,7 +104,7 @@ class AllAnimeProvider : MainAPI() { @JsonProperty("__typename") val _typename: String? = null ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val items = ArrayList() val urls = listOf( // Pair( diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AniPlayProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AniPlayProvider.kt index 1ea3f151..9edfa813 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AniPlayProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AniPlayProvider.kt @@ -114,7 +114,7 @@ class AniPlayProvider : MainAPI() { @JsonProperty("videoUrl") val url: String ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val response = app.get("$mainUrl/api/home/latest-episodes?page=0").parsed>() val results = response.map{ diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AniflixProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AniflixProvider.kt index 5500b57b..8142f0bb 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AniflixProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AniflixProvider.kt @@ -44,7 +44,7 @@ class AniflixProvider : MainAPI() { } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val items = ArrayList() val soup = app.get(mainUrl).document val elements = listOf( diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeIndoProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeIndoProvider.kt index 1e01f266..4a2867a7 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeIndoProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeIndoProvider.kt @@ -62,7 +62,7 @@ class AnimeIndoProvider : MainAPI() { } } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = request(mainUrl).document val homePageList = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimePaheProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimePaheProvider.kt index 28375616..20a485ea 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimePaheProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimePaheProvider.kt @@ -58,7 +58,7 @@ class AnimePaheProvider : MainAPI() { TvType.OVA ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { data class Data( @JsonProperty("id") val id: Int, @JsonProperty("anime_id") val animeId: Int, diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeSailProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeSailProvider.kt index 7b29cdc8..262e4a60 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeSailProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeSailProvider.kt @@ -47,7 +47,7 @@ class AnimeSailProvider : MainAPI() { ) } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = request(mainUrl).document val homePageList = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeSaturnProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeSaturnProvider.kt index 793d5b7a..bc7ccff9 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeSaturnProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeSaturnProvider.kt @@ -64,7 +64,7 @@ class AnimeSaturnProvider : MainAPI() { } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val list = ArrayList() document.select("div.container:has(span.badge-saturn)").forEach { diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeWorldProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeWorldProvider.kt index 81ce9e99..1349fe78 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeWorldProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeWorldProvider.kt @@ -130,7 +130,7 @@ class AnimeWorldProvider : MainAPI() { } } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = request(mainUrl).document val list = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimefenixProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimefenixProvider.kt index 438cc56a..0de6e7ef 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimefenixProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimefenixProvider.kt @@ -30,7 +30,7 @@ class AnimefenixProvider:MainAPI() { else DubStatus.Subbed } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val urls = listOf( Pair("$mainUrl/", "Animes"), Pair("$mainUrl/animes?type[]=movie&order=default", "Peliculas", ), diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeflvIOProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeflvIOProvider.kt index 65a3a1c4..b2373295 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeflvIOProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeflvIOProvider.kt @@ -22,7 +22,7 @@ class AnimeflvIOProvider:MainAPI() { TvType.OVA, TvType.Anime, ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val items = ArrayList() val urls = listOf( Pair("$mainUrl/series", "Series actualizadas",), diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeflvProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeflvProvider.kt index abecc08a..993a035d 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeflvProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimeflvProvider.kt @@ -34,7 +34,7 @@ class AnimeflvnetProvider : MainAPI() { TvType.Anime, ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val urls = listOf( Pair("$mainUrl/browse?type[]=movie&order=updated", "Películas"), Pair("$mainUrl/browse?status[]=2&order=default", "Animes"), diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimekisaProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimekisaProvider.kt index 11defe07..83861772 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimekisaProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimekisaProvider.kt @@ -26,7 +26,7 @@ class AnimekisaProvider : MainAPI() { @JsonProperty("html") val html: String ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val urls = listOf( Pair("$mainUrl/ajax/list/views?type=all", "All animes"), Pair("$mainUrl/ajax/list/views?type=day", "Trending now"), diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/DubbedAnimeProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/DubbedAnimeProvider.kt index 45a87085..76fb8f35 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/DubbedAnimeProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/DubbedAnimeProvider.kt @@ -96,7 +96,7 @@ class DubbedAnimeProvider : MainAPI() { } } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val trendingUrl = "$mainUrl/xz/trending.php?_=$unixTimeMS" val lastEpisodeUrl = "$mainUrl/xz/epgrid.php?p=1&_=$unixTimeMS" val recentlyAddedUrl = "$mainUrl/xz/gridgrabrecent.php?p=1&_=$unixTimeMS" diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/GogoanimeProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/GogoanimeProvider.kt index b0ce2c7f..b1a9a629 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/GogoanimeProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/GogoanimeProvider.kt @@ -202,16 +202,15 @@ class GogoanimeProvider : MainAPI() { override suspend fun getMainPage( page: Int, - categoryName: String, - categoryData: String + request : MainPageRequest ): HomePageResponse { - val params = mapOf("page" to page.toString(), "type" to categoryData) + val params = mapOf("page" to page.toString(), "type" to request.data) val html = app.get( "https://ajax.gogo-load.com/ajax/page-recent-release.html", headers = headers, params = params ) - val isSub = listOf(1, 3).contains(categoryData.toInt()) + val isSub = listOf(1, 3).contains(request.data.toInt()) val home = parseRegex.findAll(html.text).map { val (link, epNum, title, poster) = it.destructured @@ -221,7 +220,7 @@ class GogoanimeProvider : MainAPI() { } }.toList() - return newHomePageResponse(categoryName, home) + return newHomePageResponse(request.name, home) } override suspend fun search(query: String): ArrayList { diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/GomunimeProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/GomunimeProvider.kt index 96633ced..742ed04b 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/GomunimeProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/GomunimeProvider.kt @@ -46,7 +46,7 @@ class GomunimeProvider : MainAPI() { @JsonProperty("html") val html: String ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val urls = listOf( Pair("e", "Episode Baru"), Pair("c", "Completed"), diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/JKAnimeProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/JKAnimeProvider.kt index 425a29c2..fcfc7445 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/JKAnimeProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/JKAnimeProvider.kt @@ -32,7 +32,7 @@ class JKAnimeProvider : MainAPI() { TvType.Anime, ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val urls = listOf( Pair( "$mainUrl/directorio/?filtro=fecha&tipo=TV&estado=1&fecha=none&temporada=none&orden=desc", diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/KawaiifuProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/KawaiifuProvider.kt index 97c36e7d..6b79b878 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/KawaiifuProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/KawaiifuProvider.kt @@ -14,7 +14,7 @@ class KawaiifuProvider : MainAPI() { override val supportedTypes = setOf(TvType.Anime, TvType.AnimeMovie) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val items = ArrayList() val resp = app.get(mainUrl).text diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/KimCartoonProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/KimCartoonProvider.kt index 1c75fe39..4826f2bc 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/KimCartoonProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/KimCartoonProvider.kt @@ -17,7 +17,7 @@ class KimCartoonProvider : MainAPI() { return if (url.startsWith("/")) mainUrl + url else url } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val doc = app.get(mainUrl).document.select("#container") val response = mutableListOf( HomePageList( diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/KuramanimeProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/KuramanimeProvider.kt index cd451e03..db87d158 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/KuramanimeProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/KuramanimeProvider.kt @@ -38,7 +38,7 @@ class KuramanimeProvider : MainAPI() { } } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val homePageList = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/KuronimeProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/KuronimeProvider.kt index 0338fc85..e6498759 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/KuronimeProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/KuronimeProvider.kt @@ -39,7 +39,7 @@ class KuronimeProvider : MainAPI() { } } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val homePageList = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/MonoschinosProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/MonoschinosProvider.kt index ebc10656..7e063f0c 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/MonoschinosProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/MonoschinosProvider.kt @@ -34,7 +34,7 @@ class MonoschinosProvider : MainAPI() { TvType.Anime, ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val urls = listOf( Pair("$mainUrl/emision", "En emisión"), Pair( diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/MundoDonghuaProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/MundoDonghuaProvider.kt index 86fcfe5a..b32000db 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/MundoDonghuaProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/MundoDonghuaProvider.kt @@ -23,7 +23,7 @@ class MundoDonghuaProvider : MainAPI() { TvType.Anime, ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val urls = listOf( Pair("$mainUrl/lista-donghuas", "Donghuas"), ) diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/NeonimeProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/NeonimeProvider.kt index e5343fdf..e7a05ddd 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/NeonimeProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/NeonimeProvider.kt @@ -40,7 +40,7 @@ class NeonimeProvider : MainAPI() { } } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val homePageList = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/NineAnimeProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/NineAnimeProvider.kt index c810e49c..73293b8d 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/NineAnimeProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/NineAnimeProvider.kt @@ -148,10 +148,9 @@ class NineAnimeProvider : MainAPI() { override suspend fun getMainPage( page: Int, - categoryName: String, - categoryData: String + request: MainPageRequest ): HomePageResponse { - val url = categoryData + page + val url = request.data + page val home = Jsoup.parse( app.get( url @@ -175,7 +174,7 @@ class NineAnimeProvider : MainAPI() { } } - return newHomePageResponse(categoryName, home) + return newHomePageResponse(request.name, home) } data class Response( @@ -238,9 +237,10 @@ class NineAnimeProvider : MainAPI() { val title = (info.selectFirst(".title") ?: info.selectFirst(".d-title"))?.text() ?: throw ErrorLoadingException("Could not find title") - val body = - app.get("$mainUrl/ajax/episode/list/$id?vrf=${encodeVrf(id, cipherKey)}") - .parsed().html + val vrf = encodeVrf(id, cipherKey) + val req = app.get("$mainUrl/ajax/episode/list/$id?vrf=$vrf") + val body = req.parsedSafe()?.html + ?: throw ErrorLoadingException("Could not parse json with cipherKey=$cipherKey code=${req.code}") val subEpisodes = ArrayList() val dubEpisodes = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/NontonAnimeIDProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/NontonAnimeIDProvider.kt index 73d3a5a0..bc6033ea 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/NontonAnimeIDProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/NontonAnimeIDProvider.kt @@ -40,7 +40,7 @@ class NontonAnimeIDProvider : MainAPI() { } } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val homePageList = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/OploverzProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/OploverzProvider.kt index 3a5f90fb..3afe213c 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/OploverzProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/OploverzProvider.kt @@ -40,7 +40,7 @@ class OploverzProvider : MainAPI() { } } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val homePageList = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/OtakudesuProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/OtakudesuProvider.kt index ad213f22..560a5d1d 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/OtakudesuProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/OtakudesuProvider.kt @@ -7,7 +7,6 @@ import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.loadExtractor import org.jsoup.Jsoup import org.jsoup.nodes.Element -import java.util.ArrayList class OtakudesuProvider : MainAPI() { override var mainUrl = "https://otakudesu.watch" @@ -38,7 +37,7 @@ class OtakudesuProvider : MainAPI() { } } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val homePageList = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/TenshiProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/TenshiProvider.kt index 4f0e9892..ba2a5f9e 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/TenshiProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/TenshiProvider.kt @@ -44,7 +44,7 @@ class TenshiProvider : MainAPI() { } }*/ - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val items = ArrayList() val soup = app.get(mainUrl, interceptor = ddosGuardKiller).document for (section in soup.select("#content > section")) { diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/TocanimeProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/TocanimeProvider.kt index f5324ffe..b7f4bca6 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/TocanimeProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/TocanimeProvider.kt @@ -39,7 +39,7 @@ class TocanimeProvider : MainAPI() { } } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val homePageList = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/WcoProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/WcoProvider.kt index 51629d9b..a9ab5b8b 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/WcoProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/WcoProvider.kt @@ -30,7 +30,7 @@ class WcoProvider : MainAPI() { TvType.OVA ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val urls = listOf( Pair("$mainUrl/ajax/list/recently_updated?type=tv", "Recently Updated Anime"), Pair("$mainUrl/ajax/list/recently_updated?type=movie", "Recently Updated Movies"), diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/ZoroProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/ZoroProvider.kt index be9209b8..863b315e 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/ZoroProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/ZoroProvider.kt @@ -77,7 +77,7 @@ class ZoroProvider : MainAPI() { } } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val html = app.get("$mainUrl/home").text val document = Jsoup.parse(html) diff --git a/app/src/main/java/com/lagradost/cloudstream3/liveproviders/EjaTv.kt b/app/src/main/java/com/lagradost/cloudstream3/liveproviders/EjaTv.kt index 84f04446..d8396baa 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/liveproviders/EjaTv.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/liveproviders/EjaTv.kt @@ -37,7 +37,7 @@ class EjaTv : MainAPI() { ) } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { // Maybe this based on app language or as setting? val language = "English" val dataMap = mapOf( diff --git a/app/src/main/java/com/lagradost/cloudstream3/metaproviders/TmdbProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/metaproviders/TmdbProvider.kt index c390d313..314177af 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/metaproviders/TmdbProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/metaproviders/TmdbProvider.kt @@ -196,7 +196,7 @@ open class TmdbProvider : MainAPI() { } } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { // SAME AS DISCOVER IT SEEMS // val popularSeries = tmdb.tvService().popular(1, "en-US").execute().body()?.results?.map { diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/AkwamProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/AkwamProvider.kt index afd7ed03..cd6a8379 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/AkwamProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/AkwamProvider.kt @@ -34,7 +34,7 @@ class AkwamProvider : MainAPI() { ) } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { // Title, Url val moviesUrl = listOf( "Movies" to "$mainUrl/movies", diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/AllMoviesForYouProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/AllMoviesForYouProvider.kt index 8efd3a40..b827ebaa 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/AllMoviesForYouProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/AllMoviesForYouProvider.kt @@ -27,7 +27,7 @@ class AllMoviesForYouProvider : MainAPI() { TvType.TvSeries ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val items = ArrayList() val soup = app.get(mainUrl).document val urls = listOf( diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/AltadefinizioneProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/AltadefinizioneProvider.kt index a08a3ea0..1220dcc2 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/AltadefinizioneProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/AltadefinizioneProvider.kt @@ -23,12 +23,8 @@ class AltadefinizioneProvider : MainAPI() { Pair("$mainUrl/cinema/page/", "Ora al cinema") ) - override suspend fun getMainPage( - page: Int, - categoryName: String, - categoryData: String - ): HomePageResponse { - val url = categoryData + page + override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse { + val url = request.data + page val soup = app.get(url).document val home = soup.select("div.box").map { @@ -48,7 +44,7 @@ class AltadefinizioneProvider : MainAPI() { quality, ) } - return newHomePageResponse(categoryName, home) + return newHomePageResponse(request.name, home) } override suspend fun search(query: String): List { diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/AsiaFlixProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/AsiaFlixProvider.kt index 0fbb8e94..14d149e0 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/AsiaFlixProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/AsiaFlixProvider.kt @@ -110,7 +110,7 @@ class AsiaFlixProvider : MainAPI() { ) } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val headers = mapOf("X-Requested-By" to "asiaflix-web") val response = app.get("$apiUrl/dashboard", headers = headers).text diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/BflixProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/BflixProvider.kt index b6ca0bd3..be6e1076 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/BflixProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/BflixProvider.kt @@ -23,7 +23,7 @@ open class BflixProvider : MainAPI() { //override val uniqueId: Int by lazy { "BflixProvider".hashCode() } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val items = ArrayList() val soup = app.get("$mainUrl/home").document val testa = listOf( diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CimaNowProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CimaNowProvider.kt index 34083b0f..2a8594de 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CimaNowProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CimaNowProvider.kt @@ -41,7 +41,7 @@ class CimaNowProvider : MainAPI() { ) } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val doc = app.get("$mainUrl/home", headers = mapOf("user-agent" to "MONKE")).document val pages = doc.select("section").not("section:contains(أختر وجهتك المفضلة)").not("section:contains(تم اضافته حديثاً)").apmap { diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CineblogProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CineblogProvider.kt index d8c110f7..55dc475e 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CineblogProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CineblogProvider.kt @@ -26,10 +26,9 @@ class CineblogProvider : MainAPI() { override suspend fun getMainPage( page: Int, - categoryName: String, - categoryData: String + request : MainPageRequest ): HomePageResponse { - val url = categoryData.replace("number", page.toString()) + val url = request.data.replace("number", page.toString()) val soup = app.get(url, referer = url.substringBefore("page")).document val home = soup.select("article.item").map { val title = it.selectFirst("div.data > h3 > a")!!.text().substringBefore("(") @@ -46,7 +45,7 @@ class CineblogProvider : MainAPI() { quality = quality ) } - return newHomePageResponse(categoryName, home) + return newHomePageResponse(request.name, home) } override suspend fun search(query: String): List { diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CinecalidadProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CinecalidadProvider.kt index ee60e543..551e11f1 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CinecalidadProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CinecalidadProvider.kt @@ -26,10 +26,9 @@ class CinecalidadProvider : MainAPI() { override suspend fun getMainPage( page: Int, - categoryName: String, - categoryData: String + request : MainPageRequest ): HomePageResponse { - val url = categoryData + page + val url = request.data + page val soup = app.get(url).document val home = soup.select(".item.movies").map { @@ -46,7 +45,7 @@ class CinecalidadProvider : MainAPI() { ) } - return newHomePageResponse(categoryName, home) + return newHomePageResponse(request.name, home) } override suspend fun search(query: String): List { diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CuevanaProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CuevanaProvider.kt index f6fdba07..596a7d94 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CuevanaProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CuevanaProvider.kt @@ -19,7 +19,7 @@ class CuevanaProvider : MainAPI() { TvType.TvSeries, ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val items = ArrayList() val urls = listOf( Pair(mainUrl, "Recientemente actualizadas"), diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/DoramasYTProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/DoramasYTProvider.kt index 09cccea4..4c85d7e3 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/DoramasYTProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/DoramasYTProvider.kt @@ -31,7 +31,7 @@ class DoramasYTProvider : MainAPI() { TvType.AsianDrama, ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val urls = listOf( Pair("$mainUrl/emision", "En emisión"), Pair( diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/DramaSeeProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/DramaSeeProvider.kt index 57bf1225..7e6f2775 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/DramaSeeProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/DramaSeeProvider.kt @@ -14,7 +14,7 @@ class DramaSeeProvider : MainAPI() { override val hasDownloadSupport = true override val supportedTypes = setOf(TvType.AsianDrama) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val headers = mapOf("X-Requested-By" to mainUrl) val document = app.get(mainUrl, headers = headers).document val mainbody = document.getElementsByTag("body") diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/DramaidProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/DramaidProvider.kt index 4b2c8d77..6a71d315 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/DramaidProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/DramaidProvider.kt @@ -30,7 +30,7 @@ class DramaidProvider : MainAPI() { } } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val homePageList = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/EgyBestProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/EgyBestProvider.kt index f9da13fe..c7550ce5 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/EgyBestProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/EgyBestProvider.kt @@ -41,7 +41,7 @@ class EgyBestProvider : MainAPI() { ) } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { // url, title val doc = app.get(mainUrl).document val pages = arrayListOf() diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/ElifilmsProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/ElifilmsProvider.kt index db394948..21b28cfc 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/ElifilmsProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/ElifilmsProvider.kt @@ -15,7 +15,7 @@ class ElifilmsProvider : MainAPI() { TvType.Movie, ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val items = ArrayList() val newest = app.get(mainUrl).document.selectFirst("a.fav_link.premiera")?.attr("href") val urls = listOf( diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/EntrepeliculasyseriesProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/EntrepeliculasyseriesProvider.kt index a0b82789..12f7a01f 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/EntrepeliculasyseriesProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/EntrepeliculasyseriesProvider.kt @@ -25,10 +25,9 @@ class EntrepeliculasyseriesProvider : MainAPI() { override suspend fun getMainPage( page: Int, - categoryName: String, - categoryData: String + request : MainPageRequest ): HomePageResponse { - val url = categoryData + page + val url = request.data + page val soup = app.get(url).document val home = soup.select("ul.list-movie li").map { @@ -45,7 +44,7 @@ class EntrepeliculasyseriesProvider : MainAPI() { ) } - return newHomePageResponse(categoryName, home) + return newHomePageResponse(request.name, home) } override suspend fun search(query: String): List { diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/EstrenosDoramasProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/EstrenosDoramasProvider.kt index df2fe159..1895feaf 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/EstrenosDoramasProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/EstrenosDoramasProvider.kt @@ -28,7 +28,7 @@ class EstrenosDoramasProvider : MainAPI() { TvType.AsianDrama, ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val urls = listOf( Pair(mainUrl, "Últimas series"), Pair("$mainUrl/category/peliculas", "Películas"), diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FaselHDProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FaselHDProvider.kt index 5b941718..c8d8632b 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FaselHDProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FaselHDProvider.kt @@ -35,7 +35,7 @@ class FaselHDProvider : MainAPI() { ) } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { // Title, Url val moviesUrl = listOf( Pair("Movies", "$mainUrl/all-movies/page/"+(0..10).random()), diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FilmanProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FilmanProvider.kt index 63e55594..7e374edd 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FilmanProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FilmanProvider.kt @@ -18,7 +18,7 @@ class FilmanProvider : MainAPI() { TvType.TvSeries ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val lists = document.select("#item-list,#series-list") val categories = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FilmpertuttiProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FilmpertuttiProvider.kt index d5944993..bbea249b 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FilmpertuttiProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FilmpertuttiProvider.kt @@ -9,7 +9,6 @@ import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.ShortLink import com.lagradost.cloudstream3.utils.loadExtractor -import com.lagradost.nicehttp.NiceResponse import org.jsoup.nodes.Element @@ -32,10 +31,9 @@ class FilmpertuttiProvider : MainAPI() { override suspend fun getMainPage( page: Int, - categoryName: String, - categoryData: String + request: MainPageRequest ): HomePageResponse { - val url = categoryData + page + val url = request.data + page val soup = app.get(url).document val home = soup.select("ul.posts > li").map { @@ -58,7 +56,7 @@ class FilmpertuttiProvider : MainAPI() { } } - return newHomePageResponse(categoryName, home) + return newHomePageResponse(request.name, home) } override suspend fun search(query: String): List { diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FrenchStreamProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FrenchStreamProvider.kt index f3b447b4..16751a61 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FrenchStreamProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FrenchStreamProvider.kt @@ -232,7 +232,7 @@ class FrenchStreamProvider : MainAPI() { } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse? { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse? { val document = app.get(mainUrl).document val docs = document.select("div.sect") val returnList = docs.mapNotNull { diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/HDMProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/HDMProvider.kt index fd002a5c..f047534a 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/HDMProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/HDMProvider.kt @@ -69,7 +69,7 @@ class HDMProvider : MainAPI() { ) } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val html = app.get(mainUrl, timeout = 25).text val document = Jsoup.parse(html) val all = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/HDMovie5.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/HDMovie5.kt index 13837218..f17f3d11 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/HDMovie5.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/HDMovie5.kt @@ -19,7 +19,7 @@ class HDMovie5 : MainAPI() { TvType.TvSeries, ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val doc = app.get(mainUrl).document.select("div.content") val list = mapOf( "Featured Movies" to "featured", diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/HDrezkaProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/HDrezkaProvider.kt index 96bcc6f3..4fdd0dea 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/HDrezkaProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/HDrezkaProvider.kt @@ -28,7 +28,7 @@ class HDrezkaProvider : MainAPI() { TvType.AsianDrama ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val items = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/IHaveNoTvProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/IHaveNoTvProvider.kt index 0749c52e..25dc7d78 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/IHaveNoTvProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/IHaveNoTvProvider.kt @@ -14,7 +14,7 @@ class IHaveNoTvProvider : MainAPI() { override val supportedTypes = setOf(TvType.Documentary) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { // Uhh, I am too lazy to scrape the "latest documentaries" and "recommended documentaries", // so I am just scraping 3 random categories val allCategories = listOf( diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/IdlixProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/IdlixProvider.kt index 10e6a7e1..fc5f6aa2 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/IdlixProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/IdlixProvider.kt @@ -22,7 +22,7 @@ class IdlixProvider : MainAPI() { TvType.TvSeries, ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val homePageList = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/KdramaHoodProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/KdramaHoodProvider.kt index a35c0e36..2cfdea91 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/KdramaHoodProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/KdramaHoodProvider.kt @@ -26,7 +26,7 @@ class KdramaHoodProvider : MainAPI() { @JsonProperty("file") val file: String ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val doc = app.get("$mainUrl/home2").document val home = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/LayarKacaProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/LayarKacaProvider.kt index 98091c75..acd96081 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/LayarKacaProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/LayarKacaProvider.kt @@ -21,7 +21,7 @@ class LayarKacaProvider : MainAPI() { TvType.AsianDrama ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val homePageList = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/MultiplexProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/MultiplexProvider.kt index 5962a56f..12729bc9 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/MultiplexProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/MultiplexProvider.kt @@ -22,7 +22,7 @@ class MultiplexProvider : MainAPI() { TvType.AsianDrama ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val homePageList = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/MyCimaProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/MyCimaProvider.kt index 9027d996..abf4d57a 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/MyCimaProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/MyCimaProvider.kt @@ -44,7 +44,7 @@ class MyCimaProvider : MainAPI() { ) } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { // Title, Url val moviesUrl = listOf( "Movies" to "$mainUrl/movies/page/" + (0..25).random(), diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/NginxProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/NginxProvider.kt index 6b1c150f..ba8a3f57 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/NginxProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/NginxProvider.kt @@ -212,7 +212,7 @@ class NginxProvider : MainAPI() { } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val authHeader = getAuthHeader() // call again because it isn't reloaded if in main class and storedCredentials loads after diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PeliSmartProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PeliSmartProvider.kt index 7ef4a441..64851106 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PeliSmartProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PeliSmartProvider.kt @@ -17,7 +17,7 @@ class PeliSmartProvider: MainAPI() { ) override val vpnStatus = VPNStatus.MightBeNeeded //Due to evoload sometimes not loading - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val items = ArrayList() val urls = listOf( Pair("$mainUrl/peliculas/", "Peliculas"), diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PelisflixProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PelisflixProvider.kt index 6f4dbccb..20bc164c 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PelisflixProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PelisflixProvider.kt @@ -18,7 +18,7 @@ class PelisflixProvider : MainAPI() { TvType.TvSeries, ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val items = ArrayList() val urls = listOf( Pair("$mainUrl/ver-peliculas-online-gratis-fullhdc3/", "Películas"), diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PelisplusHDProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PelisplusHDProvider.kt index 9cabffd5..b0c69713 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PelisplusHDProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PelisplusHDProvider.kt @@ -16,7 +16,7 @@ class PelisplusHDProvider:MainAPI() { TvType.Movie, TvType.TvSeries, ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val items = ArrayList() val document = app.get(mainUrl).document val map = mapOf( diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PelisplusProviderTemplate.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PelisplusProviderTemplate.kt index 74ce0ce4..604e8636 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PelisplusProviderTemplate.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PelisplusProviderTemplate.kt @@ -142,7 +142,7 @@ open class PelisplusProviderTemplate : MainAPI() { // This loads the homepage, which is basically a collection of search results with labels. // Optional function, but make sure to enable hasMainPage if you program this. - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val urls = homePageUrlList val homePageList = ArrayList() // .pmap {} is used to fetch the different pages in parallel diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PhimmoichillProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PhimmoichillProvider.kt index 56d4103e..10b02d4e 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PhimmoichillProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PhimmoichillProvider.kt @@ -23,7 +23,7 @@ class PhimmoichillProvider : MainAPI() { TvType.AsianDrama ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val homePageList = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PinoyHDXyzProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PinoyHDXyzProvider.kt index 8f79979e..6d3e5541 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PinoyHDXyzProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PinoyHDXyzProvider.kt @@ -15,7 +15,7 @@ class PinoyHDXyzProvider : MainAPI() { override val hasMainPage = true override val hasQuickSearch = false - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val all = ArrayList() val document = app.get(mainUrl, referer = mainUrl).document val mainbody = document.getElementsByTag("body") diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PinoyMoviePediaProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PinoyMoviePediaProvider.kt index fbb62f1d..b4cf425f 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PinoyMoviePediaProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PinoyMoviePediaProvider.kt @@ -16,7 +16,7 @@ class PinoyMoviePediaProvider : MainAPI() { override val hasMainPage = true override val hasQuickSearch = false - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val all = ArrayList() val document = app.get(mainUrl).document val mainbody = document.getElementsByTag("body") diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PinoyMoviesEsProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PinoyMoviesEsProvider.kt index 3fd22867..16e023cb 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PinoyMoviesEsProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PinoyMoviesEsProvider.kt @@ -90,7 +90,7 @@ class PinoyMoviesEsProvider : MainAPI() { return all } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val all = ArrayList() val document = app.get(mainUrl).document val mainbody = document.getElementsByTag("body") diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/RebahinProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/RebahinProvider.kt index 49d88112..f85aac91 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/RebahinProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/RebahinProvider.kt @@ -27,7 +27,7 @@ class RebahinProvider : MainAPI() { TvType.AsianDrama ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val urls = listOf( Pair("Featured", "xtab1"), Pair("Film Terbaru", "xtab2"), diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SeriesflixProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SeriesflixProvider.kt index 41eec15f..9fd150c4 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SeriesflixProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SeriesflixProvider.kt @@ -18,7 +18,7 @@ class SeriesflixProvider : MainAPI() { TvType.TvSeries, ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val items = ArrayList() val urls = listOf( Pair("$mainUrl/ver-series-online/", "Series"), diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SflixProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SflixProvider.kt index 46dbe081..d538e731 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SflixProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SflixProvider.kt @@ -43,7 +43,7 @@ open class SflixProvider : MainAPI() { ) override val vpnStatus = VPNStatus.None - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val html = app.get("$mainUrl/home").text val document = Jsoup.parse(html) diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SoaptwoDayProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SoaptwoDayProvider.kt index 85687616..26b468df 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SoaptwoDayProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SoaptwoDayProvider.kt @@ -25,10 +25,9 @@ class SoaptwoDayProvider : MainAPI() { override suspend fun getMainPage( page: Int, - categoryName: String, - categoryData: String + request : MainPageRequest ): HomePageResponse { - val url = categoryData + page + val url = request.data + page val soup = app.get(url).document val home = @@ -46,7 +45,7 @@ class SoaptwoDayProvider : MainAPI() { null, ) } - return newHomePageResponse(categoryName, home) + return newHomePageResponse(request.name, home) } override suspend fun search(query: String): List { diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/StreamingcommunityProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/StreamingcommunityProvider.kt index e22918f8..ef1da030 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/StreamingcommunityProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/StreamingcommunityProvider.kt @@ -174,7 +174,7 @@ class StreamingcommunityProvider : MainAPI() { val posterMap = hashMapOf() } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val items = ArrayList() val document = app.get(mainUrl).document document.select("slider-title").subList(0, 3).map { it -> diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/TantiFilmProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/TantiFilmProvider.kt index eb8fff50..f1d48704 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/TantiFilmProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/TantiFilmProvider.kt @@ -25,10 +25,9 @@ class TantifilmProvider : MainAPI() { override suspend fun getMainPage( page: Int, - categoryName: String, - categoryData: String + request : MainPageRequest ): HomePageResponse { - val url = categoryData + page + val url = request.data + page val soup = app.get(url).document val home = soup.select("div.media3").map { val title = it.selectFirst("p")!!.text().substringBefore("(") @@ -43,7 +42,7 @@ class TantifilmProvider : MainAPI() { null, ) } - return newHomePageResponse(categoryName, home) + return newHomePageResponse(request.name, home) } override suspend fun search(query: String): List { diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/TheFlixToProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/TheFlixToProvider.kt index 2ab2b540..ab089034 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/TheFlixToProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/TheFlixToProvider.kt @@ -143,7 +143,7 @@ class TheFlixToProvider : MainAPI() { } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val items = ArrayList() val doc = app.get(mainUrl).document val scriptText = doc.selectFirst("script[type=application/json]")!!.data() diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/UakinoProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/UakinoProvider.kt index 967feb71..51573433 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/UakinoProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/UakinoProvider.kt @@ -23,7 +23,7 @@ class UakinoProvider : MainAPI() { TvType.Anime ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val homePageList = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/VidstreamProviderTemplate.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/VidstreamProviderTemplate.kt index 48db5f85..f8b2773e 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/VidstreamProviderTemplate.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/VidstreamProviderTemplate.kt @@ -210,7 +210,7 @@ open class VidstreamProviderTemplate : MainAPI() { // This loads the homepage, which is basically a collection of search results with labels. // Optional function, but make sure to enable hasMainPage if you program this. - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val urls = homePageUrlList val homePageList = ArrayList() // .pmap {} is used to fetch the different pages in parallel diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/WatchAsianProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/WatchAsianProvider.kt index d8ba061a..77c50f45 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/WatchAsianProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/WatchAsianProvider.kt @@ -18,7 +18,7 @@ class WatchAsianProvider : MainAPI() { override val hasDownloadSupport = true override val supportedTypes = setOf(TvType.AsianDrama) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val headers = mapOf("X-Requested-By" to mainUrl) val doc = app.get(mainUrl, headers = headers).document val rowPair = mutableListOf>() diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/XcineProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/XcineProvider.kt index 99561b05..29c9b9c9 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/XcineProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/XcineProvider.kt @@ -40,7 +40,7 @@ class XcineProvider : MainAPI() { ) } - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val sections = document.select("div.group-film") return HomePageResponse(sections.mapNotNull { section -> diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/YomoviesProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/YomoviesProvider.kt index 04f1da6a..ef465701 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/YomoviesProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/YomoviesProvider.kt @@ -19,7 +19,7 @@ class YomoviesProvider : MainAPI() { TvType.TvSeries, ) - override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse { + override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { val document = app.get(mainUrl).document val homePageList = ArrayList() diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/APIRepository.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/APIRepository.kt index 2daf51c1..0283760d 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/APIRepository.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/APIRepository.kt @@ -63,9 +63,9 @@ class APIRepository(val api: MainAPI) { suspend fun getMainPage(page: Int, nameIndex: Int? = null): Resource> { return safeApiCall { nameIndex?.let { api.mainPage.getOrNull(it) }?.let { data -> - listOf(api.getMainPage(page, data.name, data.data)) + listOf(api.getMainPage(page, MainPageRequest(data.name, data.data))) } ?: api.mainPage.apmap { data -> - api.getMainPage(page, data.name, data.data) + api.getMainPage(page, MainPageRequest(data.name, data.data)) } } }