Skip to main content

Unified Local Downloader - A single CLI for torrents, magnet links, videos, and direct downloads

Project description

ULD - Unified Local Downloader

A single CLI tool for downloading content from multiple sources: torrents, magnet links, video platforms, and direct URLs.

CI Python 3.10+ License: MIT

Why ULD?

Today, downloading content requires juggling multiple tools:

  • Torrent clients for torrents/magnet links
  • yt-dlp for YouTube/videos
  • wget/curl/aria2 for direct files

Each has different CLI syntax, progress formats, and configuration. ULD provides:

  • Single interface - One command for all download types
  • Auto-detection - Automatically routes to the right engine
  • Unified progress - Consistent progress display across all downloads
  • Local-first - Runs entirely on your machine, no cloud dependencies

Installation

pip install uld-cli

# With torrent support (Linux/macOS recommended)
pip install "uld-cli[torrent]"

# Using uv
uv add uld-cli

Video engine (yt-dlp) is included by default. Torrent engine requires libtorrent which works best on Linux/macOS.

Quick Start

Torrents & Magnet Links

# Download a magnet link
uld download magnet:?xt=urn:btih:...

# Or just pass the URL directly (auto-detects)
uld magnet:?xt=urn:btih:...

# Download a .torrent file
uld download ./ubuntu-24.04.torrent

# Download without seeding
uld download magnet:... --no-seed

# Get torrent info without downloading
uld info magnet:?xt=urn:btih:...

Videos (YouTube, Vimeo, Twitter, etc.)

# Download a YouTube video (best quality)
uld download "https://youtube.com/watch?v=..."

# Download with specific quality
uld download "https://youtube.com/watch?v=..." -Q 720p

# Available qualities: best, worst, 1080p, 720p, 480p, 360p
uld download "https://youtube.com/watch?v=..." -Q 1080p

# Download entire playlist (auto-detected)
uld download "https://youtube.com/playlist?list=..."

# Get video info without downloading
uld info "https://youtube.com/watch?v=..."

Supported Video Platforms

ULD uses yt-dlp under the hood, supporting 1000+ sites including:

  • YouTube (videos & playlists)
  • Vimeo
  • Twitter/X
  • Reddit
  • Instagram
  • TikTok
  • And many more...

Commands

uld download <url>

Download content from a URL, magnet link, or torrent file.

uld download <url> [OPTIONS]

Options:
  -o, --output PATH      Output directory
  -r, --seed-ratio FLOAT Seed ratio target (default: 1.0)
  --no-seed              Don't seed after download
  -Q, --quality TEXT     Video quality (best, 1080p, 720p, etc.)
  -P, --playlist         Force playlist download
  -q, --quiet            Minimal output
  -v, --verbose          Verbose output

uld info <url>

Show metadata without downloading.

# Torrent info
uld info magnet:?xt=urn:btih:...

# Video info
uld info "https://youtube.com/watch?v=..."

uld engines

List available download engines and their status.

$ uld engines
┏━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Engine   Status         Version    ┃
┡━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ torrent  Available      2.0.11.0   │
│ video    Available      2024.12.08 │
│ http     Coming soon    -          │
└─────────┴───────────────┴────────────┘

uld config

Show current configuration.

Configuration

Configure via environment variables (prefixed with ULD_):

# Set default download directory
export ULD_DOWNLOAD_DIR=~/Downloads/uld

# Set default seed ratio
export ULD_SEED_RATIO=2.0

# Disable seeding by default
export ULD_SEED_RATIO=0

# Set rate limits (KB/s)
export ULD_DOWNLOAD_RATE_LIMIT=1000
export ULD_UPLOAD_RATE_LIMIT=500

Available Settings

Variable Default Description
ULD_DOWNLOAD_DIR ~/Downloads Default download directory
ULD_SEED_RATIO 1.0 Default seed ratio (0 = no seeding)
ULD_SEED_TIME 0 Seed time in minutes (0 = use ratio)
ULD_MAX_CONNECTIONS 200 Maximum peer connections
ULD_LISTEN_PORT_START 6881 Start of port range
ULD_LISTEN_PORT_END 6891 End of port range
ULD_ENABLE_DHT true Enable DHT
ULD_ENABLE_UPNP true Enable UPnP

Development

# Clone the repository
git clone https://github.com/jd-co/uld.git
cd uld

# Install with uv (recommended)
uv sync --all-extras

# Or with pip
pip install -e ".[dev,torrent,video]"

# The CLI command is still `uld`
uld --help

# Run tests
uv run pytest

# Run linter
uv run ruff check src tests

# Format code
uv run ruff format src tests

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see LICENSE for details.

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uld_cli-1.0.3.tar.gz (106.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uld_cli-1.0.3-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file uld_cli-1.0.3.tar.gz.

File metadata

  • Download URL: uld_cli-1.0.3.tar.gz
  • Upload date:
  • Size: 106.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for uld_cli-1.0.3.tar.gz
Algorithm Hash digest
SHA256 6f72a12ab21c5170fcd80c4e0e4743f45ee8d02b7ea792a20823ee6bf7c8507a
MD5 c780b9c85d92132ce7e6ba4d75712c3a
BLAKE2b-256 d2371d368d8c4c2ac5b835fc42f4b621ba2b3ec43192bf5fb22405cde4045a15

See more details on using hashes here.

File details

Details for the file uld_cli-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: uld_cli-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for uld_cli-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b08db79448590e6e33a20bd994fbe9f8cca7e53d68b1386ff3f923a3fe3b1f6a
MD5 5e5f20a6adddeda16ace8a9bcd6cb3ef
BLAKE2b-256 815385c32406ecbcb625286b6f0172d8f656ecb8bbd14840c903d9c8a74bc019

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page