From de1ec301e53e03d08a3f18b78d8f29689ac55f77 Mon Sep 17 00:00:00 2001 From: Paul Lamere Date: Wed, 18 Jan 2017 17:55:05 -0500 Subject: [PATCH] Added read_a_playlist example --- examples/read_a_playlist.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 examples/read_a_playlist.py diff --git a/examples/read_a_playlist.py b/examples/read_a_playlist.py new file mode 100644 index 0000000..dbcf984 --- /dev/null +++ b/examples/read_a_playlist.py @@ -0,0 +1,13 @@ +from spotipy.oauth2 import SpotifyClientCredentials +import spotipy +import json + +client_credentials_manager = SpotifyClientCredentials() +sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager) + +uri = 'spotify:user:spotifycharts:playlist:37i9dQZEVXbJiZcmkrIHGU' +username = uri.split(':')[2] +playlist_id = uri.split(':')[4] + +results = sp.user_playlist(username, playlist_id) +print json.dumps(results, indent=4)