Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added scope, 'playlist-read-private', to examples that access user pl…
…aylists using the spotipy api: current_user_playlists() (fixes #591) (#595) * - Added scope, 'playlist-read-private', to examples that access user playlists using the spotipy api: current_user_playlists() (fixes #591) * Fix example to use user_playlists again Co-authored-by: Stephane Bruckert <stephane.bruckert@gmail.com>
- Loading branch information
1 parent
bea781d
commit 275cd7e
Showing
4 changed files
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
# Shows a user's playlists (need to be authenticated via oauth) | ||
|
||
import sys | ||
import spotipy | ||
from spotipy.oauth2 import SpotifyOAuth | ||
|
||
if len(sys.argv) > 1: | ||
username = sys.argv[1] | ||
else: | ||
print("Whoops, need a username!") | ||
print("usage: python user_playlists.py [username]") | ||
sys.exit() | ||
|
||
sp = spotipy.Spotify(auth_manager=SpotifyOAuth()) | ||
playlists = sp.current_user_playlists() | ||
|
||
playlists = sp.user_playlists(username) | ||
|
||
for playlist in playlists['items']: | ||
print(playlist['name']) | ||
print(playlist['name']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters