Skip to main content

Enterprise-Level Terminal-Based Video Download Solution by DML Labs - v2.5 with 35+ CLI commands

Project description

DML Stream v2.5 - Enterprise Edition

Version License Python

Windows macOS Linux Architecture

PyPI Docker

Code Quality Coverage

Security Vulnerabilities

Code Style Type Checked Linted

Enterprise Ready Production Maintained


โš ๏ธ LEGAL DISCLAIMER

Please read carefully before using this software:

This software is provided for educational purposes only. YouTube's Terms of Service generally prohibit downloading videos from their platform, except for videos you have created or have explicit permission to download. Using this software may violate YouTube's Terms of Service and could result in your YouTube account being terminated.

By using this software, you acknowledge:

  • You understand YouTube's Terms of Service prohibit most downloading activities
  • You will only use this software in compliance with applicable laws and YouTube's Terms of Service
  • You will only download videos that you have created or have explicit permission to download
  • You assume all legal responsibility for your use of this software
  • The developers are not responsible for any legal consequences resulting from your use of this software

๐Ÿ“– Table of Contents


๐ŸŽฏ Overview

DML Stream v2.5 is an enterprise-level, production-ready Python application for downloading YouTube videos, audio, and playlists. Built with a modular architecture following best practices for scalability, maintainability, and security.

v2.5 introduces 35+ CLI commands organized into 8 command groups, making it the most comprehensive YouTube downloader CLI available.

Developed by: DML Labs
Lead Engineer: @devmayank-official
Version: 2.5.0 (February 2026)

Key Highlights

  • 35+ CLI Commands - Comprehensive command surface for all operations
  • Modular Architecture - Clean separation of concerns with dedicated modules
  • Type-Safe - Full type hints throughout the codebase
  • Production Ready - Comprehensive error handling, logging, and testing
  • Scalable - Multi-threaded downloads, batch processing, and scheduled downloads
  • Modern Python - Built with Python 3.9+ using latest features
  • Docker Support - Multi-stage Dockerfile for production deployments
  • CI/CD Ready - GitHub Actions workflows for automated testing and deployment
  • Cross-Platform - Windows, macOS, Linux support

โœจ What's New in v2.5

๐Ÿ” Info Commands (NEW)

Get detailed information before downloading:

  • info video - Video details (title, duration, views, channel)
  • info formats - All available streams with quality/size/codec
  • info thumbnail - Preview/download thumbnail
  • info subtitle - List available subtitle languages
  • info metadata - Full metadata dump (JSON/table)
  • info channel - Channel statistics + video count

๐Ÿ“ File Operations (NEW)

Post-download file manipulation:

  • file-ops convert - Format conversion via FFmpeg
  • file-ops merge - Mux separate video/audio streams
  • file-ops extract-audio - Strip audio from video file
  • file-ops compress - Reduce file size with quality presets

๐Ÿ’พ Storage Management (NEW)

Disk space and download management:

  • storage status - Disk usage, download folder stats
  • storage analyze - Largest files, duplicates, orphans
  • storage prune - Delete incomplete/temp files
  • storage move - Relocate downloads folder
  • storage clean-cache - Wipe application + yt-dlp cache
  • storage dedupe - Find and remove duplicate downloads

โš™๏ธ Enhanced Config (NEW)

Configuration management:

  • config paths - Show all directories (downloads, logs, cache, DB)
  • config export - Export config to file
  • config import - Import config from file

๐Ÿ› ๏ธ Dev Commands (NEW)

Developer tooling:

  • dev shell - Python REPL with app context
  • dev reset-db - Wipe and recreate history DB
  • dev seed - Populate test data
  • dev benchmark - Download speed test
  • dev debug - Verbose raw stream info
  • dev export-logs - Zip and export logs

๐Ÿฅ System Commands (NEW)

System diagnostics:

  • system doctor - Health check (FFmpeg, Python, deps, disk, network)
  • system info - OS, Python version, package versions
  • system cleanup - Clean cache (same as storage clean-cache)
  • system update - Self-update via pip
  • system deps - Verify all dependencies installed
  • system report - Generate full diagnostic report (shareable)

Backward Compatibility

All v2.0 commands continue to work:

  • dml-stream download โ†’ dml-stream download video
  • dml-stream audio โ†’ dml-stream download audio
  • dml-stream playlist โ†’ dml-stream download playlist

โœจ Features

