unimay: Fix, some changes in models
This commit is contained in:
parent
8b1005d159
commit
99331931ee
2 changed files with 17 additions and 84 deletions
|
@ -20,7 +20,6 @@ import com.lagradost.cloudstream3.newAnimeSearchResponse
|
||||||
import com.lagradost.cloudstream3.newHomePageResponse
|
import com.lagradost.cloudstream3.newHomePageResponse
|
||||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
import com.lagradost.cloudstream3.utils.M3u8Helper
|
import com.lagradost.cloudstream3.utils.M3u8Helper
|
||||||
import com.lagradost.cloudstream3.utils.Qualities
|
|
||||||
import com.lagradost.models.Releases
|
import com.lagradost.models.Releases
|
||||||
import com.lagradost.models.SearchModel
|
import com.lagradost.models.SearchModel
|
||||||
|
|
||||||
|
@ -38,7 +37,7 @@ class UnimayProvider : MainAPI() {
|
||||||
)
|
)
|
||||||
|
|
||||||
private val apiUrl = "https://api.unimay.media"
|
private val apiUrl = "https://api.unimay.media"
|
||||||
private val findUrl = "$apiUrl/api/release/search/?title="
|
private val findUrl = "$apiUrl/v1/release/search?title="
|
||||||
private val imagesUrl = "$apiUrl/storage/images/"
|
private val imagesUrl = "$apiUrl/storage/images/"
|
||||||
|
|
||||||
// Sections
|
// Sections
|
||||||
|
@ -72,7 +71,8 @@ class UnimayProvider : MainAPI() {
|
||||||
|
|
||||||
// Detailed information
|
// Detailed information
|
||||||
override suspend fun load(url: String): LoadResponse {
|
override suspend fun load(url: String): LoadResponse {
|
||||||
val anime = app.get("$apiUrl/api/release/${url.substringAfterLast("/")}").parsedSafe<SearchModel>()!!
|
// Log.d("CakesTwix-Debug", url)
|
||||||
|
val anime = app.get(url).parsedSafe<SearchModel>()!!
|
||||||
// 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){
|
||||||
|
@ -138,23 +138,6 @@ class UnimayProvider : MainAPI() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (episode.sd != null) {
|
|
||||||
callback(ExtractorLink(episode.sd,"Unimay", episode.sd, "https://www.unimay.media",
|
|
||||||
Qualities.P480.value, false))
|
|
||||||
}
|
|
||||||
if (episode.hd != null) {
|
|
||||||
callback(ExtractorLink(episode.hd,"Unimay", episode.hd, "https://www.unimay.media",
|
|
||||||
Qualities.P720.value, false))
|
|
||||||
}
|
|
||||||
if (episode.fhd != null) {
|
|
||||||
callback(ExtractorLink(episode.fhd,"Unimay", episode.fhd, "https://www.unimay.media",
|
|
||||||
Qualities.P1080.value, false))
|
|
||||||
}
|
|
||||||
if (episode.qhd != null) {
|
|
||||||
callback(ExtractorLink(episode.qhd,"Unimay", episode.qhd, "https://www.unimay.media",
|
|
||||||
Qualities.P2160.value, false))
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,79 +2,29 @@ package com.lagradost.models
|
||||||
|
|
||||||
data class SearchModel (
|
data class SearchModel (
|
||||||
|
|
||||||
val id : Int,
|
|
||||||
val aniListId : Int,
|
|
||||||
val episodes : Int,
|
|
||||||
val episodeLength : Int,
|
|
||||||
val year : Int,
|
|
||||||
val restricted : Boolean,
|
|
||||||
val active : Boolean,
|
|
||||||
val announce : String,
|
|
||||||
val code : String,
|
val code : String,
|
||||||
val tgCode : String,
|
val year : Int,
|
||||||
val cdnCode : String,
|
|
||||||
val description : String,
|
val description : String,
|
||||||
val lastUpdate : Long,
|
|
||||||
val name : String,
|
|
||||||
val engName : String,
|
|
||||||
// https://api.unimay.media/api/release/suzume-locking-up-the-doors
|
|
||||||
// val trailerPlaylist : String?,
|
|
||||||
val timestamp : Long,
|
|
||||||
val season : String,
|
|
||||||
val type : String,
|
val type : String,
|
||||||
val posterId : Int,
|
val engName : String,
|
||||||
val imageId : Int,
|
// val translators : List<Translators>,
|
||||||
val genres : List<String>,
|
|
||||||
val playlist : List<Playlist>,
|
val playlist : List<Playlist>,
|
||||||
val playlistSize : Int,
|
val genres : List<String>,
|
||||||
val actors : List<Actors>,
|
val aniListId : Int,
|
||||||
val translators : List<Translators>,
|
val imageId : Int,
|
||||||
val soundmans : List<Soundmans>,
|
val name : String,
|
||||||
val genresInString : String,
|
val posterId : Int,
|
||||||
val statusCode : Int
|
val statusCode : Int,
|
||||||
)
|
val episodeLength : Int,
|
||||||
|
|
||||||
data class Actors (
|
|
||||||
|
|
||||||
val id : Int,
|
|
||||||
val firstName : String,
|
|
||||||
val lastName : String,
|
|
||||||
val nickName : String,
|
|
||||||
val city : String,
|
|
||||||
val avtarId : Int
|
|
||||||
)
|
)
|
||||||
|
|
||||||
data class Playlist (
|
data class Playlist (
|
||||||
|
|
||||||
// val id : Int,
|
val preview : Int,
|
||||||
val number : Int,
|
|
||||||
val title : String,
|
val title : String,
|
||||||
val preview : String?,
|
val number : Int,
|
||||||
val previewId : Int?,
|
val previewId : Int,
|
||||||
val sd : String?,
|
val playlist : String,
|
||||||
val hd : String?,
|
|
||||||
val fhd : String?,
|
|
||||||
val qhd : String?,
|
|
||||||
val playlist : String?,
|
|
||||||
val hidden : Boolean
|
|
||||||
)
|
)
|
||||||
|
|
||||||
data class Soundmans (
|
|
||||||
|
|
||||||
val id : Int,
|
|
||||||
val firstName : String,
|
|
||||||
val lastName : String,
|
|
||||||
val nickName : String,
|
|
||||||
val city : String,
|
|
||||||
val avtarId : Int
|
|
||||||
)
|
|
||||||
|
|
||||||
data class Translators (
|
|
||||||
|
|
||||||
val id : Int,
|
|
||||||
val firstName : String,
|
|
||||||
val lastName : String,
|
|
||||||
val nickName : String,
|
|
||||||
val city : String,
|
|
||||||
val avtarId : Int
|
|
||||||
)
|
|
||||||
|
|
Loading…
Reference in a new issue