Spotipy: user id's are not URL percent encoded

Created on 3 Jul 2018  路  7Comments  路  Source: plamere/spotipy

user id's are not URL encoded and results in some 404 errors when usernames contain symbols. Can be solved simply by using urllib.parser.quote but it seems this repository is no longer updated so I am posting this more as a public service announcement than anything else.

bug

All 7 comments

This can be easily triggered by using the E-Mail-Address as Username, which works for all calls that do not pass the username as an argument.

It'd be nice if someone can provide an example method where this issue can be replicated. I tried passing username and email address to sp.user(), but it seems to fail for email address both with or without percent encoding. I'm probably doing something wrong I think.

I triggered it by running the test-suite with an email-address as username.

Taking a look at the Spotify API itself, it states that the parameter to the users endpoint must be an userid, so I guess that the email-address will not work even with the encoding.
For the usernames I will try to make an pull request to fix this as soon as I found an userid that contains special characters to test with.

@Bressan09 thanks! Also note that there is https://github.com/plamere/spotipy/pull/350, what do you think of it? I am not sure myself in what scenario this is needed

Closing this as I don't think Spotify allows emails as possible usernames anymore

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IzHoBX picture IzHoBX  路  4Comments

danielgwilson picture danielgwilson  路  4Comments

Kurchunk picture Kurchunk  路  3Comments

DylanMeeus picture DylanMeeus  路  4Comments

tatoosh picture tatoosh  路  5Comments