# shivam3828y/yt_playlist_downloader architecture

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

- Interactive diagram: https://gitdiagram.com/shivam3828y/yt_playlist_downloader
- Repository: https://github.com/shivam3828y/yt_playlist_downloader

## Overview

This is a desktop YouTube video and playlist downloader with MP4 and MP3 output, plus a small command-line playlist entry point. The main workflow is: a user enters a link and selects mode and format; the UI dispatches work to a single-item or playlist downloader; yt-dlp fetches media, FFmpeg handles merging or audio extraction, and shared utilities stage and move finished files to the configured download folder. The excerpts show these runtime paths directly. The standalone converter is present, but no caller is shown; its integration is therefore not inferred.

Main entry points: [`core/single_downloader.py`](https://github.com/shivam3828y/yt_playlist_downloader/blob/main/core/single_downloader.py) (Single downloader), [`ui_app.py`](https://github.com/shivam3828y/yt_playlist_downloader/blob/main/ui_app.py) (Desktop UI), [`core/bulk_downloader.py`](https://github.com/shivam3828y/yt_playlist_downloader/blob/main/core/bulk_downloader.py) (Playlist downloader), [`core/utils.py`](https://github.com/shivam3828y/yt_playlist_downloader/blob/main/core/utils.py) (Session and file utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_ui["Desktop UI<br/>[ui_app.py]"]
  node_cli["CLI entry<br/>[main.py]"]
end

subgraph group_download["Download workflows"]
  node_single["Single downloader"]
  node_bulk["Playlist downloader<br/>[bulk_downloader.py]"]
  node_ytdlp["yt-dlp"]
end

subgraph group_support["Configuration and utilities"]
  node_config["Download settings<br/>[config.py]"]
  node_utils["Session and file utilities<br/>[utils.py]"]
end

subgraph group_media["Media processing"]
  node_ffmpeg["FFmpeg"]
  node_converter["Video-to-MP3 converter<br/>[converter.py]"]
end

node_user(("User"))
node_youtube(("YouTube"))
node_outputs[("Download folder")]

node_user -->|"enters link"| node_ui
node_ui -->|"reads settings"| node_config
node_ui -->|"dispatches single"| node_single
node_ui -->|"dispatches playlist"| node_bulk
node_cli -->|"reads settings"| node_config
node_cli -->|"sets up logging"| node_utils
node_cli -->|"calls playlist flow"| node_single
node_single -->|"stages and finalizes"| node_utils
node_bulk -->|"stages and finalizes"| node_utils
node_single -->|"downloads media"| node_ytdlp
node_bulk -->|"downloads playlist"| node_ytdlp
node_ytdlp -.->|"fetches media"| node_youtube
node_single -->|"configures processing"| node_ffmpeg
node_bulk -->|"converts leftovers"| node_ffmpeg
node_utils -->|"moves finished files"| node_outputs

click node_ui "https://github.com/shivam3828y/yt_playlist_downloader/blob/main/ui_app.py"
click node_cli "https://github.com/shivam3828y/yt_playlist_downloader/blob/main/main.py"
click node_config "https://github.com/shivam3828y/yt_playlist_downloader/blob/main/config.py"
click node_utils "https://github.com/shivam3828y/yt_playlist_downloader/blob/main/core/utils.py"
click node_single "https://github.com/shivam3828y/yt_playlist_downloader/blob/main/core/single_downloader.py"
click node_bulk "https://github.com/shivam3828y/yt_playlist_downloader/blob/main/core/bulk_downloader.py"
click node_converter "https://github.com/shivam3828y/yt_playlist_downloader/blob/main/src/converter.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_ui,node_cli,node_user toneBlue
class node_single,node_bulk,node_ytdlp,node_outputs toneAmber
class node_config,node_utils toneMint
class node_ffmpeg,node_converter toneRose
class node_youtube toneIndigo
```

## Components

### User interface

- [Desktop UI](https://github.com/shivam3828y/yt_playlist_downloader/blob/main/ui_app.py): `ui_app.py`
- [CLI entry](https://github.com/shivam3828y/yt_playlist_downloader/blob/main/main.py): `main.py`

### Download workflows

- [Single downloader](https://github.com/shivam3828y/yt_playlist_downloader/blob/main/core/single_downloader.py): `core/single_downloader.py`
- [Playlist downloader](https://github.com/shivam3828y/yt_playlist_downloader/blob/main/core/bulk_downloader.py): `core/bulk_downloader.py`
- **yt-dlp**

### Configuration and utilities

- [Download settings](https://github.com/shivam3828y/yt_playlist_downloader/blob/main/config.py): `config.py`
- [Session and file utilities](https://github.com/shivam3828y/yt_playlist_downloader/blob/main/core/utils.py): `core/utils.py`

### Media processing

- **FFmpeg**
- [Video-to-MP3 converter](https://github.com/shivam3828y/yt_playlist_downloader/blob/main/src/converter.py): `src/converter.py`

### Other components

- **User**
- **YouTube**
- **Download folder**

## Connections

- User → Desktop UI: enters link (evidence: `README.md`)
- Desktop UI → Download settings: reads settings (evidence: `ui_app.py`)
- Desktop UI → Single downloader: dispatches single (evidence: `ui_app.py`)
- Desktop UI → Playlist downloader: dispatches playlist (evidence: `ui_app.py`)
- CLI entry → Download settings: reads settings (evidence: `main.py`)
- CLI entry → Session and file utilities: sets up logging (evidence: `main.py`)
- CLI entry → Single downloader: calls playlist flow (evidence: `main.py`)
- Single downloader → Session and file utilities: stages and finalizes (evidence: `core/single_downloader.py`)
- Playlist downloader → Session and file utilities: stages and finalizes (evidence: `core/bulk_downloader.py`)
- Single downloader → yt-dlp: downloads media (evidence: `core/single_downloader.py`)
- Playlist downloader → yt-dlp: downloads playlist (evidence: `core/bulk_downloader.py`)
- yt-dlp → YouTube: fetches media
- Single downloader → FFmpeg: configures processing (evidence: `core/single_downloader.py`)
- Playlist downloader → FFmpeg: converts leftovers (evidence: `core/bulk_downloader.py`)
- Session and file utilities → Download folder: moves finished files (evidence: `core/utils.py`)