Download Capabilities

  • ๐ŸŽฅ Single Video Download - Download individual YouTube videos in various qualities
  • ๐ŸŽต Audio Extraction - Extract and download audio in multiple formats (MP3, FLAC, M4A, etc.)
  • ๐Ÿ“บ Playlist Download - Download entire YouTube playlists with progress tracking
  • ๐Ÿ”„ Resume Support - Resume interrupted downloads automatically
  • โšก Fast Mode - Multi-threaded downloads for maximum speed
  • ๐ŸŽ›๏ธ Speed Limiting - Control download bandwidth

Advanced Features

  • โฐ Scheduled Downloads - Schedule downloads for specific times
  • ๐Ÿ“ฆ Batch Processing - Queue multiple downloads sequentially
  • ๐Ÿ“Š Process Monitoring - Real-time tracking of all download processes
  • ๐Ÿ“ Download History - Track and manage download history
  • ๐Ÿ”„ Format Conversion - Convert between formats using FFmpeg
  • ๐ŸŽจ Rich CLI - Beautiful terminal interface with progress bars

Enterprise Features (v2.5)

  • ๐Ÿ” Info Commands - Inspect videos before downloading
  • ๐Ÿ“ File Operations - Post-download processing
  • ๐Ÿ—„๏ธ Storage Management - Disk space optimization
  • ๐Ÿ”’ Secure - No hardcoded secrets, environment variable support
  • ๐Ÿ“‹ Configurable - Comprehensive configuration system
  • ๐Ÿณ Containerized - Docker support for easy deployment
  • ๐Ÿงช Tested - Unit and integration test coverage
  • ๐Ÿ“– Documented - Comprehensive API documentation
  • ๐Ÿ” Linted - Code quality checks with Black, Ruff, MyPy

๐Ÿ—๏ธ Architecture

dml-stream/
โ”œโ”€โ”€ .github/workflows/       # CI/CD pipelines
โ”œโ”€โ”€ docs/                    # Documentation
โ”œโ”€โ”€ scripts/                 # Utility scripts
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ dml_stream/          # Main package
โ”‚       โ”œโ”€โ”€ __init__.py      # Package initialization
โ”‚       โ”œโ”€โ”€ __main__.py      # Entry point
โ”‚       โ”œโ”€โ”€ cli/             # Command-line interface
โ”‚       โ”‚   โ”œโ”€โ”€ commands/    # Command groups (v2.5)
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ info.py        # ๐Ÿ” Info commands
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ download.py    # ๐Ÿ’พ Download commands
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ file_ops.py    # ๐Ÿ“ File operations
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ storage.py     # ๐Ÿ—„๏ธ Storage management
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ config_cli.py  # โš™๏ธ Configuration
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ dev.py         # ๐Ÿ› ๏ธ Developer tools
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ system.py      # ๐Ÿฅ System commands
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ history.py     # ๐Ÿ“œ History
โ”‚       โ”‚   โ”‚   โ””โ”€โ”€ service.py     # ๐Ÿ”ง Service
โ”‚       โ”‚   โ”œโ”€โ”€ interactive.py # Interactive mode
โ”‚       โ”‚   โ””โ”€โ”€ main.py      # Main entry point
โ”‚       โ”œโ”€โ”€ config/          # Configuration management
โ”‚       โ”œโ”€โ”€ core/            # Core components
โ”‚       โ”œโ”€โ”€ managers/        # Business logic managers
โ”‚       โ”œโ”€โ”€ models/          # Data models
โ”‚       โ”œโ”€โ”€ services/        # Business services
โ”‚       โ””โ”€โ”€ utilities/       # Utility functions
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ unit/               # Unit tests
โ”‚   โ””โ”€โ”€ integration/        # Integration tests
โ”œโ”€โ”€ .env.example            # Environment template
โ”œโ”€โ”€ Dockerfile              # Docker build configuration
โ”œโ”€โ”€ docker-compose.yml      # Docker Compose (v2.5)
โ”œโ”€โ”€ pyproject.toml          # Project configuration (PEP 621)
โ””โ”€โ”€ README.md               # This file

๐Ÿ“ฆ Installation

Method 1: pip (Recommended)

# Install from PyPI
pip install dml-stream

Method 2: From Source

# Clone the repository
git clone https://github.com/devmayank-official/dml-stream.git
cd dml-stream

# Run setup script (recommended)
# Windows:
scripts\setup.bat

# Linux/macOS:
scripts/setup.sh

# Or manual installation:
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -e .[dev,docs]

Install FFmpeg (Required for some features)

Windows:

# Using Chocolatey
choco install ffmpeg

# Using Scoop
scoop install ffmpeg

macOS:

brew install ffmpeg

Linux:

# Ubuntu/Debian
sudo apt install ffmpeg

# Fedora
sudo dnf install ffmpeg

