# ncavallini/raiplaydownloader architecture

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

- Interactive diagram: https://gitdiagram.com/ncavallini/raiplaydownloader
- Repository: https://github.com/ncavallini/raiplaydownloader

## Overview

RaiPlay Downloader is a desktop and command-line app for saving individual videos or season batches. Users provide a RaiPlay link and destination; the app fetches metadata, prepares downloads, and reports progress and failures. Season downloads support skipping episodes, parallel work, and retries; ffmpeg enables higher-quality separate video/audio streams. The excerpts show the GUI’s metadata and download path and parts of the CLI implementation; some batch orchestration details are omitted, so those links are marked unverified.

Main entry points: [`gui.py`](https://github.com/ncavallini/raiplaydownloader/blob/main/gui.py) (Graphical app), [`main.py`](https://github.com/ncavallini/raiplaydownloader/blob/main/main.py) (Download engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_gui["Graphical app<br/>[gui.py]"]
  node_cli["Command-line app<br/>[main.py]"]
end

subgraph group_workflow["Download workflow"]
  node_input["Link and options<br/>[gui.py]"]
  node_metadata["Video metadata<br/>[main.py]"]
  node_season["Season episodes<br/>[main.py]"]
  node_single["Single download<br/>[main.py]"]
  node_batch["Batch coordinator<br/>[main.py]"]
  node_download["Download engine<br/>[main.py]"]
  node_quality["Format selection<br/>[main.py]"]
end

subgraph group_support["Progress and output"]
  node_progress["Progress display<br/>[gui.py]"]
  node_logs["Status and logs<br/>[gui.py]"]
  node_files["Saved media"]
end

subgraph group_services["External services"]
  node_raiplay["RaiPlay"]
  node_ytdlp["yt-dlp"]
  node_ffmpeg["ffmpeg"]
end

node_user(("User"))

node_user -->|"uses"| node_gui
node_user -->|"uses"| node_cli
node_gui -->|"collects"| node_input
node_cli -->|"prompts for"| node_input
node_gui -->|"fetches"| node_metadata
node_metadata -->|"requests metadata"| node_raiplay
node_cli -->|"dispatches"| node_single
node_gui -->|"prepares"| node_single
node_cli -.->|"dispatches"| node_batch
node_gui -.->|"prepares"| node_season
node_batch -.->|"uses episode list"| node_season
node_single -->|"starts"| node_download
node_batch -->|"runs episodes"| node_download
node_download -->|"uses options"| node_quality
node_quality -->|"checks availability"| node_ffmpeg
node_download -->|"downloads with"| node_ytdlp
node_ytdlp -->|"retrieves media"| node_raiplay
node_download -->|"writes media"| node_files
node_download -->|"reports progress"| node_progress
node_gui -->|"redirects output"| node_logs
node_batch -->|"reports results"| node_logs

click node_gui "https://github.com/ncavallini/raiplaydownloader/blob/main/gui.py"
click node_cli "https://github.com/ncavallini/raiplaydownloader/blob/main/main.py"
click node_input "https://github.com/ncavallini/raiplaydownloader/blob/main/gui.py"
click node_metadata "https://github.com/ncavallini/raiplaydownloader/blob/main/main.py"
click node_season "https://github.com/ncavallini/raiplaydownloader/blob/main/main.py"
click node_single "https://github.com/ncavallini/raiplaydownloader/blob/main/main.py"
click node_batch "https://github.com/ncavallini/raiplaydownloader/blob/main/main.py"
click node_download "https://github.com/ncavallini/raiplaydownloader/blob/main/main.py"
click node_quality "https://github.com/ncavallini/raiplaydownloader/blob/main/main.py"
click node_progress "https://github.com/ncavallini/raiplaydownloader/blob/main/gui.py"
click node_logs "https://github.com/ncavallini/raiplaydownloader/blob/main/gui.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_gui,node_cli,node_user toneBlue
class node_input,node_metadata,node_season,node_single,node_batch,node_download,node_quality toneAmber
class node_progress,node_logs,node_files toneMint
class node_raiplay,node_ytdlp,node_ffmpeg toneRose
```

## Components

### User entry points

- [Graphical app](https://github.com/ncavallini/raiplaydownloader/blob/main/gui.py): `gui.py`
- [Command-line app](https://github.com/ncavallini/raiplaydownloader/blob/main/main.py): `main.py`

### Download workflow

- [Link and options](https://github.com/ncavallini/raiplaydownloader/blob/main/gui.py): `gui.py`
- [Video metadata](https://github.com/ncavallini/raiplaydownloader/blob/main/main.py): `main.py`
- [Season episodes](https://github.com/ncavallini/raiplaydownloader/blob/main/main.py): `main.py`
- [Single download](https://github.com/ncavallini/raiplaydownloader/blob/main/main.py): `main.py`
- [Batch coordinator](https://github.com/ncavallini/raiplaydownloader/blob/main/main.py): `main.py`
- [Download engine](https://github.com/ncavallini/raiplaydownloader/blob/main/main.py): `main.py`
- [Format selection](https://github.com/ncavallini/raiplaydownloader/blob/main/main.py): `main.py`

### Progress and output

- [Progress display](https://github.com/ncavallini/raiplaydownloader/blob/main/gui.py): `gui.py`
- [Status and logs](https://github.com/ncavallini/raiplaydownloader/blob/main/gui.py): `gui.py`
- **Saved media**

### External services

- **RaiPlay**
- **yt-dlp**
- **ffmpeg**

### Other components

- **User**

## Connections

- User → Graphical app: uses (evidence: `README.md`)
- User → Command-line app: uses (evidence: `README.md`)
- Graphical app → Link and options: collects (evidence: `gui.py`)
- Command-line app → Link and options: prompts for (evidence: `main.py`)
- Graphical app → Video metadata: fetches (evidence: `gui.py`)
- Video metadata → RaiPlay: requests metadata (evidence: `main.py`)
- Command-line app → Single download: dispatches (evidence: `main.py`)
- Graphical app → Single download: prepares (evidence: `gui.py`)
- Command-line app → Batch coordinator: dispatches (evidence: `main.py`)
- Graphical app → Season episodes: prepares (evidence: `gui.py`)
- Batch coordinator → Season episodes: uses episode list (evidence: `main.py`)
- Single download → Download engine: starts (evidence: `main.py`)
- Batch coordinator → Download engine: runs episodes (evidence: `main.py`)
- Download engine → Format selection: uses options (evidence: `main.py`)
- Format selection → ffmpeg: checks availability (evidence: `main.py`)
- Download engine → yt-dlp: downloads with (evidence: `main.py`)
- yt-dlp → RaiPlay: retrieves media (evidence: `README.md`)
- Download engine → Saved media: writes media (evidence: `main.py`)
- Download engine → Progress display: reports progress (evidence: `gui.py`)
- Graphical app → Status and logs: redirects output (evidence: `gui.py`)
- Batch coordinator → Status and logs: reports results (evidence: `main.py`)
