Expand description
§KGet - A Powerful Download Library for Rust
kget provides robust downloading capabilities for modern applications:
- HTTP/HTTPS downloads with parallel connections (up to 32x speed)
- FTP/SFTP support for legacy and secure file transfers
- BitTorrent via magnet links with native client (requires
torrent-nativefeature) - ISO verification with automatic SHA-256 integrity checking
- Auto-optimization based on file type and network conditions
§Quick Start
use kget::{download, DownloadOptions, ProxyConfig, Optimizer};
// Simple download
let proxy = ProxyConfig::default();
let optimizer = Optimizer::new();
let options = DownloadOptions::default();
download("https://example.com/file.zip", proxy, optimizer, options, None).unwrap();§Advanced Download with Progress
use kget::{AdvancedDownloader, ProxyConfig, Optimizer};
let mut downloader = AdvancedDownloader::new(
"https://example.com/large.iso".to_string(),
"large.iso".to_string(),
false,
ProxyConfig::default(),
Optimizer::new(),
);
// Set progress callback
downloader.set_progress_callback(|progress| {
println!("Progress: {:.1}%", progress * 100.0);
});
downloader.download().unwrap();§Torrent Downloads
use kget::torrent::{download_magnet, TorrentCallbacks};
use kget::{ProxyConfig, Optimizer};
use std::sync::Arc;
let callbacks = TorrentCallbacks {
status: Some(Arc::new(|msg| println!("Status: {}", msg))),
progress: Some(Arc::new(|p| println!("Progress: {:.1}%", p * 100.0))),
};
download_magnet(
"magnet:?xt=urn:btih:...",
"./downloads",
false,
ProxyConfig::default(),
Optimizer::new(),
callbacks,
).unwrap();§Features
gui- Cross-platform GUI using egui (includestorrent-native)torrent-native- Native BitTorrent client using librqbittorrent-transmission- Transmission RPC integration
Re-exports§
pub use config::Config;pub use config::ProxyConfig;pub use config::ProxyType;pub use advanced_download::AdvancedDownloader;pub use advanced_download::ResumePolicy;pub use download::download;pub use download::verify_file_sha256;pub use download::verify_iso_integrity;pub use optimization::Optimizer;pub use progress::create_progress_bar;pub use torrent::TorrentCallbacks;pub use torrent::download_magnet;pub use utils::auto_extract;pub use utils::get_filename_from_url_or_default;pub use utils::is_extractable;pub use utils::print;pub use utils::resolve_output_path;pub use webdav::is_webdav_url;pub use ytdlp::is_video_url;pub use ytdlp::ytdlp_available;pub use ytdlp::ytdlp_binary;pub use builder::Backoff;pub use builder::BatchBuilder;pub use builder::BatchResult;pub use builder::ComputedChecksums;pub use builder::DownloadBuilder;pub use builder::DownloadResult;pub use builder::RetryConfig;pub use checksum::ChecksumAlgorithm;pub use error::KgetError;pub use events::DownloadEvent;
Modules§
- advanced_
download - Advanced parallel download functionality with resume support.
- app
- Application-facing orchestration shared by GUI frontends.
- builder
- Fluent builder API — the primary interface for the KGet library.
- checksum
- Multi-algorithm file checksum computation and sidecar-file parsing.
- config
- Configuration management for KGet.
- download
- Simple HTTP/HTTPS download functionality.
- error
- Strongly-typed error enum for the KGet public API.
- events
- Event types emitted by [
DownloadBuilder::spawn]. - ftp
- FTP download support.
- metalink
- Metalink (.meta4 / .metalink) download support.
- optimization
- Download optimization through compression and caching.
- prelude
- Prelude module for convenient imports
- progress
- Progress bar utilities for download visualization.
- queue
- Persistent download history.
- sftp
- SFTP (SSH File Transfer Protocol) download support.
- torrent
- BitTorrent download support.
- utils
- Utility functions for KGet.
- webdav
- WebDAV protocol adapter.
- ytdlp
- yt-dlp integration for downloading video content.
Structs§
- Download
Options - Options for configuring a download operation.
Functions§
- batch
- Create a
BatchBuilderfor downloading multiple URLs concurrently. - builder
- Create a
DownloadBuilderfor a single URL — the recommended API entry point.
Type Aliases§
- Progress
Callback - Type alias for progress callbacks (0.0 to 1.0)
- Status
Callback - Type alias for status message callbacks