mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 09:13:53 +00:00
* - 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>
11 lines
306 B
Python
11 lines
306 B
Python
# Shows a user's playlists
|
|
|
|
import spotipy
|
|
from spotipy.oauth2 import SpotifyOAuth
|
|
|
|
scope = 'playlist-read-private'
|
|
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=scope))
|
|
|
|
results = sp.current_user_playlists(limit=50)
|
|
for i, item in enumerate(results['items']):
|
|
print("%d %s" % (i, item['name'])) |