# cyprien63/youtube-download architecture

> Architecture diagram of the GitHub repository cyprien63/youtube-download, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cyprien63/youtube-download
- Repository: https://github.com/cyprien63/youtube-download
- Video tour (about a minute): https://gitdiagram.com/cyprien63/youtube-download/video

## Overview

YouTube Downloader is a desktop application: users enter a YouTube URL, inspect an optional preview, choose destination and media options, then start or cancel a download and follow its progress. The GUI delegates download work to a manager, which uses yt-dlp with pytubefix as a fallback and FFmpeg for conversion and metadata work. Settings and downloaded files are local state; the app also offers a development-mode update check. Some downloader and GUI implementation is excerpted only, so uncertain internal call paths are omitted.

Main entry points: [`src/downloader.py`](https://github.com/cyprien63/youtube-download/blob/main/src/downloader.py) (Download manager), [`src/gui.py`](https://github.com/cyprien63/youtube-download/blob/main/src/gui.py) (Downloader GUI), [`main.py`](https://github.com/cyprien63/youtube-download/blob/main/main.py) (Application entry), [`src/ffmpeg_manager.py`](https://github.com/cyprien63/youtube-download/blob/main/src/ffmpeg_manager.py) (FFmpeg manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_app["Application entry<br/>[main.py]"]
  node_gui["Downloader GUI<br/>[gui.py]"]
  node_settings["User settings<br/>[gui.py]"]
  node_preview["Video preview<br/>[gui.py]"]
end

subgraph group_download["Download workflow"]
  node_manager["Download manager<br/>[downloader.py]"]
  node_ytdlp["yt-dlp"]
  node_pytubefix["pytubefix fallback"]
  node_download_files["Downloaded media"]
end

subgraph group_runtime["Runtime support"]
  node_ffmpeg_manager["FFmpeg manager<br/>[ffmpeg_manager.py]"]
  node_logger["GUI logger<br/>[utils.py]"]
end

subgraph group_updates["Development updates"]
end

node_user(("User"))
node_youtube["YouTube"]
node_ffmpeg["FFmpeg"]
node_github["GitHub repository"]

node_user -->|"launches"| node_app
node_app -->|"starts"| node_gui
node_user -->|"enters options"| node_gui
node_gui -->|"reads and writes"| node_settings
node_gui -->|"requests preview"| node_preview
node_preview -->|"fetches metadata"| node_ytdlp
node_ytdlp -->|"requests video data"| node_youtube
node_gui -->|"starts or cancels"| node_manager
node_manager -->|"downloads first"| node_ytdlp
node_manager -.->|"falls back"| node_pytubefix
node_pytubefix -->|"requests video data"| node_youtube
node_manager -->|"locates FFmpeg"| node_ffmpeg_manager
node_ffmpeg_manager -->|"downloads when needed"| node_ffmpeg
node_manager -->|"converts and embeds metadata"| node_ffmpeg
node_manager -->|"writes media"| node_download_files
node_gui -->|"logs progress"| node_logger
node_manager -->|"logs download status"| node_logger
node_app -.->|"checks and pulls updates"| node_github

click node_app "https://github.com/cyprien63/youtube-download/blob/main/main.py"
click node_gui "https://github.com/cyprien63/youtube-download/blob/main/src/gui.py"
click node_settings "https://github.com/cyprien63/youtube-download/blob/main/src/gui.py"
click node_preview "https://github.com/cyprien63/youtube-download/blob/main/src/gui.py"
click node_manager "https://github.com/cyprien63/youtube-download/blob/main/src/downloader.py"
click node_ffmpeg_manager "https://github.com/cyprien63/youtube-download/blob/main/src/ffmpeg_manager.py"
click node_logger "https://github.com/cyprien63/youtube-download/blob/main/src/utils.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_gui,node_settings,node_preview,node_user toneBlue
class node_manager,node_ytdlp,node_pytubefix,node_download_files toneAmber
class node_ffmpeg_manager,node_logger toneMint
class node_youtube,node_ffmpeg,node_github toneIndigo
```

## Components

### Desktop interface

- [Application entry](https://github.com/cyprien63/youtube-download/blob/main/main.py): `main.py`
- [Downloader GUI](https://github.com/cyprien63/youtube-download/blob/main/src/gui.py): `src/gui.py`
- [User settings](https://github.com/cyprien63/youtube-download/blob/main/src/gui.py): `src/gui.py`
- [Video preview](https://github.com/cyprien63/youtube-download/blob/main/src/gui.py): `src/gui.py`

### Download workflow

- [Download manager](https://github.com/cyprien63/youtube-download/blob/main/src/downloader.py): `src/downloader.py`
- **yt-dlp**
- **pytubefix fallback**
- **Downloaded media**

### Runtime support

- [FFmpeg manager](https://github.com/cyprien63/youtube-download/blob/main/src/ffmpeg_manager.py): `src/ffmpeg_manager.py`
- [GUI logger](https://github.com/cyprien63/youtube-download/blob/main/src/utils.py): `src/utils.py`

### Other components

- **User**
- **YouTube**
- **FFmpeg**
- **GitHub repository**

## Connections

- User → Application entry: launches
- Application entry → Downloader GUI: starts
- User → Downloader GUI: enters options
- Downloader GUI → User settings: reads and writes
- Downloader GUI → Video preview: requests preview
- Video preview → yt-dlp: fetches metadata
- yt-dlp → YouTube: requests video data
- Downloader GUI → Download manager: starts or cancels
- Download manager → yt-dlp: downloads first
- Download manager → pytubefix fallback: falls back
- pytubefix fallback → YouTube: requests video data
- Download manager → FFmpeg manager: locates FFmpeg
- FFmpeg manager → FFmpeg: downloads when needed
- Download manager → FFmpeg: converts and embeds metadata
- Download manager → Downloaded media: writes media
- Downloader GUI → GUI logger: logs progress
- Download manager → GUI logger: logs download status
- Application entry → GitHub repository: checks and pulls updates