# Arch Linux
sudo pacman -S ffmpeg

๐Ÿš€ Quick Start

Interactive Mode (Recommended for Beginners)

dml-stream interactive
# OR using short alias
dmls interactive

Download a Video

# Basic download
dml-stream download video --url "https://www.youtube.com/watch?v=VIDEO_ID"

# With quality and format
dml-stream download video -u "URL" -q 1080p -f mp4

# Fast multi-threaded download
dml-stream download video -u "URL" --fast --threads 8

Download Audio

# Basic audio download
dml-stream download audio --url "https://www.youtube.com/watch?v=VIDEO_ID"

# With format selection
dml-stream download audio -u "URL" -f flac

Download a Playlist

# Download playlist videos
dml-stream download playlist --url "https://www.youtube.com/playlist?list=PLAYLIST_ID"

# Download playlist as audio
dml-stream download playlist -u "URL" --audio-only -f mp3

Get Video Info (NEW in v2.5)

# Get video information
dml-stream info video "https://www.youtube.com/watch?v=VIDEO_ID"

# List available formats
dml-stream info formats "URL"

# View thumbnail
dml-stream info thumbnail "URL"

System Health Check (NEW in v2.5)

# Check system health
dml-stream system doctor

# View system info
dml-stream system info

๐Ÿ“– CLI Commands Reference

๐Ÿ” Info Commands

Get information about YouTube videos, playlists, and channels.

# Get detailed video information
dml-stream info video <url>
dml-stream info video <url> --json

# List all available download formats
dml-stream info formats <url>
dml-stream info formats <url> --type progressive
dml-stream info formats <url> --json

# Preview or download video thumbnail
dml-stream info thumbnail <url>
dml-stream info thumbnail <url> --download
dml-stream info thumbnail <url> -o thumb.jpg

# List available subtitle languages
dml-stream info subtitle <url>
dml-stream info subtitle <url> --json

# Get full metadata dump
dml-stream info metadata <url>
dml-stream info metadata <url> --format json
dml-stream info metadata <url> -o metadata.json

# Get channel information
dml-stream info channel <url>
dml-stream info channel <url> --json

๐Ÿ’พ Download Commands

Download videos, audio, and playlists from YouTube.

# Download a single video
dml-stream download video --url <url>
dml-stream download video -u <url> -q 1080p -f mp4
dml-stream download video -u <url> --fast --threads 8

# Download audio only
dml-stream download audio --url <url>
dml-stream download audio -u <url> -f flac
dml-stream download audio -u <url> --fast

# Download a playlist
dml-stream download playlist --url <url>
dml-stream download playlist -u <url> --audio-only -f mp3
dml-stream download playlist -u <url> --max-videos 10

Backward Compatibility (v2.0 commands still work):

dml-stream download -u <url>      # Same as 'download video'
dml-stream audio -u <url>          # Same as 'download audio'
dml-stream playlist -u <url>       # Same as 'download playlist'

๐Ÿ“ File Operations

File manipulation and conversion commands.

# Convert format
dml-stream file-ops convert video.mkv --to mp4
dml-stream file-ops convert video.mp4 --to mp3 --quality high
dml-stream file-ops convert video.mov --to mp4 --quality lossless

# Merge video and audio
dml-stream file-ops merge --video video.mp4 --audio audio.m4a
dml-stream file-ops merge -v video.mp4 -a audio.mp3 -o output.mkv

# Extract audio from video
dml-stream file-ops extract-audio video.mp4
dml-stream file-ops extract-audio video.mkv --format flac --quality 320k

# Compress video
dml-stream file-ops compress video.mp4 --quality medium
dml-stream file-ops compress video.mkv --max-size 50MB

๐Ÿ—„๏ธ Storage Management

Storage management and disk space utilities.

# Show disk usage and stats
dml-stream storage status

# Analyze storage for largest files and duplicates
dml-stream storage analyze
dml-stream storage analyze --top 20
dml-stream storage analyze --find-duplicates

# Delete temporary and incomplete files
dml-stream storage prune
dml-stream storage prune --dry-run
dml-stream storage prune --include-incomplete

# Relocate downloads folder
dml-stream storage move /path/to/new/folder
dml-stream storage move D:\Downloads --copy

# Wipe application cache
dml-stream storage clean-cache
dml-stream storage clean-cache --dry-run
dml-stream storage clean-cache --include-ytdlp

# Find and remove duplicates
dml-stream storage dedupe
dml-stream storage dedupe --dry-run
dml-stream storage dedupe --keep oldest

โš™๏ธ Configuration

Configuration management commands.

