wkentaro / gdown

Google Drive Public File Downloader when Curl/Wget Fails
MIT License
4.06k stars 342 forks source link

Add support to an user defined progress bar inside download function. #241

Open jcfaracco opened 1 year ago

jcfaracco commented 1 year ago

This commit just introduces a new argument to the download function: bar. The argument let the person who is developing code define his own progress bar using whatever he wants to. It also requires the pattern of passing the current size of the file and the total size.

An external function should be defined like

def my_progress_bar(cur, total):
    print(cur, total)

And then used as:

gdown.download(id=id, bar=my_progress_bar)

Signed-off-by: Julio Faracco jcfaracco@gmail.com