From ba1f10666554316c262efd2ee6950560560317c7 Mon Sep 17 00:00:00 2001 From: Cody Logan Date: Fri, 20 Oct 2023 12:59:08 -0700 Subject: Fix bug in batch downloading An invalid line in the batch file would cause the last valid file to be downloaded twice. --- src/wikiget/wikiget.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wikiget/wikiget.py b/src/wikiget/wikiget.py index 4446f96..af13bc8 100644 --- a/src/wikiget/wikiget.py +++ b/src/wikiget/wikiget.py @@ -181,10 +181,12 @@ def batch_download(args): file = prep_download(line, args) except ParseError as e: logging.warning(f"{e} (line {line_num})") + continue except (ConnectionError, HTTPError, InvalidResponse, LoginError, APIError): logging.error( f"Unable to download '{line}' (line {line_num}) due to an error" ) + continue future = executor.submit(download, file, args) futures.append(future) # wait for downloads to finish -- cgit v1.2.3