Skip to content

Commit

Permalink
Added read_a_playlist example
Browse files Browse the repository at this point in the history
  • Loading branch information
plamere committed Jan 18, 2017
1 parent d2f0475 commit de1ec30
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions 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)

0 comments on commit de1ec30

Please sign in to comment.