download(url,
directory=None,
bufsize=8192)
| source code
|
Download the specified URL to a directory. This module properly handles
HTTP authentication for URLs like this one:
https://user:password@localhost:8080/foo/bar/baz.tgz
Note, however, that user/password authentication is only supported for
"http" and "https" URLs.
- Parameters:
url (str) - the URL to download
directory (str) - The directory to receive the downloaded file. If this parameter is
omitted, download() will create a temporary directory to
contain the file.
bufsize (int) - buffer size to use when reading URL
- Returns: tuple
- A (download_directory, downloaded_file) tuple
|