From a4e264e255955a34f1b05839f0ebc6f2b5164e04 Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 30 Oct 2024 18:23:00 +0100 Subject: [PATCH] Initial commit --- .gitignore | 2 ++ hello.py | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 .gitignore create mode 100755 hello.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..909ed17 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.venv +.cache \ No newline at end of file diff --git a/hello.py b/hello.py new file mode 100755 index 0000000..80de47a --- /dev/null +++ b/hello.py @@ -0,0 +1,13 @@ +#!/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']) \ No newline at end of file