Files
clever-spotify/hello.py
2024-10-30 18:23:00 +01:00

13 lines
480 B
Python
Executable File

#!/usr/bin/env python3
import spotipy
from spotipy.oauth2 import SpotifyOAuth
scope = "user-library-read"
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id="1ad3f973e5924940bec0bcbf1adf7475",client_secret="e0601efe11ee4e31b27b255c06d70a38",redirect_uri="http://127.0.0.1:8888",scope=scope))
results = sp.current_user_saved_tracks()
for idx, item in enumerate(results['items']):
track = item['track']
print(idx, track['artists'][0]['name'], " - ", track['name'])