animeon: Fix posters and movie(ashdi)
This commit is contained in:
parent
3763ae41e0
commit
60910163db
2 changed files with 27 additions and 13 deletions
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 4
|
version = 5
|
||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
implementation("com.google.code.gson:gson:2.9.0")
|
implementation("com.google.code.gson:gson:2.9.0")
|
||||||
|
|
|
@ -152,7 +152,6 @@ class AnimeONProvider : MainAPI() {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return if (tvType == TvType.Anime || tvType == TvType.OVA) {
|
return if (tvType == TvType.Anime || tvType == TvType.OVA) {
|
||||||
newAnimeLoadResponse(
|
newAnimeLoadResponse(
|
||||||
animeJSON.titleUa,
|
animeJSON.titleUa,
|
||||||
|
@ -167,20 +166,25 @@ class AnimeONProvider : MainAPI() {
|
||||||
this.showStatus = showStatus
|
this.showStatus = showStatus
|
||||||
this.duration = extractIntFromString(animeJSON.episodeTime)
|
this.duration = extractIntFromString(animeJSON.episodeTime)
|
||||||
this.year = animeJSON.releaseDate
|
this.year = animeJSON.releaseDate
|
||||||
this.backgroundPosterUrl = posterApi.format(animeJSON.backgroundImage)
|
|
||||||
this.rating = animeJSON.rating.toString().toRatingInt()
|
this.rating = animeJSON.rating.toString().toRatingInt()
|
||||||
addEpisodes(DubStatus.Dubbed, episodes)
|
addEpisodes(DubStatus.Dubbed, episodes)
|
||||||
addMalId(animeJSON.malId)
|
addMalId(animeJSON.malId)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
newMovieLoadResponse(animeJSON.titleUa, "$mainUrl/anime/${animeJSON.id}", tvType, "${animeJSON.titleUa}, ${animeJSON.player[0].url}") {
|
var backgroundImage = animeJSON.backgroundImage
|
||||||
|
if(backgroundImage.isNullOrBlank()){
|
||||||
|
backgroundImage = posterApi.format(animeJSON.poster)
|
||||||
|
} else {
|
||||||
|
backgroundImage = posterApi.format(animeJSON.backgroundImage)
|
||||||
|
}
|
||||||
|
newMovieLoadResponse(animeJSON.titleUa, "$mainUrl/anime/${animeJSON.id}", tvType, "${animeJSON.id}") {
|
||||||
this.posterUrl = posterApi.format(animeJSON.poster)
|
this.posterUrl = posterApi.format(animeJSON.poster)
|
||||||
this.tags = animeJSON.genres.map { it.name }
|
this.tags = animeJSON.genres.map { it.name }
|
||||||
this.plot = animeJSON.description
|
this.plot = animeJSON.description
|
||||||
addTrailer(animeJSON.trailer)
|
addTrailer(animeJSON.trailer)
|
||||||
this.duration = extractIntFromString(animeJSON.episodeTime)
|
this.duration = extractIntFromString(animeJSON.episodeTime)
|
||||||
this.year = animeJSON.releaseDate
|
this.year = animeJSON.releaseDate
|
||||||
this.backgroundPosterUrl = posterApi.format(animeJSON.backgroundImage)
|
this.backgroundPosterUrl = backgroundImage
|
||||||
this.rating = animeJSON.rating.toString().toRatingInt()
|
this.rating = animeJSON.rating.toString().toRatingInt()
|
||||||
addMalId(animeJSON.malId)
|
addMalId(animeJSON.malId)
|
||||||
}
|
}
|
||||||
|
@ -196,9 +200,9 @@ class AnimeONProvider : MainAPI() {
|
||||||
callback: (ExtractorLink) -> Unit
|
callback: (ExtractorLink) -> Unit
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val dataList = data.split(", ")
|
val dataList = data.split(", ")
|
||||||
|
|
||||||
val fundubs = Gson().fromJson<List<FundubModel>>(app.get("${apiUrl}/player/fundubs/${dataList[0]}").text, listFundub)
|
val fundubs = Gson().fromJson<List<FundubModel>>(app.get("${apiUrl}/player/fundubs/${dataList[0]}").text, listFundub)
|
||||||
|
|
||||||
|
if(dataList.size == 2){
|
||||||
fundubs.map { dub ->
|
fundubs.map { dub ->
|
||||||
Gson().fromJson<List<FundubEpisode>>(app.get("${apiUrl}/player/episodes/${dub.player[0].id}/${dub.fundub.id}").text, listFundubEpisodes).filter{ it.episode == dataList[1].toIntOrNull() }.map { epd -> // Episode
|
Gson().fromJson<List<FundubEpisode>>(app.get("${apiUrl}/player/episodes/${dub.player[0].id}/${dub.fundub.id}").text, listFundubEpisodes).filter{ it.episode == dataList[1].toIntOrNull() }.map { epd -> // Episode
|
||||||
M3u8Helper.generateM3u8(
|
M3u8Helper.generateM3u8(
|
||||||
|
@ -208,6 +212,16 @@ class AnimeONProvider : MainAPI() {
|
||||||
).forEach(callback)
|
).forEach(callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
fundubs.map { dub ->
|
||||||
|
M3u8Helper.generateM3u8(
|
||||||
|
source = "${dub.fundub.name} (${dub.player[0].name})",
|
||||||
|
streamUrl = getM3U(app.get("${apiUrl}/player/${dub.player[0].id}/${dub.fundub.id}").parsedSafe<FundubVideoUrl>()!!.videoUrl),
|
||||||
|
referer = "https://animeon.club"
|
||||||
|
).forEach(callback)
|
||||||
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue