fix: resolve undefined reference error
The error occurred when downloading a file and the 'content-length' field is missing from the HTTP response header.
This commit is contained in:
@@ -49,7 +49,7 @@ def download_file(path_to_output_file, url_to_file, show_progress = False):
|
|||||||
total_length = file_response.headers.get('content-length')
|
total_length = file_response.headers.get('content-length')
|
||||||
|
|
||||||
if total_length is None: # no content length header
|
if total_length is None: # no content length header
|
||||||
output_file.write(response.content)
|
output_file.write(file_response.content)
|
||||||
else:
|
else:
|
||||||
if (show_progress):
|
if (show_progress):
|
||||||
total_length = int(total_length)
|
total_length = int(total_length)
|
||||||
|
|||||||
Reference in New Issue
Block a user