From 8ed1c13fad0b9b3656d80a597139e4d59ed52a54 Mon Sep 17 00:00:00 2001 From: smdmts Date: Fri, 27 Jan 2017 10:56:22 +0900 Subject: [PATCH] ignore http error --- get_emojis.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/get_emojis.py b/get_emojis.py index 771cb95..767b7be 100644 --- a/get_emojis.py +++ b/get_emojis.py @@ -12,10 +12,13 @@ def download_image(url, path): - r = requests.get(url, stream=True) - with open(path, 'wb') as f: - for chunk in r.iter_content(): - f.write(chunk) + try: + r = requests.get(url, stream=True) + with open(path, 'wb') as f: + for chunk in r.iter_content(): + f.write(chunk) + except ValueError: + print "Oops! " + url + " could not get from slack." def reconcile_aliases(image_url, emoji):