Change cover download timeout to generic timeout

This commit is contained in:
RemixDev 2020-06-12 13:15:59 +02:00
parent 5a9fdca4f8
commit 8c1dfe63d0
1 changed files with 3 additions and 3 deletions

View File

@ -95,9 +95,6 @@ def downloadImage(url, path, overwrite="n"):
f.write(image.content)
chmod(path, 0o770)
return path
except ConnectionError:
sleep(1)
return downloadImage(url, path, overwrite)
except HTTPError:
if 'cdns-images.dzcdn.net' in url:
urlBase = url[:url.rfind("/")+1]
@ -108,6 +105,9 @@ def downloadImage(url, path, overwrite="n"):
sleep(1)
return downloadImage(urlBase+pictureUrl.replace(str(pictureSize)+"x"+str(pictureSize), '1400x1400'), path, overwrite)
logger.error("Couldn't download Image: "+url)
except:
sleep(1)
return downloadImage(url, path, overwrite)
remove(path)
return None
else: