#download #url #downloader #directory

dload

A simple crate to help you download files from URLs easily

4 releases

new 0.1.3 Jun 4, 2024
0.1.2 Apr 28, 2024
0.1.1 Apr 28, 2024
0.1.0 Apr 28, 2024

#28 in #downloader

Download history 281/week @ 2024-04-25 90/week @ 2024-05-02 7/week @ 2024-05-09 33/week @ 2024-05-16 21/week @ 2024-05-23 115/week @ 2024-05-30

177 downloads per month
Used in rustfinity

MIT license

14KB
158 lines

dload

dload is a simple crate to help downloading files from the internet easily. It is a simple wrapper around the reqwest crate.

Usage

Add it to your package:

cargo add dload

Then you can use it like this:

use dload::Downloader;

#[tokio::main]
async fn main() {
  let url = "https://www.rust-lang.org/logos/rust-logo-512x512.png";

  Downloader::new()
    .set_output_dir(dir)
    .file_name("rust-logo.png")
    .download(url)
    .await
    .unwrap();
}

This will download the file from the given URL and save it to the given directory with the given file name.

Dependencies

~4–15MB
~206K SLoC