# tott12/umfdownloader architecture

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

- Interactive diagram: https://gitdiagram.com/tott12/umfdownloader
- Repository: https://github.com/tott12/umfdownloader

## Overview

UMFdownloaded offers two ways to download a single video: a tkinter desktop app and a Chrome extension. In the desktop workflow, the user accepts the license, enters a video URL and destination, optionally sets a speed limit, then the app invokes yt-dlp and saves the file. In the extension workflow, a page video enables a floating button; clicking it sends the URL through the background worker to a native host, which runs yt-dlp into Downloads. The extension path is documented and partly sampled; its manifest and the app’s omitted workflow details limit verification of some connections.

Main entry points: [`app.py`](https://github.com/tott12/umfdownloader/blob/main/app.py) (Desktop Download), [`native_host.py`](https://github.com/tott12/umfdownloader/blob/main/native_host.py) (Native Download), [`extension/content.js`](https://github.com/tott12/umfdownloader/blob/main/extension/content.js) (Floating Button), [`extension/background.js`](https://github.com/tott12/umfdownloader/blob/main/extension/background.js) (Message Forwarder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop Downloader"]
  node_license["License Gate<br/>[app.py]"]
  node_desktop_ui["Desktop UI<br/>[app.py]"]
  node_desktop_download["Desktop Download<br/>[app.py]"]
end

subgraph group_browser["Browser Extension"]
  node_video_detect["Video Detection<br/>[content.js]"]
  node_floating_button["Floating Button<br/>[content.js]"]
  node_message_forwarder["Message Forwarder<br/>[background.js]"]
end

subgraph group_native["Native Download Host"]
  node_native_host["Native Host<br/>[native_host.py]"]
  node_native_protocol["Message Protocol<br/>[native_host.py]"]
  node_native_download["Native Download<br/>[native_host.py]"]
end

node_user(("User"))
node_video_page["Video Page"]
node_yt_dlp["yt-dlp"]
node_destination[("Download Folder")]

node_user -->|"starts app"| node_license
node_license -->|"permits use"| node_desktop_ui
node_user -->|"enters settings"| node_desktop_ui
node_desktop_ui -->|"starts workflow"| node_desktop_download
node_desktop_download -->|"runs command"| node_yt_dlp
node_desktop_download -->|"writes file"| node_destination
node_video_page -->|"provides media"| node_video_detect
node_video_detect -->|"reveals button"| node_floating_button
node_user -->|"clicks download"| node_floating_button
node_floating_button -->|"sends URL"| node_message_forwarder
node_message_forwarder -->|"sends native message"| node_native_host
node_native_host -->|"reads request"| node_native_protocol
node_native_protocol -->|"dispatches URL"| node_native_download
node_native_download -->|"runs command"| node_yt_dlp
node_native_download -->|"writes file"| node_destination

click node_license "https://github.com/tott12/umfdownloader/blob/main/app.py"
click node_desktop_ui "https://github.com/tott12/umfdownloader/blob/main/app.py"
click node_desktop_download "https://github.com/tott12/umfdownloader/blob/main/app.py"
click node_video_detect "https://github.com/tott12/umfdownloader/blob/main/extension/content.js"
click node_floating_button "https://github.com/tott12/umfdownloader/blob/main/extension/content.js"
click node_message_forwarder "https://github.com/tott12/umfdownloader/blob/main/extension/background.js"
click node_native_host "https://github.com/tott12/umfdownloader/blob/main/native_host.py"
click node_native_protocol "https://github.com/tott12/umfdownloader/blob/main/native_host.py"
click node_native_download "https://github.com/tott12/umfdownloader/blob/main/native_host.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_license,node_desktop_ui,node_desktop_download,node_user toneBlue
class node_video_detect,node_floating_button,node_message_forwarder,node_destination toneAmber
class node_native_host,node_native_protocol,node_native_download toneMint
class node_video_page,node_yt_dlp toneIndigo
```

## Components

### Desktop Downloader

- [License Gate](https://github.com/tott12/umfdownloader/blob/main/app.py): `app.py`
- [Desktop UI](https://github.com/tott12/umfdownloader/blob/main/app.py): `app.py`
- [Desktop Download](https://github.com/tott12/umfdownloader/blob/main/app.py): `app.py`

### Browser Extension

- [Video Detection](https://github.com/tott12/umfdownloader/blob/main/extension/content.js): `extension/content.js`
- [Floating Button](https://github.com/tott12/umfdownloader/blob/main/extension/content.js): `extension/content.js`
- [Message Forwarder](https://github.com/tott12/umfdownloader/blob/main/extension/background.js): `extension/background.js`

### Native Download Host

- [Native Host](https://github.com/tott12/umfdownloader/blob/main/native_host.py): `native_host.py`
- [Message Protocol](https://github.com/tott12/umfdownloader/blob/main/native_host.py): `native_host.py`
- [Native Download](https://github.com/tott12/umfdownloader/blob/main/native_host.py): `native_host.py`

### Other components

- **User**
- **Video Page**
- **yt-dlp**
- **Download Folder**

## Connections

- User → License Gate: starts app (evidence: `app.py`)
- License Gate → Desktop UI: permits use (evidence: `app.py`)
- User → Desktop UI: enters settings (evidence: `README.md`)
- Desktop UI → Desktop Download: starts workflow (evidence: `app.py`)
- Desktop Download → yt-dlp: runs command (evidence: `app.py`)
- Desktop Download → Download Folder: writes file (evidence: `app.py`)
- Video Page → Video Detection: provides media (evidence: `extension/content.js`)
- Video Detection → Floating Button: reveals button (evidence: `extension/content.js`)
- User → Floating Button: clicks download (evidence: `README.md`)
- Floating Button → Message Forwarder: sends URL (evidence: `extension/content.js`)
- Message Forwarder → Native Host: sends native message (evidence: `extension/background.js`)
- Native Host → Message Protocol: reads request (evidence: `native_host.py`)
- Message Protocol → Native Download: dispatches URL (evidence: `native_host.py`)
- Native Download → yt-dlp: runs command (evidence: `native_host.py`)
- Native Download → Download Folder: writes file (evidence: `native_host.py`)
