sdushantha / kunst

Download and display album art or display embedded album art
MIT License
310 stars 28 forks source link

[ BUG ] cannot curl from deezer's API #40

Closed BachoSeven closed 4 years ago

BachoSeven commented 4 years ago

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.

sdushantha commented 4 years ago

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

BachoSeven commented 4 years ago

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

sdushantha commented 4 years ago

@BachoSeven This could be a solution: https://stackoverflow.com/questions/10207354/how-to-remove-all-of-the-diacritics-from-a-file

BachoSeven commented 4 years ago

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