spotipy: Breaking change in minor version?
Hi,
Super glad to see this maintained after a long halt.
I’ve noticed after upgrading from 2.4.4. to 2.19.0 that some endpoints like search no longer work when the Spotipy object is initialized with a auth param.
My old code (now returns an error):
credentials = oauth2.SpotifyClientCredentials(
client_id=SPOTIFY_CLIENT_ID,
client_secret=SPOTIFY_SECRET_ID,
)
token = credentials.get_access_token()
spotipy_obj = spotipy.Spotify(auth=token)
artist_on_spotify = spotipy_obj.search(q="X", type="artist", limit=1)
The new code:
spotipy_obj = spotipy.Spotify(client_credentials_manager=credentials)
artist_on_spotify = spotipy_obj.search(q="X", type="artist", limit=1)
Meanwhile, user-related endpoints continue to work with token.
Is this expected? I couldn’t find anything in the release notes regarding this. Maybe I didn’t look hard enough.
Also: am I correct in saying that the cache system is only for the application’s access token, not those of the application’s users?
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 15 (8 by maintainers)
Thank you for taking the time to look into this. I guess for now if I don’t find additional issues I’ll just do:
By the way, is the
spotipy.Spotifyobject designed to a be a singleton? Because in some parts of my code I repetitively initialize it en-masse, and I’m wondering if that’s what’s leading to high memory usage.