From caa4526f183d7927d4def7e2b613261fd9400b0c Mon Sep 17 00:00:00 2001 From: Osten <11805592+LagradOst@users.noreply.github.com> Date: Fri, 9 Dec 2022 19:07:35 +0000 Subject: [PATCH 1/3] Update AllAnimeProvider.kt --- .../kotlin/com/lagradost/AllAnimeProvider.kt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/AllAnimeProvider/src/main/kotlin/com/lagradost/AllAnimeProvider.kt b/AllAnimeProvider/src/main/kotlin/com/lagradost/AllAnimeProvider.kt index ba53b31..cf23e73 100644 --- a/AllAnimeProvider/src/main/kotlin/com/lagradost/AllAnimeProvider.kt +++ b/AllAnimeProvider/src/main/kotlin/com/lagradost/AllAnimeProvider.kt @@ -3,6 +3,7 @@ package com.lagradost import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.LoadResponse.Companion.addActors +import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer import com.lagradost.cloudstream3.mvvm.safeApiCall import com.lagradost.cloudstream3.ui.settings.SettingsProviders import com.lagradost.cloudstream3.utils.AppUtils.parseJson @@ -55,9 +56,14 @@ class AllAnimeProvider : MainAPI() { @JsonProperty("availableEpisodes") val availableEpisodes: AvailableEpisodes?, @JsonProperty("availableEpisodesDetail") val availableEpisodesDetail: AvailableEpisodesDetail?, @JsonProperty("studios") val studios: List?, + @JsonProperty("genres") val genres: List?, + @JsonProperty("averageScore") val averageScore: Int?, @JsonProperty("description") val description: String?, @JsonProperty("status") val status: String?, - ) + @JsonProperty("banner") val banner : String?, + @JsonProperty("episodeDuration") val episodeDuration : Int?, + @JsonProperty("prevideos") val prevideos : List = emptyList(), + ) private data class AvailableEpisodes( @JsonProperty("sub") val sub: Int, @@ -225,6 +231,7 @@ class AllAnimeProvider : MainAPI() { rhino.evaluateString(scope, js, "JavaScript", 1, null) val jsEval = scope.get("returnValue", scope) ?: return null + val showData = parseJson(jsEval as String) val title = showData.name @@ -256,7 +263,7 @@ class AllAnimeProvider : MainAPI() { Pair(Actor(name, img), role) } - // bruh, they use graphql + // bruh, they use graphql and bruh it is fucked //val recommendations = soup.select("#suggesction > div > div.p > .swipercard")?.mapNotNull { // val recTitle = it?.selectFirst(".showname > a") ?: return@mapNotNull null // val recName = recTitle.text() ?: return@mapNotNull null @@ -267,7 +274,12 @@ class AllAnimeProvider : MainAPI() { return newAnimeLoadResponse(title, url, TvType.Anime) { posterUrl = poster + backgroundPosterUrl = showData.banner + rating = showData.averageScore?.times(100) + tags = showData.genres year = showData.airedStart?.year + duration = showData.episodeDuration?.div(60_000) + addTrailer(showData.prevideos.filter { it.isNotBlank() }.map { "https://www.youtube.com/watch?v=$it" }) addEpisodes(DubStatus.Subbed, episodes.first) addEpisodes(DubStatus.Dubbed, episodes.second) From 8cb21079c5e303ceb9ccf490c823cbf373ada9f6 Mon Sep 17 00:00:00 2001 From: Osten <11805592+LagradOst@users.noreply.github.com> Date: Fri, 9 Dec 2022 19:07:59 +0000 Subject: [PATCH 2/3] Update PopularQuery.kt --- .../src/main/kotlin/com/lagradost/PopularQuery.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AllAnimeProvider/src/main/kotlin/com/lagradost/PopularQuery.kt b/AllAnimeProvider/src/main/kotlin/com/lagradost/PopularQuery.kt index ed09992..4d1bb9f 100644 --- a/AllAnimeProvider/src/main/kotlin/com/lagradost/PopularQuery.kt +++ b/AllAnimeProvider/src/main/kotlin/com/lagradost/PopularQuery.kt @@ -65,4 +65,8 @@ data class QueryPopular( data class Data( @JsonProperty("queryPopular") val queryPopular: QueryPopular? = QueryPopular() -) \ No newline at end of file +) + +data class Data( + @JsonProperty("queryPopular") val queryPopular: QueryPopular? = QueryPopular() +) From 09d98d89964258c79ebc8e7711afdeed4287a806 Mon Sep 17 00:00:00 2001 From: Osten <11805592+LagradOst@users.noreply.github.com> Date: Fri, 9 Dec 2022 19:09:15 +0000 Subject: [PATCH 3/3] Update PopularQuery.kt --- .../src/main/kotlin/com/lagradost/PopularQuery.kt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/AllAnimeProvider/src/main/kotlin/com/lagradost/PopularQuery.kt b/AllAnimeProvider/src/main/kotlin/com/lagradost/PopularQuery.kt index 4d1bb9f..add1ac9 100644 --- a/AllAnimeProvider/src/main/kotlin/com/lagradost/PopularQuery.kt +++ b/AllAnimeProvider/src/main/kotlin/com/lagradost/PopularQuery.kt @@ -66,7 +66,3 @@ data class QueryPopular( data class Data( @JsonProperty("queryPopular") val queryPopular: QueryPopular? = QueryPopular() ) - -data class Data( - @JsonProperty("queryPopular") val queryPopular: QueryPopular? = QueryPopular() -)