aniage: Add trailers and drop season num

This commit is contained in:
CakesTwix 2023-08-04 20:24:11 +03:00
parent e6db533c71
commit 1b901dc389
Signed by: CakesTwix
GPG key ID: 7B11051D5CE19825
2 changed files with 15 additions and 6 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 2
version = 3
dependencies{
implementation("com.google.code.gson:gson:2.9.0")

View file

@ -7,6 +7,7 @@ import com.lagradost.cloudstream3.DubStatus
import com.lagradost.cloudstream3.Episode
import com.lagradost.cloudstream3.HomePageResponse
import com.lagradost.cloudstream3.LoadResponse
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.MainAPI
import com.lagradost.cloudstream3.MainPageRequest
import com.lagradost.cloudstream3.SearchResponse
@ -137,6 +138,16 @@ class AniageProvider : MainAPI() {
}
}
val trailer = with(animeJSON.pageProps.trailerUrl){
when{
this.isNullOrEmpty() -> null
contains("https://iframe.mediadelivery.net/embed") ->
app.get(this).document.select("source[type*=application/x-mpegURL]").attr("src")
else ->
this
}
}
// Episodes
// https://master.api.aniage.net/anime/episodes
// ?animeId=2c60c269-049e-428b-96ba-fae23ac718ec
@ -155,15 +166,13 @@ class AniageProvider : MainAPI() {
(
"${it.animeId}, ${it.episodeNum}",
"Серія ${it.title}",
it.volume,
it.episodeNum,
"$cdnUrl${it.previewPath}",
episode = it.episodeNum,
posterUrl = "$cdnUrl${it.previewPath}",
)
)
}
}
return newAnimeLoadResponse(
animeJSON.pageProps.title,
"$mainUrl/watch/$animeID",
@ -173,7 +182,7 @@ class AniageProvider : MainAPI() {
this.engName = animeJSON.pageProps.alternativeTitle
this.tags = animeJSON.pageProps.genres.map { it }
this.plot = animeJSON.pageProps.description
// addTrailer(animeJSON.pageProps.trailerUrl)
addTrailer(trailer, addRaw = true)
this.showStatus = showStatus
this.duration = animeJSON.pageProps.averageDuration
addEpisodes(DubStatus.Dubbed, episodes)