# Show current configuration
dml-stream config show
dml-stream config show --json

# Set configuration value
dml-stream config set default_threads 8
dml-stream config set log_level DEBUG

# Reset to defaults
dml-stream config reset
dml-stream config reset --force

# Show all directory paths
dml-stream config paths

# Export configuration
dml-stream config export config.json
dml-stream config export /path/to/backup.json

# Import configuration
dml-stream config import config.json
dml-stream config import /path/to/backup.json --force

๐Ÿ› ๏ธ Developer Commands

Developer tools and debugging commands.

# Python REPL with app context
dml-stream dev shell

# Wipe and recreate history database
dml-stream dev reset-db
dml-stream dev reset-db --force

# Populate test data
dml-stream dev seed
dml-stream dev seed --count 50

# Download speed benchmark
dml-stream dev benchmark <url>
dml-stream dev benchmark <url> --threads 8 --duration 30

# Verbose debug information
dml-stream dev debug <url>
dml-stream dev debug <url> --full

# Export logs for debugging
dml-stream dev export-logs
dml-stream dev export-logs -o logs.zip
dml-stream dev export-logs --include-system

๐Ÿฅ System Commands

System diagnostics and maintenance.

# Health check and diagnostics
dml-stream system doctor
dml-stream system doctor --verbose

# System information
dml-stream system info

# Clean cache and temp files
dml-stream system cleanup
dml-stream system cleanup --dry-run

# Self-update via pip
dml-stream system update
dml-stream system update --dry-run
dml-stream system update --pre

# Verify dependencies
dml-stream system deps
dml-stream system deps --outdated

# Generate diagnostic report
dml-stream system report
dml-stream system report --format json
dml-stream system report --format markdown
dml-stream system report -o report.md

๐Ÿ”ง Service Commands

Background services and automation.

# Run daemon mode for scheduled downloads
dml-stream service --daemon

# List scheduled downloads
dml-stream service --list-scheduled

# Cancel scheduled download
dml-stream service --cancel-scheduled <id>

# Create batch download
dml-stream service --batch "My Playlist"

# List batch downloads
dml-stream service --list-batch

# View tracked processes
dml-stream service --view-processes

๐Ÿ“œ History Commands

View and manage download history.

# Show recent downloads
dml-stream history --recent
dml-stream history --recent --limit 20

# Show statistics
dml-stream history --stats

# Search history
dml-stream history --search "python"

# Show failed downloads
dml-stream history --failed

# Export history
dml-stream history --export history.json

โš™๏ธ Configuration

Environment Variables

# Set default output folder
export DML_STREAM_DEFAULT_OUTPUT_FOLDER=~/Downloads

# Set download threads
export DML_STREAM_DEFAULT_THREADS=8

# Set log level
export DML_STREAM_LOG_LEVEL=DEBUG

# Enable/disable features
export DML_STREAM_ENABLE_SCHEDULED_DOWNLOADS=true
export DML_STREAM_ENABLE_BATCH_DOWNLOADS=true
export DML_STREAM_ENABLE_DOWNLOAD_HISTORY=true

Configuration File

The application uses config.json for persistent settings:

{
    "default_output_folder": "downloads",
    "default_threads": 4,
    "max_threads": 12,
    "default_method": "normal",
    "log_level": "INFO",
    "enable_scheduled_downloads": true,
    "enable_batch_downloads": true,
    "enable_process_tracking": true,
    "enable_download_history": true
}

๐Ÿณ Docker Support

Pull from Registry

# From GitHub Container Registry
docker pull ghcr.io/devmayank-official/dml-stream:latest

# From Docker Hub (v2.5+)
docker pull dmlabs/dml-stream:latest

Run Interactive Mode

docker run -it \
  -v $(pwd)/downloads:/app/downloads \
  -v $(pwd)/config:/app/config \
  ghcr.io/devmayank-official/dml-stream:latest

Docker Compose

# Start all services
docker-compose up -d

# Run interactive CLI
docker-compose run --rm dml-cli

# Run daemon for scheduled downloads
docker-compose up -d dml-daemon

# View logs
docker-compose logs -f dml-stream

# Stop all services
docker-compose down

Docker Compose with Custom Configuration

version: '3.8'

services:
  dml-stream:
    image: ghcr.io/devmayank-official/dml-stream:latest
    container_name: dml-stream
    volumes:
      - ./downloads:/app/downloads
      - ./config:/app/config
      - ./logs:/app/logs
    environment:
      - DML_STREAM_DEFAULT_THREADS=4
      - DML_STREAM_LOG_LEVEL=INFO
      - TZ=America/New_York
    restart: unless-stopped

