AudiusProject/audius-terminal-player

Invalid API call / Missing status code check in API

manav2401 opened this issue · 0 comments

I tried installing it in mac os. On running the command audius, it panics and throws a json decoding error. On further investigating the error, it looks like the request happening in get_api_endpoint() function throws an error code 403 and hence the data in response is not json decodable. The same URL gives correct response on browser.

Possible solutions might be throw a user friendly error by checking r.status_code == 200 or add few additional headers so that your backend considers this request as if it's sent from a browser and then parse it.