Fix Instagram exceptions

master
Nikola Forró 6 years ago
parent 24ae0dcce0
commit 8270f8e183

@ -126,7 +126,7 @@ class Commands(object):
media = instagram.get_media()
media = [m for m in media if [k for k in keywords \
if m['type'] == 'Image' and k.lower() in m['title'].lower()]]
except (InstagramError, IndexError):
except (InstagramError, TypeError, KeyError):
return None
else:
return media

Loading…
Cancel
Save