Skip to content

JDis03/darkdm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

99 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DarkDM

Better than yt-dlp. Multi-threaded download manager for Linux with Chrome extension, native Rust engine, and Tauri GUI.

Rust License

Status: βœ… Native CLI ready Β· πŸ”œ Tauri GUI in progress


Quick Start

# Download anything
darkdm descargar "https://example.com/file.zip"

# YouTube, MediaFire, any site
darkdm descargar "https://www.youtube.com/watch?v=..."
darkdm descargar "https://www.mediafire.com/file/XXXX/video.rar"

# Multi-threaded (8 workers)
darkdm descargar "https://cdn.example.com/large.iso" --threads 8

# Probe without downloading
darkdm info "https://example.com/file.zip"

# View logs
darkdm logs
darkdm logs --follow

Features

βœ… Production Ready

  • Multi-threaded downloads β€” Dynamic piece-splitting (XDM algorithm), 8 workers default
  • Smart resume β€” Crash-safe state with atomic writes, resume from any interruption
  • Site extractors β€” YouTube (yt-dlp), MediaFire, generic HTML analyzer
  • HLS/DASH support β€” Automatic ffmpeg integration for streaming protocols
  • Progress tracking β€” ILoveCandy Pac-Man progress bar
  • Logging system β€” Structured logs (console + rotating files), darkdm logs command
  • Auto-rename β€” Never overwrites files (file.mp4 β†’ file (1).mp4)
  • Disk space check β€” Fails fast if insufficient space

πŸ”œ Coming Soon

  • Tauri GUI β€” Desktop app with real-time progress
  • Queue manager β€” Multiple concurrent downloads
  • Browser integration β€” Chrome extension auto-capture

Installation

Prerequisites

# Arch Linux
sudo pacman -S rust cargo ffmpeg

# Ubuntu/Debian
sudo apt install rustc cargo ffmpeg

# YouTube support (optional)
pip install yt-dlp

Build from source

git clone https://github.com/JDis03/darkdm.git
cd darkdm
./init.sh

# Build CLI
cd src-tauri
cargo build --release --bin darkdm

# Install
sudo cp target/release/darkdm /usr/local/bin/

Verify

darkdm --help
darkdm info "https://httpbin.org/bytes/1024"

Usage

Basic Downloads

# Download any file
darkdm descargar "https://example.com/file.zip"

# Custom output directory
darkdm descargar "https://example.com/file.zip" --output ~/Downloads

# More workers (faster for large files)
darkdm descargar "https://example.com/file.zip" --threads 16

# Disable resume
darkdm descargar "https://example.com/file.zip" --no-resume

Site-Specific

# YouTube (uses yt-dlp)
darkdm descargar "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

# MediaFire (auto-extracts direct link)
darkdm descargar "https://www.mediafire.com/file/XXXX/file.rar"

# HLS streams (uses ffmpeg)
darkdm descargar "https://cdn.example.com/stream.m3u8"

Debugging

# Verbose logging (DEBUG level)
darkdm descargar "https://example.com/file.zip" --verbose

# Custom log level
RUST_LOG=trace darkdm descargar "https://example.com/file.zip"

# View logs
darkdm logs -n 50
darkdm logs --follow

# Probe URL (no download)
darkdm info "https://example.com/file.zip"

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      darkdm CLI                             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                             β”‚
β”‚  1. Probe URL                                               β”‚
β”‚     β”œβ”€ HEAD request β†’ size, resumable, content-type        β”‚
β”‚     └─ Detect HTML β†’ trigger extraction                    β”‚
β”‚                                                             β”‚
β”‚  2. Extract (if needed)                                     β”‚
β”‚     β”œβ”€ YouTube β†’ yt-dlp (HLS manifest)                      β”‚
β”‚     β”œβ”€ MediaFire β†’ scrape HTML                             β”‚
β”‚     └─ Generic β†’ <video>, <audio>, <a href> tags           β”‚
β”‚                                                             β”‚
β”‚  3. Download                                                β”‚
β”‚     β”œβ”€ Multi-threaded (8 workers, dynamic piece-split)     β”‚
β”‚     β”œβ”€ Range requests (HTTP 206 Partial Content)           β”‚
β”‚     β”œβ”€ TransactedIO (crash-safe state, atomic writes)      β”‚
β”‚     β”œβ”€ Progress bar (ILoveCandy Pac-Man)                   β”‚
β”‚     └─ Auto-resume on interruption                         β”‚
β”‚                                                             β”‚
β”‚  4. Post-process                                            β”‚
β”‚     β”œβ”€ HLS/DASH β†’ ffmpeg merge                             β”‚
β”‚     └─ Auto-rename if file exists                          β”‚
β”‚                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           ↓
              ~/Descargas/DarkDM/file.mp4

Key Algorithms (ported from XDM)

  • Dynamic piece-splitting β€” Work-stealing, not static N-parts
  • TransactedIO β€” 3-file rotation, atomic rename(2) for crash safety
  • ContinueAdjacentPiece β€” Reuse TCP connections between pieces
  • Accept-Encoding: identity β€” Critical for accurate Range calculations

Documentation


Project Status

Feature Status Notes
Multi-threaded download βœ… Done 8 workers, dynamic piece-splitting
Resume support βœ… Done Crash-safe TransactedIO
Site extractors βœ… Done YouTube, MediaFire, generic HTML
HLS/DASH support βœ… Done ffmpeg integration
Progress bar βœ… Done ILoveCandy Pac-Man
Logging system βœ… Done tracing + rotating files
CLI interface βœ… Done clap, descargar/info/logs
Tauri GUI πŸ”œ Next Desktop app with real-time progress
Queue manager πŸ”œ Next Multiple concurrent downloads
Browser extension πŸ”œ Next Auto-capture from Chrome

Tests: 38/38 passing Β· Build: ./init.sh passes


Tech Stack

  • Rust β€” Core engine (reqwest, tokio, async-trait)
  • tracing β€” Structured logging with file rotation
  • clap β€” CLI argument parsing
  • scraper β€” HTML parsing for site extractors
  • yt-dlp β€” YouTube extraction (external)
  • ffmpeg β€” HLS/DASH merging (external)
  • Tauri β€” Desktop GUI (coming soon)

Contributing

  1. Fork the repo
  2. Create a feature branch (git checkout -b feat/amazing)
  3. Run tests (cargo test --lib)
  4. Commit (git commit -m 'feat: add amazing feature')
  5. Push (git push origin feat/amazing)
  6. Open a Pull Request

Development:

# Run tests
cargo test --lib

# Build CLI
cargo build --release --bin darkdm

# Verify
./init.sh

License

MIT β€” See LICENSE for details.


Acknowledgments

  • XDM β€” Algorithms for dynamic piece-splitting and crash-safe state
  • yt-dlp β€” YouTube extraction backend

Built with ❀️ for Linux power users

About

Video Download Manager for Linux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors