aniage: Add trailers and drop season num
This commit is contained in:
parent
e6db533c71
commit
1b901dc389
2 changed files with 15 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 2
|
version = 3
|
||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
implementation("com.google.code.gson:gson:2.9.0")
|
implementation("com.google.code.gson:gson:2.9.0")
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.lagradost.cloudstream3.DubStatus
|
||||||
import com.lagradost.cloudstream3.Episode
|
import com.lagradost.cloudstream3.Episode
|
||||||
import com.lagradost.cloudstream3.HomePageResponse
|
import com.lagradost.cloudstream3.HomePageResponse
|
||||||
import com.lagradost.cloudstream3.LoadResponse
|
import com.lagradost.cloudstream3.LoadResponse
|
||||||
|
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
||||||
import com.lagradost.cloudstream3.MainAPI
|
import com.lagradost.cloudstream3.MainAPI
|
||||||
import com.lagradost.cloudstream3.MainPageRequest
|
import com.lagradost.cloudstream3.MainPageRequest
|
||||||
import com.lagradost.cloudstream3.SearchResponse
|
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
|
// Episodes
|
||||||
// https://master.api.aniage.net/anime/episodes
|
// https://master.api.aniage.net/anime/episodes
|
||||||
// ?animeId=2c60c269-049e-428b-96ba-fae23ac718ec
|
// ?animeId=2c60c269-049e-428b-96ba-fae23ac718ec
|
||||||
|
@ -155,15 +166,13 @@ class AniageProvider : MainAPI() {
|
||||||
(
|
(
|
||||||
"${it.animeId}, ${it.episodeNum}",
|
"${it.animeId}, ${it.episodeNum}",
|
||||||
"Серія ${it.title}",
|
"Серія ${it.title}",
|
||||||
it.volume,
|
episode = it.episodeNum,
|
||||||
it.episodeNum,
|
posterUrl = "$cdnUrl${it.previewPath}",
|
||||||
"$cdnUrl${it.previewPath}",
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return newAnimeLoadResponse(
|
return newAnimeLoadResponse(
|
||||||
animeJSON.pageProps.title,
|
animeJSON.pageProps.title,
|
||||||
"$mainUrl/watch/$animeID",
|
"$mainUrl/watch/$animeID",
|
||||||
|
@ -173,7 +182,7 @@ class AniageProvider : MainAPI() {
|
||||||
this.engName = animeJSON.pageProps.alternativeTitle
|
this.engName = animeJSON.pageProps.alternativeTitle
|
||||||
this.tags = animeJSON.pageProps.genres.map { it }
|
this.tags = animeJSON.pageProps.genres.map { it }
|
||||||
this.plot = animeJSON.pageProps.description
|
this.plot = animeJSON.pageProps.description
|
||||||
// addTrailer(animeJSON.pageProps.trailerUrl)
|
addTrailer(trailer, addRaw = true)
|
||||||
this.showStatus = showStatus
|
this.showStatus = showStatus
|
||||||
this.duration = animeJSON.pageProps.averageDuration
|
this.duration = animeJSON.pageProps.averageDuration
|
||||||
addEpisodes(DubStatus.Dubbed, episodes)
|
addEpisodes(DubStatus.Dubbed, episodes)
|
||||||
|
|
Loading…
Reference in a new issue