From ec22cca1493b282032cbc3c7bd534cd01b94e009 Mon Sep 17 00:00:00 2001 From: flu0r1ne Date: Mon, 26 Sep 2022 03:34:48 -0500 Subject: Ensure files exist prior to md5sum --- clnindexdl.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/clnindexdl.py b/clnindexdl.py index 69a4a10..16f88d8 100755 --- a/clnindexdl.py +++ b/clnindexdl.py @@ -32,11 +32,15 @@ def wget_and_verify( ftp_url, md5, output_dir ): filename = output_dir / basename - sums = md5sum(filename) + q = Path(filename) - if sums == md5: - print(f'[{filename}] skipping already exists') - return + if q.exists(): + + sums = md5sum(filename) + + if sums == md5: + print(f'[{filename}] skipping already exists') + return print(f'[{filename}] : starting download') -- cgit v1.2.3