A robust batch downloader that supports concurrent downloads with flexible options.
Built on top of curl::multi_download() for parallelism.
download_batch(
urls,
dest_dir,
overwrite = FALSE,
unzip = FALSE,
workers = 4,
verbose = TRUE,
timeout = 600,
resume = FALSE,
speed_limit = NULL,
retries = 3
)Invisibly returns a list of downloaded (and optionally unzipped) file paths.
Character vector. List of URLs to download.
Character. Destination directory (required). Use tempdir() for examples/tests.
Logical. Whether to overwrite existing files. Default: FALSE.
Logical. Whether to unzip after download (for supported formats). Default: FALSE.
Integer. Number of parallel workers. Default: 4.
Logical. Show download progress messages. Default: TRUE.
Integer. Timeout in seconds for each download. Default: 600.
Logical. Whether to resume interrupted downloads. Default: FALSE.
Numeric. Bandwidth limit in bytes/sec (e.g., 500000 = 500KB/s). Default: NULL.
Integer. Retry attempts if download fails. Default: 3.