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