mirror of
https://github.com/Shabinder/SpotiFlyer.git
synced 2024-11-22 01:04:31 +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 {
|
suspend inline fun <reified T : Any> SoundCloudRequests.doAuthenticatedRequest(url: String): T {
|
||||||
var clientID: String = SoundCloudRequests.CLIENT_ID
|
var clientID: String = SoundCloudRequests.CLIENT_ID
|
||||||
return try {
|
return try {
|
||||||
httpClient.get(url) {
|
val data: String = httpClient.get(url) {
|
||||||
parameter("client_id", clientID)
|
parameter("client_id", clientID)
|
||||||
}
|
}
|
||||||
|
globalJson.decodeFromString(data)
|
||||||
} catch (e: ClientRequestException) {
|
} catch (e: ClientRequestException) {
|
||||||
if (clientID != SoundCloudRequests.ALT_CLIENT_ID) {
|
if (clientID != SoundCloudRequests.ALT_CLIENT_ID) {
|
||||||
clientID = SoundCloudRequests.ALT_CLIENT_ID
|
clientID = SoundCloudRequests.ALT_CLIENT_ID
|
||||||
return httpClient.get(url) {
|
val data: String = httpClient.get(url) {
|
||||||
parameter("client_id", clientID)
|
parameter("client_id", clientID)
|
||||||
}
|
}
|
||||||
|
return globalJson.decodeFromString(data)
|
||||||
}
|
}
|
||||||
throw e
|
throw e
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user