sdushantha/kunst

[ BUG ] cannot curl from deezer's API

BachoSeven opened this issue · 4 comments

The output from kunst is

parse error: Invalid numeric literal at line 1, column 20

but I digged a little and it seems that `curl -s "$API_URL" is giving the following output:

<html><body><h1>400 Bad request</h1>
Your browser sent an invalid request.
</body></html>

I can wget "$API_URL" and parse it correctly with jq, tho. So it does not seem like a problem with the API having changed like in #36.

The URL in question was https://api.deezer.com/search/autocomplete?q=Björk%20-%20Cosmogony, form an mpc query of Björk - Hollow.

I suspect there could be an issue with the "ö", since I can curl many other albums.

I suspect there could be an issue with the "ö", since I can curl many other albums.

Yes that could be the case. Maybe we could replace "ö" with "o" because it returns the same data.
Im unfortunately unable to test the code because I currently dont have access to a Linux computer :(
I'll work on this as soon as I get access to a Linux computer

Just adding problematic characters: the â in Mâché gives the same issue.

Nice! Since it looks like getting sed to work would depend on its implementation and/or your Locale, I think the best option here is the iconv utility