# andres2008-03/descargar_yt architecture

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

- Interactive diagram: https://gitdiagram.com/andres2008-03/descargar_yt
- Repository: https://github.com/andres2008-03/descargar_yt

## Overview

This is a small Tkinter YouTube video/audio downloader. A user enters a URL and chooses a quality; the UI callback starts a background download, which selects a format and invokes yt-dlp. Download progress and completion/errors travel through a queue for the main thread to display. The excerpts support this workflow and the quality options, but do not show where files are ultimately saved beyond yt-dlp’s output template.

Main entry points: [`main.py`](https://github.com/andres2008-03/descargar_yt/blob/main/main.py) (App controller), [`GUI.py`](https://github.com/andres2008-03/descargar_yt/blob/main/GUI.py) (Download UI), [`descargas.py`](https://github.com/andres2008-03/descargar_yt/blob/main/descargas.py) (Download worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_gui["Download UI<br/>[GUI.py]"]
end

subgraph group_control["Download control"]
  node_controller["App controller<br/>[main.py]"]
  node_progress_queue["Progress queue<br/>[main.py]"]
end

subgraph group_download["Download processing"]
  node_format_selector["Format selector<br/>[descargas.py]"]
  node_download_worker["Download worker<br/>[descargas.py]"]
end

node_user(("User"))
node_yt_dlp["yt-dlp"]

node_user -->|"enters URL"| node_gui
node_user -->|"chooses quality"| node_gui
node_gui -->|"invokes callback"| node_controller
node_controller -->|"creates window"| node_gui
node_controller -->|"starts thread"| node_download_worker
node_download_worker -->|"selects format"| node_format_selector
node_download_worker -->|"downloads URL"| node_yt_dlp
node_download_worker -->|"writes progress"| node_progress_queue
node_controller -->|"reads updates"| node_progress_queue
node_controller -->|"updates status"| node_gui

click node_gui "https://github.com/andres2008-03/descargar_yt/blob/main/GUI.py"
click node_controller "https://github.com/andres2008-03/descargar_yt/blob/main/main.py"
click node_progress_queue "https://github.com/andres2008-03/descargar_yt/blob/main/main.py"
click node_format_selector "https://github.com/andres2008-03/descargar_yt/blob/main/descargas.py"
click node_download_worker "https://github.com/andres2008-03/descargar_yt/blob/main/descargas.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_user toneBlue
class node_controller,node_progress_queue toneAmber
class node_format_selector,node_download_worker toneMint
class node_yt_dlp toneIndigo
```

## Components

### User interface

- [Download UI](https://github.com/andres2008-03/descargar_yt/blob/main/GUI.py): `GUI.py`

### Download control

- [App controller](https://github.com/andres2008-03/descargar_yt/blob/main/main.py): `main.py`
- [Progress queue](https://github.com/andres2008-03/descargar_yt/blob/main/main.py): `main.py`

### Download processing

- [Format selector](https://github.com/andres2008-03/descargar_yt/blob/main/descargas.py): `descargas.py`
- [Download worker](https://github.com/andres2008-03/descargar_yt/blob/main/descargas.py): `descargas.py`

### Other components

- **User**
- **yt-dlp**

## Connections

- User → Download UI: enters URL (evidence: `GUI.py`)
- User → Download UI: chooses quality (evidence: `GUI.py`)
- Download UI → App controller: invokes callback (evidence: `GUI.py`)
- App controller → Download UI: creates window (evidence: `main.py`)
- App controller → Download worker: starts thread (evidence: `main.py`)
- Download worker → Format selector: selects format (evidence: `descargas.py`)
- Download worker → yt-dlp: downloads URL (evidence: `descargas.py`)
- Download worker → Progress queue: writes progress (evidence: `descargas.py`)
- App controller → Progress queue: reads updates (evidence: `main.py`)
- App controller → Download UI: updates status (evidence: `main.py`)
