mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[GH-ISSUE #860] Search function doesn't result in the same result every time #529
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#529
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @chaitanya-gvs on GitHub (Sep 24, 2022).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/860
Describe the bug
The search function for tracks sometimes results in an empty array even though the songs are available on Spotify.
Your code

Expected behavior
The search result should be the same every time.
However the search result changes every time I run. It is not reproducible.
Output


Case 1:
Case 2:
Notice the difference in outputs between the two cases above,
The output is quite erratic and changing with every re-run.
The search function is failing to fetch the songs even if they're available.
Environment:
@dpnem commented on GitHub (Sep 25, 2022):
I believe this is an Spotify API issue with the single quotes (') in the track names. If you remove the single quote from the track titles, you should be good.
Here's a quick search I did on "search track with single quote"
@chaitanya-gvs commented on GitHub (Sep 26, 2022):
I don't think that's the case.
I have searched for tracks without single quotes in their names as well. And it still repeats.
@stephanebruckert commented on GitHub (Oct 29, 2022):
@Chaitanya98 your example does not really show that spotipy or the Spotify API is the issue.
Perhaps, your initial dataframe isn't the same or isn't ordered the same way every time?
I don't want to know what
tqdm()is doing, but your example could be simplified to do the exact same query every time.@stephanebruckert commented on GitHub (May 19, 2025):
Closing as we don't have a complete minimal example to investigate this