[GH-ISSUE #51] Abstraction of caching code #26

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

Originally created by @mikejewell on GitHub (May 22, 2015).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/51

I'm using spotipy on Heroku as a Slack bot - which works awesomely, but I've had to store the cached token on S3. I've extended SpotifyOAuth and overridden get_cached_token and _save_token_info to do this, but it'd be useful if it was possible to do this without extensio?. This would also allow for storing the token in a DB rather than in a file.

Maybe the simplest approach could be load_cached_token and save_cached_token methods, which can be overridden to cater for different storage approaches?

Originally created by @mikejewell on GitHub (May 22, 2015). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/51 I'm using spotipy on Heroku as a Slack bot - which works awesomely, but I've had to store the cached token on S3. I've extended SpotifyOAuth and overridden get_cached_token and _save_token_info to do this, but it'd be useful if it was possible to do this without extensio?. This would also allow for storing the token in a DB rather than in a file. Maybe the simplest approach could be load_cached_token and save_cached_token methods, which can be overridden to cater for different storage approaches?
kerem 2026-02-27 23:20:27 +03:00
Author
Owner

@arska commented on GitHub (Dec 4, 2015):

I had the same problem, see #61 for my workaround

<!-- gh-comment-id:161950725 --> @arska commented on GitHub (Dec 4, 2015): I had the same problem, see #61 for my workaround
Author
Owner

@markuman commented on GitHub (Jan 3, 2018):

redis as caching engine would be nice

<!-- gh-comment-id:355006848 --> @markuman commented on GitHub (Jan 3, 2018): redis as caching engine would be nice
Author
Owner

@its-schmii commented on GitHub (Nov 20, 2020):

Has there been any update on this so it is possible to use a different matter of saving sessions but file system?
Cannot seem to find any, but I might be blind / not understand spotipys oauth class well enough yet

<!-- gh-comment-id:731076096 --> @its-schmii commented on GitHub (Nov 20, 2020): Has there been any update on this so it is possible to use a different matter of saving sessions but file system? Cannot seem to find any, but I might be blind / not understand spotipys oauth class well enough yet
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#26
No description provided.