This commit is contained in:
alex 2024-01-08 02:46:42 +07:00
parent f160b61835
commit 09b5b76260
2 changed files with 1244 additions and 444 deletions

File diff suppressed because it is too large Load Diff

View File

@ -743,14 +743,15 @@ suspend fun getCrunchyrollToken(): CrunchyrollAccessToken {
val token = tryParseJson<CrunchyrollToken>(client.newCall(request).execute().body.string()) val token = tryParseJson<CrunchyrollToken>(client.newCall(request).execute().body.string())
val headers = mapOf("Authorization" to "${token?.tokenType} ${token?.accessToken}") val headers = mapOf("Authorization" to "${token?.tokenType} ${token?.accessToken}")
val cms = app.get("$crunchyrollAPI/index/v2", headers = headers).parsedSafe<CrunchyrollToken>()?.cms val cms =
app.get("$crunchyrollAPI/index/v2", headers = headers).parsedSafe<CrunchyrollToken>()?.cms
return CrunchyrollAccessToken( return CrunchyrollAccessToken(
token?.accessToken, token?.accessToken,
token?.tokenType, token?.tokenType,
cms?.bucket, cms?.bucket,
cms?.policy, cms?.policy,
cms?.signature, cms?.signature,
cms?.key_pair_id, cms?.key_pair_id,
) )
} }