Download¶
- download_file(filepath, url, chunk_size=1000000, timeout=30, replace=False)[source]¶
Download a file from the specified URL if it does not exist or if replace is True.
- Parameters:
filepath (str) – The path where the downloaded file will be saved.
url (str) – The URL of the file to download.
chunk_size (int, optional) – The size of each chunk in bytes. Default is 1 MB.
timeout (int, optional) – The timeout in seconds for the request. Default is 30 seconds.
replace (bool, optional) – Whether to replace the file if it already exists. Default is False.
- Return type: