mirror of
https://github.com/c0de-archive/spotipy.git
synced 2025-07-30 14:00:18 +00:00
Adapted to new audio_features response
This commit is contained in:
@@ -633,7 +633,13 @@ class Spotify(object):
|
||||
- tracks - a list of track URIs, URLs or IDs, maximum: 50 ids
|
||||
'''
|
||||
tlist = [self._get_id('track', t) for t in tracks]
|
||||
return self._get('audio-features?ids=' + ','.join(tlist))
|
||||
results = self._get('audio-features?ids=' + ','.join(tlist))
|
||||
# the response has changed, look for the new style first, and if
|
||||
# its not there, fallback on the old style
|
||||
if 'audio_attributes' in results:
|
||||
return results['audio_attributes']
|
||||
else:
|
||||
return results
|
||||
|
||||
def _get_id(self, type, id):
|
||||
fields = id.split(':')
|
||||
|
Reference in New Issue
Block a user