Jump to content

So I am learning some async stuff in python, so I am creating an image downloader. It works very well but there is one thing that I would really like and that is a progress bar of the file being downloaded. I was planing on using TQDM to get a nice bar, I believe you can write with shuttill as chunks but unsure how to do it.

with requests.Session() as s:
	r = s.get(url, stream=True, timeout=5)
	with open(os.path.join(save_path, name), 'wb') as f:
		r.raw.decode_contect = True
		shutil.copyfileobj(r.raw, f)
	print('[+] Saved {}'.format(name))

 

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
https://linustechtips.com/topic/833990-python/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×