mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 09:13:53 +00:00
Added read_a_playlist example
This commit is contained in:
parent
d2f047514d
commit
de1ec301e5
13
examples/read_a_playlist.py
Normal file
13
examples/read_a_playlist.py
Normal file
@ -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)
|
||||||
Loading…
Reference in New Issue
Block a user