# albertsolomon/tubepy architecture

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

- Interactive diagram: https://gitdiagram.com/albertsolomon/tubepy
- Repository: https://github.com/albertsolomon/tubepy

## Overview

Tubepy is a desktop YouTube downloader. The main workflow takes a URL in the GUI, verifies it and loads video or playlist details and available streams, then downloads the selected media to the configured location. The README also documents quick highest-resolution downloads and audio/video choices. The sampled files show these capabilities, configuration, and UI support; some wiring is in omitted portions of the GUI, so uncertain links are left out or marked unverified.

Main entry points: [`tubepy/setup.py`](https://github.com/albertsolomon/tubepy/blob/main/tubepy/setup.py) (Downloader GUI), [`tubepy/app.py`](https://github.com/albertsolomon/tubepy/blob/main/tubepy/app.py) (Download modes), [`tubepy/lang.py`](https://github.com/albertsolomon/tubepy/blob/main/tubepy/lang.py) (URL verification), [`tubepy/settings.py`](https://github.com/albertsolomon/tubepy/blob/main/tubepy/settings.py) (Location settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_gui["Downloader GUI<br/>[setup.py]"]
end

subgraph group_youtube["YouTube workflows"]
  node_url_checks["URL verification<br/>[lang.py]"]
  node_media_details["Media details<br/>[lang.py]"]
  node_stream_options["Stream discovery<br/>[lang.py]"]
  node_download_modes["Download modes<br/>[app.py]"]
end

subgraph group_support["App support"]
  node_location_settings["Location settings<br/>[settings.py]"]
  node_config_helpers["Config and helpers<br/>[lang.py]"]
  node_app_text["App text and colors<br/>[lang.py]"]
  node_version["Version<br/>[version.py]"]
end

node_user(("User"))
node_youtube_service{{"YouTube"}}
node_download_folder[("Download folder")]

node_user -->|"enters URL"| node_gui
node_gui -->|"verifies URL"| node_url_checks
node_gui -->|"loads details"| node_media_details
node_gui -->|"loads streams"| node_stream_options
node_gui -->|"starts download"| node_download_modes
node_url_checks -->|"checks availability"| node_youtube_service
node_media_details -->|"reads metadata"| node_youtube_service
node_stream_options -->|"lists streams"| node_youtube_service
node_download_modes -->|"fetches media"| node_youtube_service
node_download_modes -->|"saves media"| node_download_folder
node_download_modes -->|"reads location"| node_config_helpers
node_gui -.->|"changes location"| node_location_settings
node_location_settings -->|"reads and writes config"| node_config_helpers
node_gui -->|"uses UI text"| node_app_text
node_app_text -->|"displays version"| node_version

click node_gui "https://github.com/albertsolomon/tubepy/blob/main/tubepy/setup.py"
click node_url_checks "https://github.com/albertsolomon/tubepy/blob/main/tubepy/lang.py"
click node_media_details "https://github.com/albertsolomon/tubepy/blob/main/tubepy/lang.py"
click node_stream_options "https://github.com/albertsolomon/tubepy/blob/main/tubepy/lang.py"
click node_download_modes "https://github.com/albertsolomon/tubepy/blob/main/tubepy/app.py"
click node_location_settings "https://github.com/albertsolomon/tubepy/blob/main/tubepy/settings.py"
click node_config_helpers "https://github.com/albertsolomon/tubepy/blob/main/tubepy/lang.py"
click node_app_text "https://github.com/albertsolomon/tubepy/blob/main/tubepy/lang.py"
click node_version "https://github.com/albertsolomon/tubepy/blob/main/tubepy/version.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_url_checks,node_media_details,node_stream_options,node_download_modes,node_download_folder toneAmber
class node_location_settings,node_config_helpers,node_app_text,node_version toneMint
class node_youtube_service toneIndigo
```

## Components

### Desktop interface

- [Downloader GUI](https://github.com/albertsolomon/tubepy/blob/main/tubepy/setup.py): `tubepy/setup.py`

### YouTube workflows

- [URL verification](https://github.com/albertsolomon/tubepy/blob/main/tubepy/lang.py): `tubepy/lang.py`
- [Media details](https://github.com/albertsolomon/tubepy/blob/main/tubepy/lang.py): `tubepy/lang.py`
- [Stream discovery](https://github.com/albertsolomon/tubepy/blob/main/tubepy/lang.py): `tubepy/lang.py`
- [Download modes](https://github.com/albertsolomon/tubepy/blob/main/tubepy/app.py): `tubepy/app.py`

### App support

- [Location settings](https://github.com/albertsolomon/tubepy/blob/main/tubepy/settings.py): `tubepy/settings.py`
- [Config and helpers](https://github.com/albertsolomon/tubepy/blob/main/tubepy/lang.py): `tubepy/lang.py`
- [App text and colors](https://github.com/albertsolomon/tubepy/blob/main/tubepy/lang.py): `tubepy/lang.py`
- [Version](https://github.com/albertsolomon/tubepy/blob/main/tubepy/version.py): `tubepy/version.py`

### Other components

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

## Connections

- User → Downloader GUI: enters URL (evidence: `README.md`)
- Downloader GUI → URL verification: verifies URL (evidence: `tubepy/setup.py`)
- Downloader GUI → Media details: loads details (evidence: `tubepy/setup.py`)
- Downloader GUI → Stream discovery: loads streams (evidence: `tubepy/setup.py`)
- Downloader GUI → Download modes: starts download (evidence: `tubepy/setup.py`)
- URL verification → YouTube: checks availability (evidence: `tubepy/lang.py`)
- Media details → YouTube: reads metadata (evidence: `tubepy/lang.py`)
- Stream discovery → YouTube: lists streams (evidence: `tubepy/lang.py`)
- Download modes → YouTube: fetches media (evidence: `tubepy/app.py`)
- Download modes → Download folder: saves media (evidence: `tubepy/app.py`)
- Download modes → Config and helpers: reads location (evidence: `tubepy/app.py`)
- Downloader GUI → Location settings: changes location (evidence: `tubepy/setup.py`)
- Location settings → Config and helpers: reads and writes config (evidence: `tubepy/settings.py`)
- Downloader GUI → App text and colors: uses UI text (evidence: `tubepy/setup.py`)
- App text and colors → Version: displays version (evidence: `tubepy/lang.py`)