๐Ÿ‘จโ€๐Ÿ’ป Development

Setup Development Environment

# Clone the repository
git clone https://github.com/devmayank-official/dml-stream.git
cd dml-stream

# Run setup script
# Windows:
scripts\setup.bat

# Linux/macOS:
scripts/setup.sh

# Or manual setup:
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -e .[dev,docs]
pre-commit install

Run Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=dml_stream --cov-report=html

# Run specific test category
pytest tests/unit -v
pytest tests/integration -v -k "not network"

Code Quality

# Format code
black src/ tests/

# Lint code
ruff check src/ tests/

# Type checking
mypy src/

# Run all checks
pre-commit run --all-files

Build Documentation

cd docs
make html

# Open in browser
open _build/html/index.html  # macOS
xdg-open _build/html/index.html  # Linux
start _build/html/index.html  # Windows

๐Ÿ”ง Troubleshooting

Common Issues

FFmpeg Not Found

FFmpegNotFoundError: FFmpeg is required for this operation

Solution: Install FFmpeg and ensure it's in your system PATH.

# Verify installation
ffmpeg -version

# Windows: Add to PATH or reinstall
choco install ffmpeg

# macOS
brew install ffmpeg

# Linux
sudo apt install ffmpeg

Download Fails with "No Streams Found"

Solution:

  • Check if the video URL is valid
  • Some videos may have region restrictions
  • Try updating pytubefix: pip install --upgrade pytubefix

Permission Denied on File Operations

Solution:

  • Check file permissions on output directory
  • Run as administrator (Windows) or with sudo (Linux/macOS) if necessary
  • Ensure output directory exists and is writable

Docker Container Fails to Start

Solution:

# Check logs
docker-compose logs dml-stream

# Verify volumes
docker-compose run --rm dml-stream ls -la /app/downloads

# Rebuild container
docker-compose build --no-cache
docker-compose up -d

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Quick Start for Contributors

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Run tests: pytest
  5. Run linters: pre-commit run --all-files
  6. Commit: git commit -m 'Add amazing feature'
  7. Push: git push origin feature/amazing-feature
  8. Open a Pull Request

Development Guidelines

  • Follow PEP 8 style guidelines
  • Add type hints to all functions
  • Write tests for new features
  • Update documentation
  • Use descriptive commit messages

๐Ÿ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Copyright 2026 DML Labs


๐Ÿ™ Acknowledgments


๐Ÿ“ฌ Contact


๐Ÿ“Š Version History

v2.5.0 (February 2026)

  • NEW: 35+ CLI commands across 8 command groups
  • NEW: Info commands for video inspection
  • NEW: File operations for post-download processing
  • NEW: Storage management commands
  • NEW: Developer tools and debugging
  • NEW: System diagnostics and health checks
  • ENHANCED: Docker multi-stage builds
  • ENHANCED: CI/CD with GitHub Actions
  • ENHANCED: Cross-platform compatibility

v2.0.0 (Previous Release)

  • Basic download commands
  • Playlist support
  • Audio extraction
  • Scheduled downloads
  • Batch processing

Made with โค๏ธ by DML Labs

Use responsibly and in compliance with all applicable laws and terms of service!

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

dml_stream-2.5.1.tar.gz (122.0 kB view details)

Uploaded Source

Built Distribution

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

dml_stream-2.5.1-py3-none-any.whl (147.1 kB view details)

Uploaded Python 3

File details

Details for the file dml_stream-2.5.1.tar.gz.

File metadata

  • Download URL: dml_stream-2.5.1.tar.gz
  • Upload date:
  • Size: 122.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dml_stream-2.5.1.tar.gz
Algorithm Hash digest
SHA256 58f5c8ada6d6f40d204e675ea42dabaf9ca9154693817731f46b5c46f8a961b2
MD5 c481ea6d85af25d4aa0ffbd5fac94d6c
BLAKE2b-256 53f0e133ea2da764ad82d7398bd742149f8ae75542d79fa9a7baa6cd763680d9

See more details on using hashes here.

File details

Details for the file dml_stream-2.5.1-py3-none-any.whl.

File metadata

  • Download URL: dml_stream-2.5.1-py3-none-any.whl
  • Upload date:
  • Size: 147.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dml_stream-2.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 479a0fabc4ad9bb53d542705f0ab71cda37e23ac558c7b6d58ba9a85cac34d43
MD5 fae293de10c7a2d59752c0244048ba65
BLAKE2b-256 d0151fa2c112f14a9610f1a16189f88b01ff84a0716ce43590cfaa050aca7fed

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