@@ -17,6 +17,8 @@ import com.lagradost.cloudstream3.syncproviders.PlainAuthRepo
1717import com.lagradost.cloudstream3.ui.result.ResultEpisode
1818import com.lagradost.cloudstream3.utils.AppUtils.parseJson
1919import com.lagradost.cloudstream3.utils.AppUtils.toJson
20+ import kotlinx.serialization.SerialName
21+ import kotlinx.serialization.Serializable
2022import java.math.BigInteger
2123import java.util.concurrent.ConcurrentHashMap
2224import java.security.MessageDigest
@@ -34,58 +36,51 @@ class AnimeSkipAuth : AuthAPI() {
3436 return BigInteger (1 , md.digest(input.toByteArray())).toString(16 ).padStart(32 , ' 0' )
3537 }
3638
39+ @Serializable
3740 data class LoginRoot (
38- @JsonProperty(" data" )
39- val data : LoginData ,
41+ @JsonProperty(" data" ) @SerialName(" data" ) val data : LoginData ,
4042 )
4143
44+ @Serializable
4245 data class LoginData (
43- @JsonProperty(" login" )
44- val login : Login ,
46+ @JsonProperty(" login" ) @SerialName(" login" ) val login : Login ,
4547 )
4648
49+ @Serializable
4750 data class Login (
48- @JsonProperty(" authToken" )
49- val authToken : String ,
50- @JsonProperty(" refreshToken" )
51- val refreshToken : String ,
52- @JsonProperty(" account" )
53- val account : Account ,
51+ @JsonProperty(" authToken" ) @SerialName(" authToken" ) val authToken : String ,
52+ @JsonProperty(" refreshToken" ) @SerialName(" refreshToken" ) val refreshToken : String ,
53+ @JsonProperty(" account" ) @SerialName(" account" ) val account : Account ,
5454 )
5555
56+ @Serializable
5657 data class ApiRoot (
57- @JsonProperty(" data" )
58- val data : ApiData ,
58+ @JsonProperty(" data" ) @SerialName(" data" ) val data : ApiData ,
5959 )
6060
61+ @Serializable
6162 data class ApiData (
62- @JsonProperty(" myApiClients" )
63- val myApiClients : List <MyApiClient >,
63+ @JsonProperty(" myApiClients" ) @SerialName(" myApiClients" ) val myApiClients : List <MyApiClient >,
6464 )
6565
66+ @Serializable
6667 data class MyApiClient (
67- @JsonProperty(" id" )
68- val id : String ,
68+ @JsonProperty(" id" ) @SerialName(" id" ) val id : String ,
6969 )
7070
71+ @Serializable
7172 data class Account (
72- @JsonProperty(" profileUrl" )
73- val profileUrl : String ,
74- @JsonProperty(" username" )
75- val username : String ,
76- @JsonProperty(" email" )
77- val email : String ,
73+ @JsonProperty(" profileUrl" ) @SerialName(" profileUrl" ) val profileUrl : String ,
74+ @JsonProperty(" username" ) @SerialName(" username" ) val username : String ,
75+ @JsonProperty(" email" ) @SerialName(" email" ) val email : String ,
7876 )
7977
78+ @Serializable
8079 data class Payload (
81- @JsonProperty(" profileUrl" )
82- val profileUrl : String ,
83- @JsonProperty(" username" )
84- val username : String ,
85- @JsonProperty(" email" )
86- val email : String ,
87- @JsonProperty(" clientId" )
88- val clientId : String ,
80+ @JsonProperty(" profileUrl" ) @SerialName(" profileUrl" ) val profileUrl : String ,
81+ @JsonProperty(" username" ) @SerialName(" username" ) val username : String ,
82+ @JsonProperty(" email" ) @SerialName(" email" ) val email : String ,
83+ @JsonProperty(" clientId" ) @SerialName(" clientId" ) val clientId : String ,
8984 )
9085
9186 override suspend fun user (token : AuthToken ? ): AuthUser ? {
@@ -187,52 +182,43 @@ class AnimeSkip : SkipAPI() {
187182 name?.replace(asciiRegex, " " )?.lowercase()
188183 }
189184
185+ @Serializable
190186 data class Root (
191- @JsonProperty(" data" )
192- val data : Data ,
187+ @JsonProperty(" data" ) @SerialName(" data" ) val data : Data ,
193188 )
194189
190+ @Serializable
195191 data class Data (
196- @JsonProperty(" searchShows" )
197- val searchShows : List <SearchShow >,
192+ @JsonProperty(" searchShows" ) @SerialName(" searchShows" ) val searchShows : List <SearchShow >,
198193 )
199194
195+ @Serializable
200196 data class SearchShow (
201- @JsonProperty(" name" )
202- val name : String ,
203- @JsonProperty(" originalName" )
204- val originalName : String? ,
205- @JsonProperty(" seasonCount" )
206- val seasonCount : Long ,
207- @JsonProperty(" episodeCount" )
208- val episodeCount : Long ,
209- @JsonProperty(" baseDuration" )
210- val baseDuration : Double ,
211- @JsonProperty(" episodes" )
212- val episodes : List <Episode >,
197+ @JsonProperty(" name" ) @SerialName(" name" ) val name : String ,
198+ @JsonProperty(" originalName" ) @SerialName(" originalName" ) val originalName : String? ,
199+ @JsonProperty(" seasonCount" ) @SerialName(" seasonCount" ) val seasonCount : Long ,
200+ @JsonProperty(" episodeCount" ) @SerialName(" episodeCount" ) val episodeCount : Long ,
201+ @JsonProperty(" baseDuration" ) @SerialName(" baseDuration" ) val baseDuration : Double ,
202+ @JsonProperty(" episodes" ) @SerialName(" episodes" ) val episodes : List <Episode >,
213203 )
214204
205+ @Serializable
215206 data class Episode (
216- @JsonProperty(" number" )
217- val number : String? ,
218- @JsonProperty(" absoluteNumber" )
219- val absoluteNumber : String? ,
220- @JsonProperty(" season" )
221- val season : String? ,
222- @JsonProperty(" timestamps" )
223- val timestamps : List <Timestamp >,
207+ @JsonProperty(" number" ) @SerialName(" number" ) val number : String? ,
208+ @JsonProperty(" absoluteNumber" ) @SerialName(" absoluteNumber" ) val absoluteNumber : String? ,
209+ @JsonProperty(" season" ) @SerialName(" season" ) val season : String? ,
210+ @JsonProperty(" timestamps" ) @SerialName(" timestamps" ) val timestamps : List <Timestamp >,
224211 )
225212
213+ @Serializable
226214 data class Timestamp (
227- @JsonProperty(" at" )
228- val at : Double ,
229- @JsonProperty(" type" )
230- val type : Type ,
215+ @JsonProperty(" at" ) @SerialName(" at" ) val at : Double ,
216+ @JsonProperty(" type" ) @SerialName(" type" ) val type : Type ,
231217 )
232218
219+ @Serializable
233220 data class Type (
234- @JsonProperty(" name" )
235- val name : String ,
221+ @JsonProperty(" name" ) @SerialName(" name" ) val name : String ,
236222 )
237223
238224 val cache: ConcurrentHashMap <String , Data > = ConcurrentHashMap ()
@@ -367,4 +353,3 @@ class AnimeSkip : SkipAPI() {
367353 return result
368354 }
369355}
370-
0 commit comments