net
download ¶
download(url: str, path: str, *, maxsize: int | str | None = None, progressbar: bool = False, overwrite: bool = False)
Download a file
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url |
str
|
File URL |
required |
path |
str
|
Save path |
required |
maxsize |
int | str | None
|
Maximum file size in bytes or human readable format. |
None
|
progressbar |
bool
|
Display progress bar in console. |
False
|
overwrite |
bool
|
Overwrite destination path if it already exists. |
False
|
Raises:
| Type | Description |
|---|---|
FileExistsError
|
if path already exists and overwrite is set to False |
DownloadSizeExceededError
|
if file size exceeds maxsize |