transferwee icon indicating copy to clipboard operation
transferwee copied to clipboard

Upload/Download Progress

Open Angu0083 opened this issue 2 years ago • 1 comments

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. 

Angu0083 avatar Apr 13 '22 13:04 Angu0083

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

kambak avatar May 22 '23 14:05 kambak