diff --git a/ppparis.py b/ppparis.py index 1d797c5a5c0c7bdb1e46b6efa5cf69c6e03e1fce..2501da24e384274ad556790ebee4e57bffeef7e8 100755 --- a/ppparis.py +++ b/ppparis.py @@ -50,6 +50,9 @@ def download_file(url, dest): f = open(dest,'wb') f.write(file.content); f.close() + except (requests.ConnectionError, requests.ChunkedEncodingError): + logging.warning(f'ATTENTION: la connexion a été interrompue pendant le téléchargement de {url}, nouvelle tentative...') + download_file(url, dest) except Exception as exc: logging.warning(f'ATTENTION: Impossible de télécharger le fichier {url}: {exc}')