From 68011606946d737f9bb94c29dffff78bf0402adf Mon Sep 17 00:00:00 2001 From: David Todd Date: Tue, 24 Apr 2018 19:00:51 -0500 Subject: [PATCH] client.currently_playing() works now that I'm no longer on an outdated version from pip --- save_now_playing.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/save_now_playing.py b/save_now_playing.py index 5bf2a78..844af2a 100755 --- a/save_now_playing.py +++ b/save_now_playing.py @@ -25,12 +25,9 @@ else: sys.exit() def get_now_playing(sp): - # This should be sp.currently_playing(), but somehow does not work... - # So I used its return: https://github.com/plamere/spotipy/blob/master/spotipy/client.py#L899 - try: # Get the currently playing track and artist - np = sp._get("me/player/currently-playing", market=None) + np = sp.currently_playing() # Take a look at the other goodies that gets returned here for future stuff return "%s by: %s" % (np['item']['name'], np['item']['artists'][0]['name']) except TypeError: