From 9178b54eaea7e3c0f8caeb3629f38f28c7d6ad01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 10 Sep 2019 16:44:47 +0200 Subject: [PATCH] handle errors when opening download archive file (#417) --- gallery_dl/job.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gallery_dl/job.py b/gallery_dl/job.py index b6b5a6f5..06c5875d 100644 --- a/gallery_dl/job.py +++ b/gallery_dl/job.py @@ -332,7 +332,14 @@ class DownloadJob(Job): archive = self.extractor.config("archive") if archive: path = util.expand_path(archive) - self.archive = util.DownloadArchive(path, self.extractor) + try: + self.archive = util.DownloadArchive(path, self.extractor) + except Exception as exc: + self.extractor.log.warning( + "Failed to open download archive at '%s' ('%s: %s')", + path, exc.__class__.__name__, exc) + else: + self.extractor.log.debug("Using download archive '%s'", path) postprocessors = self.extractor.config("postprocessors") if postprocessors: