Skip to main content

Crate siwi_download

Crate siwi_download 

Source
Expand description

ยงsiwi-download

A high-performance file downloader library built on Tokio and Reqwest, featuring breakpoint continuation, progress tracking, and async download capabilities.

ยงFeatures

  • ๐Ÿš€ Async Download: Built on Tokio for high-performance concurrent downloads
  • ๐Ÿ“Š Progress Tracking: Visual progress bar support with indicatif
  • ๐Ÿ”„ Resume Support: Breakpoint continuation for interrupted downloads
  • ๐ŸŒ Proxy Support: HTTP/HTTPS proxy support
  • ๐Ÿ“ Flexible Storage: Custom output directory and filename support
  • ๐Ÿ”ง Builder Pattern: Fluent API for configuration

ยงQuick Start

use siwi_download::download::{Download, DownloadOptions};
use tracing::Level;
use tracing_subscriber::FmtSubscriber;

#[tokio::main]
async fn main() -> siwi_download::error::AnyResult<()> {
    let subscriber = FmtSubscriber::builder()
        .with_max_level(Level::INFO)
        .finish();
    tracing::subscriber::set_global_default(subscriber)
        .expect("setting default subscriber failed");

    let download = Download::new("./downloads");
    download.auto_create_storage_path().await?;

    let report = download
        .download("https://example.com/file.zip", DownloadOptions::default())
        .await?;

    println!("Download completed: {:?}", report);
    Ok(())
}

ยงCLI Usage

Install the CLI tool:

cargo install siwi-download

Download a file:

siwi-download -u https://example.com/file.zip -o ./downloads -P

Modulesยง

download
Download functionality for siwi-download.
error
Error types and result aliases for siwi-download.
utils
Utility functions for URL parsing, file operations, and timestamp handling.