# bariskisir/videodownloader architecture

> Architecture diagram of the GitHub repository bariskisir/videodownloader, 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/bariskisir/videodownloader
- Repository: https://github.com/bariskisir/videodownloader

## Overview

VideoDownloader is a WPF desktop app for fetching video formats and downloading media from YouTube, Twitch, and Kick. The main workflow takes URLs through platform selection and metadata lookup, then adds downloads to a controllable queue and reports progress. It also supports batch URLs and remembers the download folder. Platform adapters use yt-dlp/FFmpeg through YoutubeDLSharp. The README describes the user-facing capabilities; some UI bindings and ViewModel methods are not included in the sampled source, so their detailed wiring is not shown.

Main entry points: [`src/VideoDownloader/ViewModels/MainViewModel.cs`](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/ViewModels/MainViewModel.cs) (Main view model), [`src/VideoDownloader/Services/PlatformFactory.cs`](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Services/PlatformFactory.cs) (Platform factory), [`src/VideoDownloader/MainWindow.xaml`](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/MainWindow.xaml) (Main window), [`src/VideoDownloader/Services/IVideoPlatform.cs`](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Services/IVideoPlatform.cs) (Video metadata)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop UI"]
  node_window["Main window<br/>[MainWindow.xaml]"]
end

subgraph group_workflow["Download workflow"]
  node_vm["Main view model<br/>[MainViewModel.cs]"]
  node_url["URL input<br/>[MainViewModel.cs]"]
  node_metadata["Video metadata<br/>[IVideoPlatform.cs]"]
  node_formats["Format choices<br/>[VideoResolution.cs]"]
  node_queue["Download queue<br/>[MainViewModel.cs]"]
  node_progress["Download progress<br/>[IVideoPlatform.cs]"]
end

subgraph group_platforms["Platform adapters"]
  node_factory["Platform factory<br/>[PlatformFactory.cs]"]
  node_youtube["YouTube adapter<br/>[YoutubePlatform.cs]"]
  node_twitch["Twitch adapter<br/>[TwitchPlatform.cs]"]
  node_kick["Kick adapter<br/>[KickPlatform.cs]"]
  node_ytdl["yt-dlp / FFmpeg"]
end

subgraph group_state["App state"]
  node_item["Download item<br/>[DownloadItem.cs]"]
  node_folder["Download folder<br/>[MainViewModel.cs]"]
  node_config["Folder config<br/>[AppConfig.cs]"]
end

node_user(("User"))
node_configfile["config.json"]

node_user -->|"uses"| node_window
node_window -->|"binds to"| node_vm
node_vm -->|"accepts URLs"| node_url
node_vm -->|"selects platform"| node_factory
node_factory -->|"routes URLs"| node_youtube
node_factory -->|"routes URLs"| node_twitch
node_factory -->|"routes URLs"| node_kick
node_vm -->|"requests info"| node_metadata
node_youtube -->|"fetches / downloads"| node_ytdl
node_twitch -->|"fetches / downloads"| node_ytdl
node_kick -->|"fetches / downloads"| node_ytdl
node_metadata -->|"returns formats"| node_formats
node_vm -->|"adds downloads"| node_queue
node_queue -->|"holds items"| node_item
node_vm -->|"starts / pauses"| node_item
node_vm -->|"reports updates"| node_progress
node_vm -->|"gets downloader"| node_factory
node_vm -->|"sets destination"| node_folder
node_vm -->|"serializes settings"| node_config
node_vm -->|"reads / writes"| node_configfile

click node_window "https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/MainWindow.xaml"
click node_vm "https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/ViewModels/MainViewModel.cs"
click node_url "https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/ViewModels/MainViewModel.cs"
click node_metadata "https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Services/IVideoPlatform.cs"
click node_formats "https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Models/VideoResolution.cs"
click node_factory "https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Services/PlatformFactory.cs"
click node_youtube "https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Services/YoutubePlatform.cs"
click node_twitch "https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Services/TwitchPlatform.cs"
click node_kick "https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Services/KickPlatform.cs"
click node_queue "https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/ViewModels/MainViewModel.cs"
click node_item "https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Models/DownloadItem.cs"
click node_progress "https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Services/IVideoPlatform.cs"
click node_folder "https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/ViewModels/MainViewModel.cs"
click node_config "https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Models/AppConfig.cs"

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_window,node_user toneBlue
class node_vm,node_url,node_metadata,node_formats,node_queue,node_progress toneAmber
class node_factory,node_youtube,node_twitch,node_kick,node_ytdl toneMint
class node_item,node_folder,node_config toneRose
class node_configfile toneIndigo
```

## Components

### Desktop UI

- [Main window](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/MainWindow.xaml): `src/VideoDownloader/MainWindow.xaml`

### Download workflow

- [Main view model](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/ViewModels/MainViewModel.cs): `src/VideoDownloader/ViewModels/MainViewModel.cs`
- [URL input](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/ViewModels/MainViewModel.cs): `src/VideoDownloader/ViewModels/MainViewModel.cs`
- [Video metadata](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Services/IVideoPlatform.cs): `src/VideoDownloader/Services/IVideoPlatform.cs`
- [Format choices](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Models/VideoResolution.cs): `src/VideoDownloader/Models/VideoResolution.cs`
- [Download queue](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/ViewModels/MainViewModel.cs): `src/VideoDownloader/ViewModels/MainViewModel.cs`
- [Download progress](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Services/IVideoPlatform.cs): `src/VideoDownloader/Services/IVideoPlatform.cs`

### Platform adapters

- [Platform factory](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Services/PlatformFactory.cs): `src/VideoDownloader/Services/PlatformFactory.cs`
- [YouTube adapter](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Services/YoutubePlatform.cs): `src/VideoDownloader/Services/YoutubePlatform.cs`
- [Twitch adapter](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Services/TwitchPlatform.cs): `src/VideoDownloader/Services/TwitchPlatform.cs`
- [Kick adapter](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Services/KickPlatform.cs): `src/VideoDownloader/Services/KickPlatform.cs`
- **yt-dlp / FFmpeg**

### App state

- [Download item](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Models/DownloadItem.cs): `src/VideoDownloader/Models/DownloadItem.cs`
- [Download folder](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/ViewModels/MainViewModel.cs): `src/VideoDownloader/ViewModels/MainViewModel.cs`
- [Folder config](https://github.com/bariskisir/videodownloader/blob/master/src/VideoDownloader/Models/AppConfig.cs): `src/VideoDownloader/Models/AppConfig.cs`

### Other components

- **User**
- **config.json**

## Connections

- User → Main window: uses
- Main window → Main view model: binds to
- Main view model → URL input: accepts URLs
- Main view model → Platform factory: selects platform
- Platform factory → YouTube adapter: routes URLs
- Platform factory → Twitch adapter: routes URLs
- Platform factory → Kick adapter: routes URLs
- Main view model → Video metadata: requests info
- YouTube adapter → yt-dlp / FFmpeg: fetches / downloads
- Twitch adapter → yt-dlp / FFmpeg: fetches / downloads
- Kick adapter → yt-dlp / FFmpeg: fetches / downloads
- Video metadata → Format choices: returns formats
- Main view model → Download queue: adds downloads
- Download queue → Download item: holds items
- Main view model → Download item: starts / pauses
- Main view model → Download progress: reports updates
- Main view model → Platform factory: gets downloader
- Main view model → Download folder: sets destination
- Main view model → Folder config: serializes settings
- Main view model → config.json: reads / writes
