# sureshsoudararajan/glypdl architecture

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

- Interactive diagram: https://gitdiagram.com/sureshsoudararajan/glypdl
- Repository: https://github.com/sureshsoudararajan/glypdl

## Overview

Glypdl is a cross-platform yt-dlp media downloader with native Android, Linux, and Windows apps, plus a browser extension that can send detected media to a desktop app. The typical workflow is to submit a URL, inspect media or playlist metadata, choose formats and authentication, then download and manage the resulting queue and history. The graph preserves those product stages and the major platform branches. Some desktop and Android subsystems are represented by their exact directories because their implementation was not sampled; connections to them are documented only where the excerpts or README support them.

Main entry points: [`android/app/src/main/java/com/glypdl/android/service/engine/YtDlpManager.kt`](https://github.com/sureshsoudararajan/glypdl/blob/main/android/app/src/main/java/com/glypdl/android/service/engine/YtDlpManager.kt) (yt-dlp engine), [`src/glypdl/app.py`](https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/app.py) (Application orchestration), [`windows/src/Glypdl.Windows/Services/YtDlpService.cs`](https://github.com/sureshsoudararajan/glypdl/blob/main/windows/src/Glypdl.Windows/Services/YtDlpService.cs) (yt-dlp service), [`windows/src/Glypdl.Windows/App.xaml.cs`](https://github.com/sureshsoudararajan/glypdl/blob/main/windows/src/Glypdl.Windows/App.xaml.cs) (WinUI application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_android["Android app"]
  node_android_ui["Compose interface"]
  node_android_flow["Download workflow<br/>[DownloadManager.kt]"]
  node_android_engine["yt-dlp engine<br/>[YtDlpManager.kt]"]
  node_android_service["Foreground service"]
  node_android_notify["Download notifications"]
  node_android_auth["Cookie authentication"]
  node_android_settings["Settings storage"]
  node_android_media_models["Media request formats<br/>[DownloadRequest.kt]"]
end

subgraph group_linux["Linux app"]
  node_linux_ui["GTK application<br/>[window.py]"]
  node_linux_app["Application orchestration<br/>[app.py]"]
  node_linux_metadata["Media metadata<br/>[metadata.py]"]
  node_linux_download["Download service<br/>[downloader.py]"]
  node_linux_engine["yt-dlp service<br/>[ytdlp.py]"]
  node_linux_cookies["Browser cookies<br/>[cookies.py]"]
  node_linux_history[("Download history<br/>[history.py]")]
  node_linux_ipc["Extension IPC<br/>[ipc.py]"]
  node_linux_paths["App data paths<br/>[paths.py]"]
end

subgraph group_windows["Windows app"]
  node_windows_ui["WinUI application<br/>[App.xaml.cs]"]
  node_windows_views["Desktop views<br/>[Views]"]
  node_windows_workflows["Download and queue<br/>[DownloadService.cs]"]
  node_windows_metadata["Media metadata<br/>[MetadataService.cs]"]
  node_windows_engine["yt-dlp service<br/>[YtDlpService.cs]"]
  node_windows_cookies["Browser cookies<br/>[CookieService.cs]"]
  node_windows_settings["Settings service"]
end

subgraph group_extension["Browser extension"]
  node_extension_detect["Media detection"]
  node_extension_content["Page integration"]
  node_extension_background["Background commands"]
  node_extension_connection["Desktop connection"]
end

subgraph group_shared["Media and preferences"]
  node_media_sites(("Media sites"))
  node_yt_dlp["yt-dlp"]
  node_media_result["Downloaded media"]
end

node_user(("User"))

node_user -->|"submits URL"| node_android_ui
node_android_ui -.->|"requests download"| node_android_flow
node_android_flow -->|"runs download"| node_android_engine
node_android_flow -->|"starts service"| node_android_service
node_android_service -->|"updates notices"| node_android_notify
node_android_engine -->|"gets cookies"| node_android_auth
node_android_engine -->|"reads settings"| node_android_settings
node_android_engine -->|"uses request formats"| node_android_media_models
node_android_engine -->|"extracts media"| node_yt_dlp
node_android_engine -->|"produces files"| node_media_result
node_user -->|"submits URL"| node_linux_ui
node_linux_ui -.->|"handled by app"| node_linux_app
node_linux_app -->|"sets up service"| node_linux_metadata
node_linux_app -->|"sets up service"| node_linux_download
node_linux_app -->|"sets up service"| node_linux_history
node_linux_app -->|"sets up service"| node_linux_cookies
node_linux_app -->|"starts IPC"| node_linux_ipc
node_linux_download -.->|"uses engine"| node_linux_engine
node_linux_engine -->|"extracts media"| node_yt_dlp
node_linux_engine -->|"produces files"| node_media_result
node_linux_cookies -->|"uses app paths"| node_linux_paths
node_linux_ipc -.->|"uses socket paths"| node_linux_paths
node_user -->|"submits URL"| node_windows_views
node_windows_ui -->|"constructs service"| node_windows_metadata
node_windows_ui -->|"constructs service"| node_windows_workflows
node_windows_ui -->|"constructs service"| node_windows_settings
node_windows_metadata -->|"uses engine"| node_windows_engine
node_windows_workflows -.->|"uses engine"| node_windows_engine
node_windows_engine -->|"reads settings"| node_windows_settings
node_windows_engine -->|"extracts media"| node_yt_dlp
node_windows_engine -->|"produces files"| node_media_result
node_windows_ui -->|"constructs service"| node_windows_cookies
node_windows_cookies -->|"uses engine interface"| node_windows_engine
node_user -.->|"visits page"| node_extension_content
node_extension_content -.->|"detects media"| node_extension_detect
node_extension_detect -.->|"sends detections"| node_extension_background
node_extension_background -->|"sends download"| node_extension_connection
node_media_sites -.->|"provides media"| node_extension_detect
node_extension_connection -.->|"sends native message"| node_linux_ipc

click node_android_ui "https://github.com/sureshsoudararajan/glypdl/tree/main/android/app/src/main/java/com/glypdl/android/ui"
click node_android_flow "https://github.com/sureshsoudararajan/glypdl/blob/main/android/app/src/main/java/com/glypdl/android/service/DownloadManager.kt"
click node_android_engine "https://github.com/sureshsoudararajan/glypdl/blob/main/android/app/src/main/java/com/glypdl/android/service/engine/YtDlpManager.kt"
click node_android_service "https://github.com/sureshsoudararajan/glypdl/blob/main/android/app/src/main/java/com/glypdl/android/service/DownloadForegroundService.kt"
click node_android_notify "https://github.com/sureshsoudararajan/glypdl/blob/main/android/app/src/main/java/com/glypdl/android/service/DownloadNotificationManager.kt"
click node_android_auth "https://github.com/sureshsoudararajan/glypdl/blob/main/android/app/src/main/java/com/glypdl/android/service/auth/AuthCookieManager.kt"
click node_android_settings "https://github.com/sureshsoudararajan/glypdl/blob/main/android/app/src/main/java/com/glypdl/android/data/repository/SettingsRepository.kt"
click node_android_media_models "https://github.com/sureshsoudararajan/glypdl/blob/main/android/app/src/main/java/com/glypdl/android/data/model/DownloadRequest.kt"
click node_linux_ui "https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/window.py"
click node_linux_app "https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/app.py"
click node_linux_metadata "https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/services/metadata.py"
click node_linux_download "https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/services/downloader.py"
click node_linux_engine "https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/services/ytdlp.py"
click node_linux_cookies "https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/services/cookies.py"
click node_linux_history "https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/services/history.py"
click node_linux_ipc "https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/services/ipc.py"
click node_linux_paths "https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/utils/paths.py"
click node_windows_ui "https://github.com/sureshsoudararajan/glypdl/blob/main/windows/src/Glypdl.Windows/App.xaml.cs"
click node_windows_views "https://github.com/sureshsoudararajan/glypdl/tree/main/windows/src/Glypdl.Windows/Views"
click node_windows_workflows "https://github.com/sureshsoudararajan/glypdl/blob/main/windows/src/Glypdl.Windows/Services/DownloadService.cs"
click node_windows_metadata "https://github.com/sureshsoudararajan/glypdl/blob/main/windows/src/Glypdl.Windows/Services/MetadataService.cs"
click node_windows_engine "https://github.com/sureshsoudararajan/glypdl/blob/main/windows/src/Glypdl.Windows/Services/YtDlpService.cs"
click node_windows_cookies "https://github.com/sureshsoudararajan/glypdl/blob/main/windows/src/Glypdl.Windows/Services/CookieService.cs"
click node_windows_settings "https://github.com/sureshsoudararajan/glypdl/blob/main/windows/src/Glypdl.Windows/Services/ISettingsService.cs"
click node_extension_detect "https://github.com/sureshsoudararajan/glypdl/tree/main/extension/src/detection"
click node_extension_content "https://github.com/sureshsoudararajan/glypdl/tree/main/extension/src/content"
click node_extension_background "https://github.com/sureshsoudararajan/glypdl/tree/main/extension/src/background"
click node_extension_connection "https://github.com/sureshsoudararajan/glypdl/blob/main/extension/src/background/connection/ConnectionManager.ts"

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_android_ui,node_android_flow,node_android_engine,node_android_service,node_android_notify,node_android_auth,node_android_settings,node_android_media_models,node_user toneBlue
class node_linux_ui,node_linux_app,node_linux_metadata,node_linux_download,node_linux_engine,node_linux_cookies,node_linux_history,node_linux_ipc,node_linux_paths toneAmber
class node_windows_ui,node_windows_views,node_windows_workflows,node_windows_metadata,node_windows_engine,node_windows_cookies,node_windows_settings toneMint
class node_extension_detect,node_extension_content,node_extension_background,node_extension_connection toneRose
class node_media_sites,node_yt_dlp,node_media_result toneIndigo
```

## Components

### Android app

- [Compose interface](https://github.com/sureshsoudararajan/glypdl/tree/main/android/app/src/main/java/com/glypdl/android/ui): `android/app/src/main/java/com/glypdl/android/ui`
- [Download workflow](https://github.com/sureshsoudararajan/glypdl/blob/main/android/app/src/main/java/com/glypdl/android/service/DownloadManager.kt): `android/app/src/main/java/com/glypdl/android/service/DownloadManager.kt`
- [yt-dlp engine](https://github.com/sureshsoudararajan/glypdl/blob/main/android/app/src/main/java/com/glypdl/android/service/engine/YtDlpManager.kt): `android/app/src/main/java/com/glypdl/android/service/engine/YtDlpManager.kt`
- [Foreground service](https://github.com/sureshsoudararajan/glypdl/blob/main/android/app/src/main/java/com/glypdl/android/service/DownloadForegroundService.kt): `android/app/src/main/java/com/glypdl/android/service/DownloadForegroundService.kt`
- [Download notifications](https://github.com/sureshsoudararajan/glypdl/blob/main/android/app/src/main/java/com/glypdl/android/service/DownloadNotificationManager.kt): `android/app/src/main/java/com/glypdl/android/service/DownloadNotificationManager.kt`
- [Cookie authentication](https://github.com/sureshsoudararajan/glypdl/blob/main/android/app/src/main/java/com/glypdl/android/service/auth/AuthCookieManager.kt): `android/app/src/main/java/com/glypdl/android/service/auth/AuthCookieManager.kt`
- [Settings storage](https://github.com/sureshsoudararajan/glypdl/blob/main/android/app/src/main/java/com/glypdl/android/data/repository/SettingsRepository.kt): `android/app/src/main/java/com/glypdl/android/data/repository/SettingsRepository.kt`
- [Media request formats](https://github.com/sureshsoudararajan/glypdl/blob/main/android/app/src/main/java/com/glypdl/android/data/model/DownloadRequest.kt): `android/app/src/main/java/com/glypdl/android/data/model/DownloadRequest.kt`

### Linux app

- [GTK application](https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/window.py): `src/glypdl/window.py`
- [Application orchestration](https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/app.py): `src/glypdl/app.py`
- [Media metadata](https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/services/metadata.py): `src/glypdl/services/metadata.py`
- [Download service](https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/services/downloader.py): `src/glypdl/services/downloader.py`
- [yt-dlp service](https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/services/ytdlp.py): `src/glypdl/services/ytdlp.py`
- [Browser cookies](https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/services/cookies.py): `src/glypdl/services/cookies.py`
- [Download history](https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/services/history.py): `src/glypdl/services/history.py`
- [Extension IPC](https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/services/ipc.py): `src/glypdl/services/ipc.py`
- [App data paths](https://github.com/sureshsoudararajan/glypdl/blob/main/src/glypdl/utils/paths.py): `src/glypdl/utils/paths.py`

### Windows app

- [WinUI application](https://github.com/sureshsoudararajan/glypdl/blob/main/windows/src/Glypdl.Windows/App.xaml.cs): `windows/src/Glypdl.Windows/App.xaml.cs`
- [Desktop views](https://github.com/sureshsoudararajan/glypdl/tree/main/windows/src/Glypdl.Windows/Views): `windows/src/Glypdl.Windows/Views`
- [Download and queue](https://github.com/sureshsoudararajan/glypdl/blob/main/windows/src/Glypdl.Windows/Services/DownloadService.cs): `windows/src/Glypdl.Windows/Services/DownloadService.cs`
- [Media metadata](https://github.com/sureshsoudararajan/glypdl/blob/main/windows/src/Glypdl.Windows/Services/MetadataService.cs): `windows/src/Glypdl.Windows/Services/MetadataService.cs`
- [yt-dlp service](https://github.com/sureshsoudararajan/glypdl/blob/main/windows/src/Glypdl.Windows/Services/YtDlpService.cs): `windows/src/Glypdl.Windows/Services/YtDlpService.cs`
- [Browser cookies](https://github.com/sureshsoudararajan/glypdl/blob/main/windows/src/Glypdl.Windows/Services/CookieService.cs): `windows/src/Glypdl.Windows/Services/CookieService.cs`
- [Settings service](https://github.com/sureshsoudararajan/glypdl/blob/main/windows/src/Glypdl.Windows/Services/ISettingsService.cs): `windows/src/Glypdl.Windows/Services/ISettingsService.cs`

### Browser extension

- [Media detection](https://github.com/sureshsoudararajan/glypdl/tree/main/extension/src/detection): `extension/src/detection`
- [Page integration](https://github.com/sureshsoudararajan/glypdl/tree/main/extension/src/content): `extension/src/content`
- [Background commands](https://github.com/sureshsoudararajan/glypdl/tree/main/extension/src/background): `extension/src/background`
- [Desktop connection](https://github.com/sureshsoudararajan/glypdl/blob/main/extension/src/background/connection/ConnectionManager.ts): `extension/src/background/connection/ConnectionManager.ts`

### Media and preferences

- **Media sites**
- **yt-dlp**
- **Downloaded media**

### Other components

- **User**

## Connections

- User → Compose interface: submits URL
- Compose interface → Download workflow: requests download (evidence: `android/app/src/main/java/com/glypdl/android/service/DownloadManager.kt`)
- Download workflow → yt-dlp engine: runs download (evidence: `android/app/src/main/java/com/glypdl/android/service/DownloadManager.kt`)
- Download workflow → Foreground service: starts service (evidence: `android/app/src/main/java/com/glypdl/android/service/DownloadManager.kt`)
- Foreground service → Download notifications: updates notices (evidence: `android/app/src/main/java/com/glypdl/android/service/DownloadForegroundService.kt`)
- yt-dlp engine → Cookie authentication: gets cookies (evidence: `android/app/src/main/java/com/glypdl/android/service/engine/YtDlpManager.kt`)
- yt-dlp engine → Settings storage: reads settings (evidence: `android/app/src/main/java/com/glypdl/android/service/engine/YtDlpManager.kt`)
- yt-dlp engine → Media request formats: uses request formats (evidence: `android/app/src/main/java/com/glypdl/android/service/engine/YtDlpManager.kt`)
- yt-dlp engine → yt-dlp: extracts media
- yt-dlp engine → Downloaded media: produces files
- User → GTK application: submits URL
- GTK application → Application orchestration: handled by app (evidence: `src/glypdl/app.py`)
- Application orchestration → Media metadata: sets up service (evidence: `src/glypdl/app.py`)
- Application orchestration → Download service: sets up service (evidence: `src/glypdl/app.py`)
- Application orchestration → Download history: sets up service (evidence: `src/glypdl/app.py`)
- Application orchestration → Browser cookies: sets up service (evidence: `src/glypdl/app.py`)
- Application orchestration → Extension IPC: starts IPC (evidence: `src/glypdl/app.py`)
- Download service → yt-dlp service: uses engine
- yt-dlp service → yt-dlp: extracts media
- yt-dlp service → Downloaded media: produces files
- Browser cookies → App data paths: uses app paths (evidence: `src/glypdl/services/cookies.py`)
- Extension IPC → App data paths: uses socket paths
- User → Desktop views: submits URL
- WinUI application → Media metadata: constructs service (evidence: `windows/src/Glypdl.Windows/App.xaml.cs`)
- WinUI application → Download and queue: constructs service (evidence: `windows/src/Glypdl.Windows/App.xaml.cs`)
- WinUI application → Settings service: constructs service (evidence: `windows/src/Glypdl.Windows/App.xaml.cs`)
- Media metadata → yt-dlp service: uses engine (evidence: `windows/src/Glypdl.Windows/Services/MetadataService.cs`)
- Download and queue → yt-dlp service: uses engine
- yt-dlp service → Settings service: reads settings (evidence: `windows/src/Glypdl.Windows/Services/YtDlpService.cs`)
- yt-dlp service → yt-dlp: extracts media
- yt-dlp service → Downloaded media: produces files
- WinUI application → Browser cookies: constructs service (evidence: `windows/src/Glypdl.Windows/App.xaml.cs`)
- Browser cookies → yt-dlp service: uses engine interface (evidence: `windows/src/Glypdl.Windows/Services/CookieService.cs`)
- User → Page integration: visits page
- Page integration → Media detection: detects media
- Media detection → Background commands: sends detections (evidence: `extension/src/background/context_menu.ts`)
- Background commands → Desktop connection: sends download (evidence: `extension/src/background/connection/ConnectionManager.ts`)
- Media sites → Media detection: provides media
- Desktop connection → Extension IPC: sends native message
