1.安装 tqdm 模块
pip install tqdm
2.套用下面的格式就行
res = requests.get(urlxz, stream=True)
with open('1.mp4', 'wb') as f:
for data in tqdm(
res.iter_content(chunk_size=1024),
total=int(int(res.headers['Content-Length']) / 1024),
unit='kb',
leave=True,
desc='正在下载中-->'
):
pass