SoundCloud Parsing Fix

This commit is contained in:
Shabinder 2022-01-27 00:50:07 +05:30
parent 9b3b00f0d2
commit 2198613506

View File

@ -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
}