echonest/pyechonest

IndexError: list index out of range on ['songs'][0]['audio_summary']

Opened this issue · 2 comments

Occasionally I am hitting this error:

File "/usr/local/lib/python2.7/dist-packages/pyechonest-4.2.21-py2.7.egg/pyechonest/song.py", line 109, in get_audio_summary
self.cache['audio_summary'] = response['songs'][0]['audio_summary']
IndexError: list index out of range

Sounds like you're not getting any results for this particular song. Commit aa39f00 should guard against this error. Thanks for sending this along!

Nice, thanks for the quick commit. I figured that it just needed to be wrapped in an if ... there was a similar error that I saw that was a KeyError because it was calling some key from a dict that wasn't there. I will post an issue with more details if I see it again.