Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload/Download Progress #21

Open
Angu0083 opened this issue Apr 13, 2022 · 1 comment
Open

Upload/Download Progress #21

Angu0083 opened this issue Apr 13, 2022 · 1 comment

Comments

@Angu0083
Copy link

Hello,

  This tool was awesome and I would request to add one more to this tool. 

  Add the upload/download progress/status and Speed of the transfer. 
@kambak
Copy link

kambak commented May 22, 2023

i dont know python but changed some code. its just for download progress.

get clint from pypi

change this section.

with open(file, "wb") as f:
        for chunk in r.iter_content(chunk_size=1024):
            f.write(chunk)

to this code.

    with open(file, 'wb') as f:
        total_length = int(r.headers.get('content-length'))
        for chunk in progress.bar(r.iter_content(chunk_size=1024), expected_size=(total_length/1024) + 1): 
                if chunk:
                    f.write(chunk)
                    f.flush()

also dont forget to add top,

from clint.textui import progress

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants