[GH-ISSUE #1032] .artist() query hanging #617

Closed
opened 2026-02-28 00:00:18 +03:00 by kerem · 4 comments
Owner

Originally created by @wstonehouse on GitHub (Oct 14, 2023).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1032

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]
Originally created by @wstonehouse on GitHub (Oct 14, 2023). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1032 **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 "<stdin>", line 1, in <module> 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]
kerem 2026-02-28 00:00:18 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@CDeLeon94 commented on GitHub (Nov 6, 2023):

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.

<!-- gh-comment-id:1796529885 --> @CDeLeon94 commented on GitHub (Nov 6, 2023): 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.
Author
Owner

@CDeLeon94 commented on GitHub (Nov 6, 2023):

Related? https://github.com/spotipy-dev/spotipy/issues/913

<!-- gh-comment-id:1796573122 --> @CDeLeon94 commented on GitHub (Nov 6, 2023): Related? https://github.com/spotipy-dev/spotipy/issues/913
Author
Owner

@wstonehouse commented on GitHub (Nov 7, 2023):

I figured my issue out. It was a simple case of Spotify limiting the amount
of queries you can perform. I was able to confirm this because my code
worked just fine with a friend's dev account, but not with mine. They then
seemed to lift the limit after 24 hours because it started to work again
the next day.

On Mon, Nov 6, 2023 at 4:42 PM CDeLeon94 @.***> wrote:

Related? #913 https://github.com/spotipy-dev/spotipy/issues/913


Reply to this email directly, view it on GitHub
https://github.com/spotipy-dev/spotipy/issues/1032#issuecomment-1796573122,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AM2R5EX3Z5UBCGXTAJ3LT5DYDFKVXAVCNFSM6AAAAAA6ASNTCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJWGU3TGMJSGI
.
You are receiving this because you authored the thread.Message ID:
@.***>

<!-- gh-comment-id:1798725943 --> @wstonehouse commented on GitHub (Nov 7, 2023): I figured my issue out. It was a simple case of Spotify limiting the amount of queries you can perform. I was able to confirm this because my code worked just fine with a friend's dev account, but not with mine. They then seemed to lift the limit after 24 hours because it started to work again the next day. On Mon, Nov 6, 2023 at 4:42 PM CDeLeon94 ***@***.***> wrote: > Related? #913 <https://github.com/spotipy-dev/spotipy/issues/913> > > — > Reply to this email directly, view it on GitHub > <https://github.com/spotipy-dev/spotipy/issues/1032#issuecomment-1796573122>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AM2R5EX3Z5UBCGXTAJ3LT5DYDFKVXAVCNFSM6AAAAAA6ASNTCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJWGU3TGMJSGI> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
Author
Owner

@dieser-niko commented on GitHub (May 5, 2024):

Closing as it seems the problem has been solved.

<!-- gh-comment-id:2094952094 --> @dieser-niko commented on GitHub (May 5, 2024): Closing as it seems the problem has been solved.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#617
No description provided.