[GH-ISSUE #843] "search" request never returns result #518

Closed
opened 2026-02-27 23:23:05 +03:00 by kerem · 2 comments
Owner

Originally created by @KamranAbbaszadeIbrahim on GitHub (Aug 4, 2022).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/843

Hi All,

I was able to run requests and search playlist by playlist_id or artist by artist_id.

But, after running many search requests, now I am not able to receive results.
I see that my function goes to infinit attempts to call search function and does not return result.
search()
navigate_next
_get()
navigate_next
_internal_call()
navigate_next
request()
navigate_next
send()
navigate_next
send()
navigate_next
urlopen()
navigate_next
sleep()
navigate_next
sleep_for_retry()

Note: I use Google Collab.
I am using next pip3 commands before importing packages for python code.
!pip3 install spotipy
!pip3 install spotipy --upgrade
!pip3 install urllib3 --upgrade
!pip3 install requests --upgrade

Function is pretty easy:
def search_playlist(keyword, spotify):
result = None
result = spotify.search(q=keyword, limit=50, type='playlist').get('playlists')
return result

Please, help to resolve current issue. I tried already to terminate Colab Session, reload page. Tried in different Browser. I tried to reset client_secret and use new one within the same app registered in Spotify Developer Dashboard. I tried to register new app in Developer dashboard and use different client_id and client_secret.

Originally created by @KamranAbbaszadeIbrahim on GitHub (Aug 4, 2022). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/843 Hi All, I was able to run requests and search playlist by playlist_id or artist by artist_id. But, after running many search requests, now I am not able to receive results. I see that my function goes to infinit attempts to call search function and does not return result. search() navigate_next _get() navigate_next _internal_call() navigate_next request() navigate_next send() navigate_next send() navigate_next urlopen() navigate_next sleep() navigate_next sleep_for_retry() Note: I use Google Collab. I am using next pip3 commands before importing packages for python code. !pip3 install spotipy !pip3 install spotipy --upgrade !pip3 install urllib3 --upgrade !pip3 install requests --upgrade Function is pretty easy: def search_playlist(keyword, spotify): result = None result = spotify.search(q=keyword, limit=50, type='playlist').get('playlists') return result Please, help to resolve current issue. I tried already to terminate Colab Session, reload page. Tried in different Browser. I tried to reset client_secret and use new one within the same app registered in Spotify Developer Dashboard. I tried to register new app in Developer dashboard and use different client_id and client_secret.
kerem 2026-02-27 23:23:05 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@SteveH0401 commented on GitHub (Aug 7, 2022):

Check the authorization scope. Needs to include playlist-read-private or playlist-read-collabrative to read list of playlists.

<!-- gh-comment-id:1207403646 --> @SteveH0401 commented on GitHub (Aug 7, 2022): Check the authorization scope. Needs to include playlist-read-private or playlist-read-collabrative to read list of playlists.
Author
Owner

@dieser-niko commented on GitHub (Jan 3, 2025):

Hi there, it seems that you've reached a request limit. Urllib tries to wait a certain amount of time before retrying the request (which can take about 12 hours). However, if you want to avoid these limits in the future, make sure you upgrade to 2.25.0, as it now prints a warning when it hits a limit instead of just waiting.

<!-- gh-comment-id:2569224217 --> @dieser-niko commented on GitHub (Jan 3, 2025): Hi there, it seems that you've reached a request limit. Urllib tries to wait a certain amount of time before retrying the request (which can take about 12 hours). However, if you want to avoid these limits in the future, make sure you upgrade to 2.25.0, as it now prints a warning when it hits a limit instead of just waiting.
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#518
No description provided.