From 2ab1a583c7d9e7e5ef17a6514c6f0834d4188ac5 Mon Sep 17 00:00:00 2001 From: DoNot AskMe Date: Mon, 30 Nov 2020 16:55:38 +0300 Subject: [PATCH] catch readtimeouts and retry #12 --- deemix/app/downloadjob.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deemix/app/downloadjob.py b/deemix/app/downloadjob.py index 033df13..8f5d869 100644 --- a/deemix/app/downloadjob.py +++ b/deemix/app/downloadjob.py @@ -13,6 +13,7 @@ import errno from ssl import SSLError from os import makedirs from tempfile import gettempdir +from urllib3.exceptions import SSLError as u3SSLError from deemix.app.queueitem import QISingle, QICollection from deemix.app.track import Track, AlbumDoesntExists @@ -76,7 +77,7 @@ def downloadImage(url, path, overwrite=OverwriteOption.DONT_OVERWRITE): eventlet.sleep(1) return downloadImage(urlBase+pictureUrl.replace(str(pictureSize)+"x"+str(pictureSize), '1200x1200'), path, overwrite) logger.error("Image not found: "+url) - except (request_exception.ConnectionError, request_exception.ChunkedEncodingError) as e: + except (request_exception.ConnectionError, request_exception.ChunkedEncodingError, u3SSLError) as e: logger.error("Couldn't download Image, retrying in 5 seconds...: "+url+"\n") eventlet.sleep(5) return downloadImage(url, path, overwrite)