unimay: hotfix, width images, remove premium eps
All checks were successful
Build / build (push) Successful in 42s
All checks were successful
Build / build (push) Successful in 42s
This commit is contained in:
parent
752f95fe38
commit
c2d2161e1d
2 changed files with 22 additions and 15 deletions
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 7
|
version = 8
|
||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
implementation("com.google.code.gson:gson:2.9.0")
|
implementation("com.google.code.gson:gson:2.9.0")
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.lagradost
|
package com.lagradost
|
||||||
|
|
||||||
import android.util.Log
|
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.google.gson.reflect.TypeToken
|
import com.google.gson.reflect.TypeToken
|
||||||
import com.lagradost.cloudstream3.DubStatus
|
import com.lagradost.cloudstream3.DubStatus
|
||||||
|
@ -50,7 +49,7 @@ class UnimayProvider : MainAPI() {
|
||||||
// Sections
|
// Sections
|
||||||
override val mainPage = mainPageOf(
|
override val mainPage = mainPageOf(
|
||||||
"$apiUrl/v1/list/series/updates?size=15" to "Останні релізи",
|
"$apiUrl/v1/list/series/updates?size=15" to "Останні релізи",
|
||||||
"$apiUrl/v1/release/search?page_size=10&page=" to "Наши проєкти",
|
"$apiUrl/v1/release/search?page_size=10&page=" to "Наші проєкти",
|
||||||
)
|
)
|
||||||
|
|
||||||
// Done
|
// Done
|
||||||
|
@ -62,7 +61,7 @@ class UnimayProvider : MainAPI() {
|
||||||
if (request.data.contains("updates")){
|
if (request.data.contains("updates")){
|
||||||
val homeList = Gson().fromJson<List<Updates>>(app.get("${request.data}").text, listUpdatesModel).map{
|
val homeList = Gson().fromJson<List<Updates>>(app.get("${request.data}").text, listUpdatesModel).map{
|
||||||
newAnimeSearchResponse(it.release.name, "$apiUrl/v1/release?code=${it.release.code}", TvType.Anime) {
|
newAnimeSearchResponse(it.release.name, "$apiUrl/v1/release?code=${it.release.code}", TvType.Anime) {
|
||||||
this.posterUrl = "$imagesUrl${it.release.posterUuid}"
|
this.posterUrl = "$imagesUrl${it.release.posterUuid}?width=640&format=webp"
|
||||||
addDubStatus(DubStatus.Dubbed, it.series.number)
|
addDubStatus(DubStatus.Dubbed, it.series.number)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,7 +70,7 @@ class UnimayProvider : MainAPI() {
|
||||||
|
|
||||||
val homeList = Gson().fromJson(app.get("${request.data}${page}").text, SearchModel::class.java).content.map{
|
val homeList = Gson().fromJson(app.get("${request.data}${page}").text, SearchModel::class.java).content.map{
|
||||||
newAnimeSearchResponse(it.names.ukr, "$apiUrl/v1/release?code=${it.code}", TvType.Anime) {
|
newAnimeSearchResponse(it.names.ukr, "$apiUrl/v1/release?code=${it.code}", TvType.Anime) {
|
||||||
this.posterUrl = "$imagesUrl${it.images.poster}"
|
this.posterUrl = "$imagesUrl${it.images.poster}?width=640&format=webp"
|
||||||
addDubStatus(DubStatus.Dubbed, it.playlistSize)
|
addDubStatus(DubStatus.Dubbed, it.playlistSize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,7 +80,7 @@ class UnimayProvider : MainAPI() {
|
||||||
override suspend fun search(query: String): List<SearchResponse> {
|
override suspend fun search(query: String): List<SearchResponse> {
|
||||||
return Gson().fromJson(app.get("$findUrl$query&page=0").text, SearchModel::class.java).content.map{
|
return Gson().fromJson(app.get("$findUrl$query&page=0").text, SearchModel::class.java).content.map{
|
||||||
newAnimeSearchResponse(it.names.ukr, "$apiUrl/v1/release?code=${it.code}", TvType.Anime) {
|
newAnimeSearchResponse(it.names.ukr, "$apiUrl/v1/release?code=${it.code}", TvType.Anime) {
|
||||||
this.posterUrl = "$imagesUrl${it.images.poster}"
|
this.posterUrl = "$imagesUrl${it.images.poster}?width=640&format=webp"
|
||||||
addDubStatus("${it.playlistSize}/${it.playlistSize}", it.playlistSize)
|
addDubStatus("${it.playlistSize}/${it.playlistSize}", it.playlistSize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,8 +88,11 @@ class UnimayProvider : MainAPI() {
|
||||||
|
|
||||||
// Detailed information
|
// Detailed information
|
||||||
override suspend fun load(url: String): LoadResponse {
|
override suspend fun load(url: String): LoadResponse {
|
||||||
// Log.d("CakesTwix-Debug", url)
|
var ApiUrl = url
|
||||||
val anime = Gson().fromJson(app.get(url).text, Releases::class.java)
|
if (url.contains("/projects/")) {
|
||||||
|
ApiUrl = "$apiUrl/v1/release?code=${url.substringAfterLast("/")}"
|
||||||
|
}
|
||||||
|
val anime = Gson().fromJson(app.get(ApiUrl).text, Releases::class.java)
|
||||||
// val anime = Gson().fromJson(app.get("$apiUrl/api/release/${url.substringAfterLast("/")}").text, SearchModel::class.java)
|
// val anime = Gson().fromJson(app.get("$apiUrl/api/release/${url.substringAfterLast("/")}").text, SearchModel::class.java)
|
||||||
|
|
||||||
val showStatus = when(anime.statusCode){
|
val showStatus = when(anime.statusCode){
|
||||||
|
@ -105,14 +107,19 @@ class UnimayProvider : MainAPI() {
|
||||||
else -> TvType.Anime
|
else -> TvType.Anime
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val episodes = mutableListOf<Episode>()
|
||||||
|
|
||||||
val episodes = anime.playlist.map{
|
anime.playlist.forEach{
|
||||||
Episode(
|
if (it.premium) return@forEach
|
||||||
|
episodes.add(
|
||||||
|
Episode
|
||||||
|
(
|
||||||
"${anime.code}, ${it.number}",
|
"${anime.code}, ${it.number}",
|
||||||
it.title,
|
it.title,
|
||||||
episode = it.number,
|
episode = it.number,
|
||||||
posterUrl = if(it.imageUuid != null) { "$imagesUrl${it.imageUuid}" } else null,
|
posterUrl = if(it.imageUuid != null) { "$imagesUrl${it.imageUuid}" } else null,
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return newAnimeLoadResponse(
|
return newAnimeLoadResponse(
|
||||||
|
@ -121,7 +128,7 @@ class UnimayProvider : MainAPI() {
|
||||||
tvType,
|
tvType,
|
||||||
) {
|
) {
|
||||||
this.engName = anime.names.eng
|
this.engName = anime.names.eng
|
||||||
this.posterUrl = "$imagesUrl${anime.images.banner}"
|
this.posterUrl = "$imagesUrl${anime.images.banner}?width=1440&format=webp"
|
||||||
this.tags = anime.genres
|
this.tags = anime.genres
|
||||||
this.plot = anime.description
|
this.plot = anime.description
|
||||||
this.showStatus = showStatus
|
this.showStatus = showStatus
|
||||||
|
|
Loading…
Reference in a new issue