Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.artist() query hanging #1032

Closed
wstonehouse opened this issue Oct 14, 2023 · 4 comments
Closed

.artist() query hanging #1032

wstonehouse opened this issue Oct 14, 2023 · 4 comments
Labels

Comments

@wstonehouse
Copy link

Describe the bug
When trying to query the information of an artist, the query hangs. I thought this could be an issue with rate limits, but I haven't run my code in a while, and I make sure this is the first query I execute. I've tried other queries as well, all which work perfectly. I can extract my playlist and get the songs from my playlist. But the moment I want to get information on the artist, it ceases to work. It just hangs for an indefinite amount of time. The odd part was that nothing in my code changed. It was working perfectly fine one moment, then just stopped working, and hasn't began working again all day. I don't get any errors, but I pasted some of the output when I do a keyboard inturrupt.

Your code
import spotipy
import spotipy.util as util
from spotipy.oauth2 import SpotifyOAuth

username = 'hidden'
token = util.prompt_for_user_token(username)
spotifyObject = spotipy.Spotify(auth=token, requests_timeout=10, retries=10)
artistDetails = spotifyObject.artist('3EgMK920cIH5aLxFnJ6zSi')

Expected behavior
For the last line of code to return information about the artist with their code.

Output

artistDetails = spotifyObject.artist(artistId)
^CTraceback (most recent call last):
File "", line 1, in
File "/Users/wstoneho/Library/Python/3.9/lib/python/site-packages/spotipy/client.py", line 392, in artist
return self._get("artists/" + trid)
File "/Users/wstoneho/Library/Python/3.9/lib/python/site-packages/spotipy/client.py", line 323, in _get
return self._internal_call("GET", url, payload, kwargs)
File "/Users/wstoneho/Library/Python/3.9/lib/python/site-packages/spotipy/client.py", line 266, in _internal_call
response = self._session.request(
File "/Users/wstoneho/Library/Python/3.9/lib/python/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/Users/wstoneho/Library/Python/3.9/lib/python/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/Users/wstoneho/Library/Python/3.9/lib/python/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
File "/Users/wstoneho/Library/Python/3.9/lib/python/site-packages/urllib3/connectionpool.py", line 939, in urlopen
retries.sleep(response)
File "/Users/wstoneho/Library/Python/3.9/lib/python/site-packages/urllib3/util/retry.py", line 355, in sleep
slept = self.sleep_for_retry(response)
File "/Users/wstoneho/Library/Python/3.9/lib/python/site-packages/urllib3/util/retry.py", line 334, in sleep_for_retry
time.sleep(retry_after)
KeyboardInterrupt

Environment:

  • OS: Mac
  • Python version 3
  • spotipy version [e.g. 2.12.0]
@CDeLeon94
Copy link

I think I might be having a similar issue, no matter what I try to do with the client object after creating it, the subsequent call just hangs. Keyboard interrupt doesn't seem to do anything, presumably because it wont get through until the sleep timer ends.

@CDeLeon94
Copy link

Related? #913

@wstonehouse
Copy link
Author

wstonehouse commented Nov 7, 2023 via email

@dieser-niko
Copy link
Member

Closing as it seems the problem has been solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants