with open(target, "wb") as fh:
for chunk in tqdm.tqdm(
response.iter_content(),
total=int(response.headers["content-length"]),
unit="bytes",
unit_scale=True,
desc="Downloading"
After Change
def do_download(url, target):
Downloads a URL.
response = urllib.request.urlopen(url)
with open(target, "wb") as fh:
with tqdm.tqdm(
total=int(response.info().get("Content-Length")),
unit="bytes",