correct handling of filename when not extracted from header
This commit is contained in:
parent
6c082c8fe4
commit
5802e7f1a1
|
@ -109,7 +109,7 @@ def download_one_zone(url, output_directory):
|
||||||
if status_code == 200:
|
if status_code == 200:
|
||||||
# Try to get the filename from the header
|
# Try to get the filename from the header
|
||||||
_,option = cgi.parse_header(download_zone_response.headers['content-disposition'])
|
_,option = cgi.parse_header(download_zone_response.headers['content-disposition'])
|
||||||
filename = option['filename']
|
filename = option.get('filename')
|
||||||
|
|
||||||
# If could get a filename from the header, then makeup one like [tld].txt.gz
|
# If could get a filename from the header, then makeup one like [tld].txt.gz
|
||||||
if not filename:
|
if not filename:
|
||||||
|
|
Loading…
Reference in a new issue