X-Git-Url: https://git.ao2.it/winfreed.git/blobdiff_plain/036da882f6f4ee1fc5a2bc0f468f9205b78df006..b37fc98f2ea385faf6b71f773ca2eae28bc0cf07:/winfreed.py diff --git a/winfreed.py b/winfreed.py index 0492028..a9af707 100755 --- a/winfreed.py +++ b/winfreed.py @@ -108,6 +108,10 @@ def download_file(src_url, dest_dir): sys.stderr.write("Warning: %s exists!\n" % destfile) return + if 'Content-Length' not in response.info(): + sys.stderr.write("Cannot get the size of the file at %s\n" % src_url) + return + total_size = response.info().getheader('Content-Length').strip() total_size = int(total_size)