# ssinsta/tiktok-downloader architecture

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

- Interactive diagram: https://gitdiagram.com/ssinsta/tiktok-downloader
- Repository: https://github.com/ssinsta/tiktok-downloader

## Overview

TikTok Downloader is a Windows desktop app for downloading TikTok videos and images, individually or in batches. The main workflow starts in the GUI: users provide a post link, a text file of links, or a profile; profile downloads use browser automation to collect post links before downloading them. Downloaded media and collected-link files go to local storage, with settings controlling paths and options. The README documents these capabilities, but MainForm.cs was not sampled, so workflow edges reflect README statements rather than inspected call sites.

Main entry points: [`MainForm.cs`](https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs) (Main window), [`AppSettings.cs`](https://github.com/ssinsta/tiktok-downloader/blob/master/AppSettings.cs) (Application settings), [`SettingsDialog.cs`](https://github.com/ssinsta/tiktok-downloader/blob/master/SettingsDialog.cs) (Settings dialog), [`AboutWindow.cs`](https://github.com/ssinsta/tiktok-downloader/blob/master/AboutWindow.cs) (About window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_app["Application entry<br/>[Program.cs]"]
  node_main["Main window<br/>[MainForm.cs]"]
  node_settings_dialog["Settings dialog<br/>[SettingsDialog.cs]"]
  node_about["About window<br/>[AboutWindow.cs]"]
end

subgraph group_collection["Link collection"]
  node_profile["Profile collection<br/>[MainForm.cs]"]
  node_browser["Browser automation<br/>[MainForm.cs]"]
  node_link_filter["Post link filtering<br/>[MainForm.cs]"]
  node_link_file["Collected link file<br/>[MainForm.cs]"]
end

subgraph group_downloads["Download workflows"]
  node_single["Single post download<br/>[MainForm.cs]"]
  node_file_batch["Text-file batch<br/>[MainForm.cs]"]
  node_batch_download["Collected-post download<br/>[MainForm.cs]"]
end

subgraph group_state["Settings and storage"]
  node_local_storage[("Download storage<br/>[MainForm.cs]")]
  node_settings[("Application settings<br/>[AppSettings.cs]")]
  node_settings_file["Settings XML<br/>[AppSettings.cs]"]
end

node_user(("User"))
node_media["TikTok media"]

node_user -->|"provides links"| node_main
node_app -->|"launches"| node_main
node_main -->|"routes request"| node_single
node_main -->|"routes request"| node_file_batch
node_main -->|"routes request"| node_profile
node_profile -->|"opens and scrolls"| node_browser
node_browser -->|"visits profile"| node_media
node_profile -->|"filters found links"| node_link_filter
node_link_filter -->|"saves links"| node_link_file
node_profile -->|"starts download"| node_batch_download
node_link_file -->|"supplies links"| node_batch_download
node_single -->|"downloads post"| node_media
node_file_batch -->|"downloads posts"| node_media
node_batch_download -->|"downloads posts"| node_media
node_single -->|"saves media"| node_local_storage
node_file_batch -->|"saves media"| node_local_storage
node_batch_download -->|"saves media"| node_local_storage
node_profile -->|"saves link file"| node_local_storage
node_main -.->|"opens"| node_settings_dialog
node_settings_dialog -->|"loads and saves"| node_settings
node_settings -->|"serializes XML"| node_settings_file
node_main -.->|"uses options"| node_settings
node_main -.->|"opens"| node_about
node_about -->|"requests default browser"| node_browser

click node_app "https://github.com/ssinsta/tiktok-downloader/blob/master/Program.cs"
click node_main "https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs"
click node_settings_dialog "https://github.com/ssinsta/tiktok-downloader/blob/master/SettingsDialog.cs"
click node_about "https://github.com/ssinsta/tiktok-downloader/blob/master/AboutWindow.cs"
click node_single "https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs"
click node_file_batch "https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs"
click node_profile "https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs"
click node_browser "https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs"
click node_link_filter "https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs"
click node_link_file "https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs"
click node_batch_download "https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs"
click node_local_storage "https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs"
click node_settings "https://github.com/ssinsta/tiktok-downloader/blob/master/AppSettings.cs"
click node_settings_file "https://github.com/ssinsta/tiktok-downloader/blob/master/AppSettings.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_app,node_main,node_settings_dialog,node_about,node_user toneBlue
class node_profile,node_browser,node_link_filter,node_link_file toneAmber
class node_single,node_file_batch,node_batch_download toneMint
class node_local_storage,node_settings,node_settings_file toneRose
class node_media toneIndigo
```

## Components

### Desktop interface

- [Application entry](https://github.com/ssinsta/tiktok-downloader/blob/master/Program.cs): `Program.cs`
- [Main window](https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs): `MainForm.cs`
- [Settings dialog](https://github.com/ssinsta/tiktok-downloader/blob/master/SettingsDialog.cs): `SettingsDialog.cs`
- [About window](https://github.com/ssinsta/tiktok-downloader/blob/master/AboutWindow.cs): `AboutWindow.cs`

### Link collection

- [Profile collection](https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs): `MainForm.cs`
- [Browser automation](https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs): `MainForm.cs`
- [Post link filtering](https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs): `MainForm.cs`
- [Collected link file](https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs): `MainForm.cs`

### Download workflows

- [Single post download](https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs): `MainForm.cs`
- [Text-file batch](https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs): `MainForm.cs`
- [Collected-post download](https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs): `MainForm.cs`

### Settings and storage

- [Download storage](https://github.com/ssinsta/tiktok-downloader/blob/master/MainForm.cs): `MainForm.cs`
- [Application settings](https://github.com/ssinsta/tiktok-downloader/blob/master/AppSettings.cs): `AppSettings.cs`
- [Settings XML](https://github.com/ssinsta/tiktok-downloader/blob/master/AppSettings.cs): `AppSettings.cs`

### Other components

- **User**
- **TikTok media**

## Connections

- User → Main window: provides links (evidence: `README.md`)
- Application entry → Main window: launches (evidence: `Program.cs`)
- Main window → Single post download: routes request (evidence: `README.md`)
- Main window → Text-file batch: routes request (evidence: `README.md`)
- Main window → Profile collection: routes request (evidence: `README.md`)
- Profile collection → Browser automation: opens and scrolls (evidence: `README.md`)
- Browser automation → TikTok media: visits profile (evidence: `README.md`)
- Profile collection → Post link filtering: filters found links (evidence: `README.md`)
- Post link filtering → Collected link file: saves links (evidence: `README.md`)
- Profile collection → Collected-post download: starts download (evidence: `README.md`)
- Collected link file → Collected-post download: supplies links (evidence: `README.md`)
- Single post download → TikTok media: downloads post (evidence: `README.md`)
- Text-file batch → TikTok media: downloads posts (evidence: `README.md`)
- Collected-post download → TikTok media: downloads posts (evidence: `README.md`)
- Single post download → Download storage: saves media (evidence: `README.md`)
- Text-file batch → Download storage: saves media (evidence: `README.md`)
- Collected-post download → Download storage: saves media (evidence: `README.md`)
- Profile collection → Download storage: saves link file (evidence: `README.md`)
- Main window → Settings dialog: opens (evidence: `SettingsDialog.cs`)
- Settings dialog → Application settings: loads and saves (evidence: `SettingsDialog.cs`)
- Application settings → Settings XML: serializes XML (evidence: `AppSettings.cs`)
- Main window → Application settings: uses options
- Main window → About window: opens (evidence: `AboutWindow.cs`)
- About window → Browser automation: requests default browser (evidence: `AboutWindow.cs`)
