spotipy/examples/user_playlists.py
2020-06-14 18:01:14 +01:00

11 lines
276 B
Python

# Shows a user's playlists (need to be authenticated via oauth)
import spotipy
from spotipy.oauth2 import SpotifyOAuth
sp = spotipy.Spotify(auth_manager=SpotifyOAuth())
playlists = sp.current_user_playlists()
for playlist in playlists['items']:
print(playlist['name'])