Skip to main content

Enterprise-Level Terminal-Based Video Download Solution by DML Labs

Project description

DML Stream - Enterprise Edition

Release PyPI version PyPI Downloads Python Versions License

CI/CD Tests Coverage Docker Image Size GitHub Release

Platforms Code Style Security


โš ๏ธ 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 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.

Developed by: DML Labs
Lead Engineer: @devmayank-official

Key Highlights

  • 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

โœจ 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

  • ๐Ÿ”’ 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
โ”‚       โ”œโ”€โ”€ 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
โ”œโ”€โ”€ 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

# Install in development mode
pip install -e .

Install FFmpeg

Windows:

choco install ffmpeg

macOS:

brew install ffmpeg

Linux:

sudo apt update && sudo apt install ffmpeg

๐Ÿš€ Quick Start

Interactive Mode

dml-stream interactive

Download a Video

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

Download Audio

dml-stream audio --url "https://www.youtube.com/watch?v=VIDEO_ID" --format mp3

Download a Playlist

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

๐Ÿ“– Usage

CLI Commands

Download Video

# Basic download
dml-stream download --url "URL"

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

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

Download Audio

# Basic audio download
dml-stream audio --url "URL"

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

Download Playlist

# Download playlist videos
dml-stream playlist --url "URL"

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

Service Commands

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

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

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

History & Config

# View recent downloads
dml-stream history --recent

# View statistics
dml-stream history --stats

# Show configuration
dml-stream config --show

Using the Short Alias

dmls download --url "URL"

โš™๏ธ 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

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"
}

๐Ÿณ Docker Support

Pull from Registry

docker pull dmlabs/dml-stream:latest

Run Interactive Mode

docker run -it \
  -v $(pwd)/downloads:/app/downloads \
  -v $(pwd)/config:/app/config \
  dmlabs/dml-stream:latest

Docker Compose

version: '3.8'

services:
  dml-stream:
    image: dmlabs/dml-stream:latest
    container_name: dml-stream
    volumes:
      - ./downloads:/app/downloads
      - ./config:/app/config
      - ./logs:/app/logs
    environment:
      - DML_STREAM_DEFAULT_THREADS=4
    restart: unless-stopped

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

Setup Development Environment

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

# Create virtual environment
python -m venv .venv
source .venv/bin/activate

# Install development dependencies
pip install -e .[dev]

# Install pre-commit hooks
pre-commit install

Run Tests

# Run all tests
pytest

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

๐Ÿ“š API Reference

DownloadService

from dml_stream.services import DownloadService

service = DownloadService(output_folder="downloads", threads=4)

# Get video info
yt = service.get_video_info("URL")

# Download video
path = service.download_video(yt, output_format="mp4")

# Download audio
path = service.download_audio(yt, output_format="mp3")

PlaylistService

from dml_stream.services import PlaylistService

service = PlaylistService(output_folder="downloads")

# Get playlist info
info = service.get_playlist_info("URL")

# Download playlist
results = service.download_playlist(url="URL", download_type="video")

๐Ÿ”ง Troubleshooting

Common Issues

FFmpeg Not Found

FFmpegNotFoundError: FFmpeg is required for this operation

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

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

๐Ÿค 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. Commit: git commit -m 'Add amazing feature'
  6. Push: git push origin feature/amazing-feature
  7. Open a Pull Request

๐Ÿ“„ License

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

Copyright 2026 DML Labs


๐Ÿ™ Acknowledgments

  • pytubefix - YouTube data extraction
  • Rich - Beautiful terminal output
  • Click - CLI framework

๐Ÿ“ฌ Contact


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.0.0.tar.gz (65.8 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.0.0-py3-none-any.whl (74.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dml_stream-2.0.0.tar.gz
Algorithm Hash digest
SHA256 0dc5b3cd426b7d5b74e4bb7659a518c47acc7cf1b4b520e8660eb7bffba9f5ee
MD5 4630db4a2ddbbf94eb275ad5a170cbcb
BLAKE2b-256 2f2c25d5fae2d8bbc7e9cfe82f23a36b25eeb4c87a7ab1d8ddd4dc231cc2e2eb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dml_stream-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b49f838a4703f965aac7936550f5e3fae54141b04cb90125e72687697d1ab10
MD5 e581b9467edc635b7e29291c1e082d26
BLAKE2b-256 7135aae81095d5402163e232d2c6ad650f70e916e8fa435a7e393333e696108e

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