retry when invalid file
This commit is contained in:
parent
1ec0630b6e
commit
3ff29d678c
|
@ -21,10 +21,11 @@ def download_tile(task):
|
|||
output_path: Path = output / f"{row}_{col}.png"
|
||||
if output_path.exists():
|
||||
if not is_png(output_path):
|
||||
# Delete the file and try again later.
|
||||
# Delete the file and try again.
|
||||
del_path(output_path)
|
||||
return row, col, 'failure'
|
||||
return row, col, 'exist'
|
||||
# return row, col, 'failure'
|
||||
else:
|
||||
return row, col, 'exist'
|
||||
tile_url = f"{base_url}/{row}/{col}"
|
||||
response = requests.get(tile_url, headers=r_headers, proxies=PROXIES if use_proxy else None, timeout=60)
|
||||
if response.status_code == 200:
|
||||
|
|
Loading…
Reference in New Issue