Merge branch 'main' into 'main'

catch readtimeouts and retry #12

See merge request RemixDev/deemix!1
This commit is contained in:
RemixDev 2020-11-30 17:02:45 +03:00
commit 958f80c1f8
1 changed files with 2 additions and 1 deletions

View File

@ -13,6 +13,7 @@ import errno
from ssl import SSLError from ssl import SSLError
from os import makedirs from os import makedirs
from tempfile import gettempdir from tempfile import gettempdir
from urllib3.exceptions import SSLError as u3SSLError
from deemix.app.queueitem import QISingle, QICollection from deemix.app.queueitem import QISingle, QICollection
from deemix.app.track import Track, AlbumDoesntExists from deemix.app.track import Track, AlbumDoesntExists
@ -76,7 +77,7 @@ def downloadImage(url, path, overwrite=OverwriteOption.DONT_OVERWRITE):
eventlet.sleep(1) eventlet.sleep(1)
return downloadImage(urlBase+pictureUrl.replace(str(pictureSize)+"x"+str(pictureSize), '1200x1200'), path, overwrite) return downloadImage(urlBase+pictureUrl.replace(str(pictureSize)+"x"+str(pictureSize), '1200x1200'), path, overwrite)
logger.error("Image not found: "+url) 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") logger.error("Couldn't download Image, retrying in 5 seconds...: "+url+"\n")
eventlet.sleep(5) eventlet.sleep(5)
return downloadImage(url, path, overwrite) return downloadImage(url, path, overwrite)