mirror of
https://github.com/Shabinder/SpotiFlyer.git
synced 2024-11-24 09:54:33 +01:00
SoundCloud Parsing Fix
This commit is contained in:
parent
9b3b00f0d2
commit
2198613506
@ -152,15 +152,17 @@ interface SoundCloudRequests {
|
||||
suspend inline fun <reified T : Any> SoundCloudRequests.doAuthenticatedRequest(url: String): T {
|
||||
var clientID: String = SoundCloudRequests.CLIENT_ID
|
||||
return try {
|
||||
httpClient.get(url) {
|
||||
val data: String = httpClient.get(url) {
|
||||
parameter("client_id", clientID)
|
||||
}
|
||||
globalJson.decodeFromString(data)
|
||||
} catch (e: ClientRequestException) {
|
||||
if (clientID != SoundCloudRequests.ALT_CLIENT_ID) {
|
||||
clientID = SoundCloudRequests.ALT_CLIENT_ID
|
||||
return httpClient.get(url) {
|
||||
val data: String = httpClient.get(url) {
|
||||
parameter("client_id", clientID)
|
||||
}
|
||||
return globalJson.decodeFromString(data)
|
||||
}
|
||||
throw e
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user