How efeckc17/youtubego works
Project type and purpose
• This is a standalone desktop application (“YoutubeGO 5.0”) written in Python 3.7+ with a PySide6 (Qt) GUI.
• It’s a modern media downloader: fetches video/audio streams from the web (YouTube, Vimeo, HTTP), manages profiles, schedules and queues, uses FFmpeg for processing, and auto-updates itself.
High-level architecture overview
• The code is modularized into three main layers:
a. Presentation/UI Layer (ui/)
b. Application/Core Logic Layer (core/)
c. Infrastructure/External Dependencies
Main components
• Entry point: main.py → instantiates Application and MainWindow
• ui/main_window.py → coordinates menus, side menu, status bar, pages
• ui/pages/… → seven page modules (home, mp4, mp3, queue, history, scheduler, profile, settings)
• ui/components/… → reusable widgets (AnimatedButton, DragDropLineEdit, LogDock, TrayIcon, ThemeManager, SearchPopup, ProfileManager, etc.)
• ui/dialogs/… → dialogs for profile editing, queue addition, scheduler creation
• ui/layouts/… → layout abstractions (side menu, top bar, status bar)
• ui/themes/*.qss → style sheets for dark/light themes
• core/downloader.py → orchestrates downloads via yt-dlp & requests, handles formats
• core/ffmpeg_checker.py → detects/validates FFmpeg binary, prompts user if missing
• core/history.py → persists and queries download history (likely via flat files or SQLite)
• core/profile.py → load/save user profile (paths, display name, social links, export/import)
• core/updater.py → checks GitHub Releases API, downloads and installs updates
• core/utils.py → shared utilities (logging, path management, concurrency helpers)
• core/version.py → app version constant and comparison logic
• yt-dlp library → low-level downloader + metadata extraction
• requests library → HTTP interactions (fallback, metadata, API calls)
• FFmpeg binary → audio/video processing (merging, transcoding)
• File System → storing profiles, history, playlists, temporary files, caches
• Network/Internet → target platforms (YouTube, Vimeo, HTTP streams)
• GitHub Releases API → version check & auto-update
Interactions & data flow
• UI Layer components emit events/signals → invoke Core Logic APIs (Downloader, Scheduler, etc.)
• Core Logic orchestrates download tasks:
• Downloader uses yt-dlp & requests → writes to File System → updates History
• FFmpegChecker → ensures FFmpeg is in PATH before extraction steps
• Updater → polls GitHub → downloads installer or patch → triggers restart
• Scheduler enqueues tasks in Downloader with timestamp triggers
• Profile import/export reads/writes zip on File System
• System Tray (TrayIcon) listens for app minimize/restore events
Architectural patterns & principles
• Layered Architecture: clear separation between UI and business logic
• MVC-like flavor in pages: each page module handles its own view + connects to Core services
• Single Responsibility: each core module focuses on one domain concept (download, profile, update, etc.)
• Event-Driven / Signal-Slot (Qt) for decoupled communication
• Dependency Injection (passing core services into UI pages)
Detail
• Cross-cutting concerns: auto-updater, theme management, error logging.
• User actions (drag & drop, menu commands) flowing into the UI layer and then into the core layer.