From 62b8a17fe76b86ba72dff3516d034cca975bc866 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Sun, 5 Nov 2023 20:23:29 -0700 Subject: [PATCH] adjust bars --- exfiltrate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/exfiltrate.py b/exfiltrate.py index b47a27b..4e35353 100644 --- a/exfiltrate.py +++ b/exfiltrate.py @@ -57,7 +57,7 @@ if __name__ == '__main__': row_bar = tqdm(total=len(row_iter), desc=f'Row {row_i}', postfix={'new_files': total_downloaded, 'failures': len(retries)}) for row in row_iter: row_i = row - col_bar = tqdm(total=len(range(min_col, max_col + 1)), leave=False) + col_bar = tqdm(total=len(range(min_col, max_col + 1)), leave=False, disable=True) with ThreadPoolExecutor(args.threads) as executor: futures = [executor.submit(download_tile, (row, col, args.base_url, r_headers, tiles_output, args.proxy)) for col in range(min_col, max_col + 1)] for future in as_completed(futures): @@ -65,6 +65,7 @@ if __name__ == '__main__': if result: result_row, result_col, new_image = result if new_image == 'success': + col_bar.disable = False # Only show the col_bar if we've downloaded new tiles. This prevents updating at the speed of light when checking existing files. total_downloaded += 1 tiles.append((result_row, result_col)) elif new_image == 'exist': @@ -92,7 +93,7 @@ if __name__ == '__main__': elif new_image == 'failure': col_bar.write(f'{(result_row, result_col)} failed!') col_bar.update() - col_bar.close() + col_bar.close() print(f'Downloaded {total_downloaded} images.')