Add Audio-Analysis Endpoint Method

This commit is contained in:
Hugh Rawlinson 2016-10-15 14:41:48 +02:00 committed by GitHub
parent 3f87a8b879
commit 5e3cc1f546

View File

@ -712,6 +712,14 @@ class Spotify(object):
else:
return results
def audio_analysis(self, id):
''' Get audio analysis for a track based upon its Spotify ID
Parameters:
- id - a track URIs, URLs or IDs
'''
id = self._get_id('track', id)
return self._get('audio-analysis/'+id)
def _get_id(self, type, id):
fields = id.split(':')
if len(fields) >= 3: