Architecture overview¶
StreamFlow follows a modular Python architecture.
The project separates application flow, downloading, configuration, cross-cutting concerns and utility functions.
High-level architecture¶
┌───────────────┐
│ main.py │
└───────┬───────┘
│
▼
┌───────────────────┐
│ VideoDownloader │
└─────────┬─────────┘
│
┌─────────────────┼──────────────────┐
│ │ │
▼ ▼ ▼
Configuration Decorators yt-dlp
│ │ │
▼ ▼ ▼
.env / Network / Download
settings FFmpeg / media
timing
│
▼
FFmpeg
Application layer¶
main.py is responsible for the application lifecycle.
It:
- initializes the terminal;
- creates a downloader instance;
- asks the user for configuration;
- displays the confirmation;
- starts the download;
- asks whether another download should be started.
The entry point delegates actual download functionality to VideoDownloader.
Download layer¶
VideoDownloader contains the main application logic.
It handles:
- source configuration;
- playlist detection;
- output paths;
- download options;
- yt-dlp execution;
- progress monitoring;
- error handling.
Configuration layer¶
The config package contains settings that should not be mixed with download orchestration.
It provides application configuration and video-specific settings.
Decorator layer¶
Decorators implement cross-cutting functionality.
Examples include:
- network checks;
- FFmpeg checks;
- execution-time measurement.
This allows these concerns to remain independent from the core download implementation.
Utility layer¶
The utils package contains reusable helper functions.
The console utility provides terminal-related functionality used by the application.
External dependencies¶
StreamFlow relies on:
- yt-dlp for media extraction and downloading;
- FFmpeg for multimedia processing;
- Python packages for configuration and terminal interaction.