spotipy-dev / spotipy

A light weight Python library for the Spotify Web API
http://spotipy.readthedocs.org
MIT License
4.9k stars 954 forks source link

Dots in artists names #1079

Closed borja190898 closed 1 day ago

borja190898 commented 3 months ago

Hello, when I try to search for an artist by name and the name has dots or strange characters (for example C.R.O), it does not find it and detects it as if it were a different one. How could this be avoided? Thank you

borja190898 commented 3 months ago

Anyone know any solution? Thanks

dieser-niko commented 3 months ago

I'm not at home currently but one thing to try out would be to use alphanumeric characters only. So instead of C.R.O. just CRO

And also I just tested what would happen when I search the artist and found out that he actually calls himself CRO on spotify. It's just CRO either way. But still, it seems that the application doesn't seem to have that problem.

I'll look into this as soon as possible.

Edit: I just assumed you meant the german artist, who is also called CRO, whoops.

Voltaic314 commented 3 months ago

I don't think this really needs fixing necessarily because some artists do actually have certain characters in their spotify names. Like "S. Carey" for example. But you could try to do a recursive search where it searches what the user wants and then if no results show then try without the characters for example maybe.

itsbekas commented 3 months ago

Hello, when I try to search for an artist by name and the name has dots or strange characters (for example C.R.O), it does not find it and detects it as if it were a different one. How could this be avoided? Thank you

Hey, can you show us how you tried to search for this artist? I just tested the following snippet with the artist you used as an example:

s = Spotify(client_credentials_manager=SpotifyClientCredentials())
cro = s.search('C.R.O', type='artist')
data = cro['artists']['items'][0]['name']
print(data)

and the output was, as expected:

C.R.O
dieser-niko commented 1 month ago

@borja190898 any updates so far? Could you post a code snippet?

stephanebruckert commented 1 day ago

Closing as this seems to work and no snippet was provided