#download-manager #multi-threading #download

bucket_dl

A multithreaded downloader with the purpose of faster downloads by splitting it into several requests, rebuilding the data client-side

5 releases

Uses new Rust 2024

new 0.2.0 Apr 12, 2025
0.1.3 Apr 11, 2025
0.1.2 Apr 11, 2025
0.1.1 Apr 10, 2025
0.1.0 Apr 9, 2025

#174 in HTTP client

Download history 492/week @ 2025-04-06

494 downloads per month

MIT/Apache

19KB
310 lines

Warning

This is still a work in progress. Yes there are issues, everything is okay.

bucket_dl

Tests Latest version

A multithreaded downloader with the purpose of faster downloads by splitting it into several requests, rebuilding the data client-side.

Features

  • When possible, splits download into 'buckets', each using a new thread and request.
  • Streams live download progress, ideal for visualising loading bars.
  • Cancellation of downloads
  • Retries failed buckets, creating a new thread/request up to x times.
  • Supports pausing and resuming downloads at any time.
  • Automatic pausing in the event of a crash.
  • Actual tests

Usage

Note

For more detailed usage, look at the examples/ directory.

  let mut client = DownloadClient::init(&url, &file_path);

  if let Ok(_) = client.begin_download().await {
    let mut stream = client.progress_stream();
    while let Some(bucket_progress) = stream.next().await {...}

    match client.status() {
      DownloadStatus::Finished => {...},
      _ => {...}
    }

  }

Warning

Always remember to check the status of the download, even after exhausting the progress updates.

Dependencies

~6–18MB
~227K SLoC