# hh12356/anydl architecture

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

- Interactive diagram: https://gitdiagram.com/hh12356/anydl
- Repository: https://github.com/hh12356/anydl

## Overview

anydl is a Flet desktop downloader: users choose video or music, paste a link, optionally set format or trim options, then start a download. The UI selects an engine and builds its arguments; DownloadManager launches it in a background process and relays output for progress, logs, and completion status. README capabilities include playlist folders, Spotify API settings, and site-specific cookies. The UI excerpt is partial, so uncertain internal wiring for these features is not expanded.

Main entry points: [`ui/app.py`](https://github.com/hh12356/anydl/blob/main/ui/app.py) (Downloader UI), [`core/manager.py`](https://github.com/hh12356/anydl/blob/main/core/manager.py) (Download manager), [`main.py`](https://github.com/hh12356/anydl/blob/main/main.py) (Application entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop interface"]
  node_entry["Application entry<br/>[main.py]"]
  node_ui["Downloader UI<br/>[app.py]"]
  node_options["Download options<br/>[app.py]"]
  node_settings["Spotify settings<br/>[app.py]"]
  node_config["Spotify config<br/>[app.py]"]
end

subgraph group_orchestration["Download orchestration"]
  node_manager["Download manager<br/>[manager.py]"]
  node_messages["Output queue<br/>[manager.py]"]
end

subgraph group_engines["Download engines"]
  node_video["yt-dlp"]
  node_spotify["spotDL"]
  node_soundcloud["scdl"]
end

node_user(("User"))
node_sites(("Video sites"))
node_spotify_api(("Spotify API"))
node_firefox["Firefox cookies"]
node_ffmpeg["FFmpeg"]
node_downloads["Download files"]

node_user -->|"launches"| node_entry
node_entry -->|"runs"| node_ui
node_user -->|"uses"| node_ui
node_ui -->|"collects"| node_options
node_ui -->|"opens"| node_settings
node_settings -->|"reads/writes"| node_config
node_ui -->|"starts process"| node_manager
node_manager -->|"launches"| node_video
node_manager -->|"launches"| node_spotify
node_manager -->|"launches"| node_soundcloud
node_manager -->|"enqueues output"| node_messages
node_ui -->|"reads output"| node_messages
node_video -->|"downloads from"| node_sites
node_spotify -.->|"uses API"| node_spotify_api
node_spotify -->|"writes audio"| node_downloads
node_soundcloud -->|"writes audio"| node_downloads
node_video -->|"writes media"| node_downloads
node_video -.->|"reads cookies"| node_firefox
node_video -.->|"uses for media"| node_ffmpeg

click node_entry "https://github.com/hh12356/anydl/blob/main/main.py"
click node_ui "https://github.com/hh12356/anydl/blob/main/ui/app.py"
click node_options "https://github.com/hh12356/anydl/blob/main/ui/app.py"
click node_settings "https://github.com/hh12356/anydl/blob/main/ui/app.py"
click node_config "https://github.com/hh12356/anydl/blob/main/ui/app.py"
click node_manager "https://github.com/hh12356/anydl/blob/main/core/manager.py"
click node_messages "https://github.com/hh12356/anydl/blob/main/core/manager.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_entry,node_ui,node_options,node_settings,node_config,node_user toneBlue
class node_manager,node_messages toneAmber
class node_video,node_spotify,node_soundcloud,node_spotify_api toneMint
class node_sites,node_firefox,node_ffmpeg,node_downloads toneIndigo
```

## Components

### Desktop interface

- [Application entry](https://github.com/hh12356/anydl/blob/main/main.py): `main.py`
- [Downloader UI](https://github.com/hh12356/anydl/blob/main/ui/app.py): `ui/app.py`
- [Download options](https://github.com/hh12356/anydl/blob/main/ui/app.py): `ui/app.py`
- [Spotify settings](https://github.com/hh12356/anydl/blob/main/ui/app.py): `ui/app.py`
- [Spotify config](https://github.com/hh12356/anydl/blob/main/ui/app.py): `ui/app.py`

### Download orchestration

- [Download manager](https://github.com/hh12356/anydl/blob/main/core/manager.py): `core/manager.py`
- [Output queue](https://github.com/hh12356/anydl/blob/main/core/manager.py): `core/manager.py`

### Download engines

- **yt-dlp**
- **spotDL**
- **scdl**

### Other components

- **User**
- **Video sites**
- **Spotify API**
- **Firefox cookies**
- **FFmpeg**
- **Download files**

## Connections

- User → Application entry: launches
- Application entry → Downloader UI: runs
- User → Downloader UI: uses
- Downloader UI → Download options: collects
- Downloader UI → Spotify settings: opens
- Spotify settings → Spotify config: reads/writes
- Downloader UI → Download manager: starts process
- Download manager → yt-dlp: launches
- Download manager → spotDL: launches
- Download manager → scdl: launches
- Download manager → Output queue: enqueues output
- Downloader UI → Output queue: reads output
- yt-dlp → Video sites: downloads from
- spotDL → Spotify API: uses API
- spotDL → Download files: writes audio
- scdl → Download files: writes audio
- yt-dlp → Download files: writes media
- yt-dlp → Firefox cookies: reads cookies
- yt-dlp → FFmpeg: uses for media
