Enterprise-Level Terminal-Based Video Download Solution by DML Labs
Project description
DML Stream - Enterprise Edition
โ ๏ธ 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
- Features
- Architecture
- Installation
- Quick Start
- Usage
- Configuration
- Docker Support
- Development
- API Reference
- Troubleshooting
- Contributing
- License
๐ฏ 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
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Run tests:
pytest - Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - 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
๐ฌ Contact
- GitHub: @devmayank-official
- Issues: GitHub Issues
- Email: devmayank.inbox@gmail.com
Made with โค๏ธ by DML Labs
Use responsibly and in compliance with all applicable laws and terms of service!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0dc5b3cd426b7d5b74e4bb7659a518c47acc7cf1b4b520e8660eb7bffba9f5ee
|
|
| MD5 |
4630db4a2ddbbf94eb275ad5a170cbcb
|
|
| BLAKE2b-256 |
2f2c25d5fae2d8bbc7e9cfe82f23a36b25eeb4c87a7ab1d8ddd4dc231cc2e2eb
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b49f838a4703f965aac7936550f5e3fae54141b04cb90125e72687697d1ab10
|
|
| MD5 |
e581b9467edc635b7e29291c1e082d26
|
|
| BLAKE2b-256 |
7135aae81095d5402163e232d2c6ad650f70e916e8fa435a7e393333e696108e
|