Skip to content

Commit

Permalink
SoundCloud Parsing Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Shabinder committed Jan 26, 2022
1 parent 9b3b00f commit 2198613
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 2198613

Please sign in to comment.