Track the file download process.
Project description
PyEasyDownloader
Track the file download process.
Usage:
from PyEasyDownloader import *
from time import sleep
file = Downloader(link)
print(file.size_str())
file.download("download.zip")
while file.finished != True:
print("Downloaded: " + file.downloaded_str() + " | " + str(file.percents) + "% | Speed: " + file.speed_str())
sleep(1)
print("Download time: " + str(file.time_str()) + " | Average speed: " + file.speed_str())
Console result:
34.3 MB
Downloaded: 5.81 MB | 16% | Speed: 6.3 MB/sec
...
Download time: 6.03sec | Average speed: 5.7 MB/sec
Let's see the details
Change the language
This allows the units of measurement to be displayed in your language.
Supported languages:
English - EN
Russian - RU
set_lang("RU")
Indicate a link to the file
file = Downloader("https://example.zip")
Get file size
print(file.size_str()) # auto size (Recommended)
print(file.size) # in bytes
print(file.size_KB) # in kilobytes
print(file.size_MB) # in megabytes
print(file.size_GB) # in gigabytes
Start download
Two download modes:
- Super mode (While the file is downloading, you can receive actual progress)
- Standard mode (Until the file is downloaded, the program will not continue)
Super mode example:
file.download("download.zip")
while file.finished != True:
#do something
Standard mode example:
file.download("download.zip", thread=False)
What can be used in Super Mode?
file.speed_str() # auto (Recommended)
file.speed # bytes per second
file.downloaded_str() # auto (Recommended)
file.downloaded # bytes
file.percents
file.progress_bar()
Progress bar
Takes values:
step — default 5 (optional to indicate)
file.progress_bar(step=int_value)
Example:
[========== ]
Pause and Resume download
# pause
file.pause = True
# resume
file.pause = False
Cancel downloading
file.cancel()
Display statistics after download is complete
file.time_str() # auto (Recommended)
file.time() # in seconds
file.speed_str() # average speed
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
PyEasyDownloader-1.1.2.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for PyEasyDownloader-1.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b0e3c28d27fa5990a6e6cf0481c3745b738b16e382e8cfefed5d9f350dabe86 |
|
MD5 | fdae4c4732e2f7001badf79448ccdbeb |
|
BLAKE2b-256 | 8f58526382dd360e2a2310a31c881b3fdeed72afa83f090d78a23a22162a6991 |