spotipy/examples/my_playlists.py
2022-12-26 16:17:09 +01:00

12 lines
307 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']))