# aerion/uptobox-dl architecture

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

- Interactive diagram: https://gitdiagram.com/aerion/uptobox-dl
- Repository: https://github.com/aerion/uptobox-dl

## Overview

uptobox-dl is a .NET batch downloader for direct Uptobox/Uptostream links and public folders. The user supplies a token, links, and optionally an output directory; the CLI parses links, expands folder links to file codes, obtains file metadata and a waiting token, requests a download URL, then streams each file to local storage. The graph separates CLI orchestration, input resolution, Uptobox API access, and transfer. Evidence is limited to the README and excerpted source; external API behavior is represented only where code makes requests.

Main entry points: [`uptobox-dl/UptoboxClient/Client.cs`](https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/Client.cs) (API client), [`uptobox-dl/Program.cs`](https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/Program.cs) (Batch CLI), [`uptobox-dl/UptoboxClient/PublicFolder.cs`](https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/PublicFolder.cs) (Folder response), [`uptobox-dl/UptoboxClient/LinkInfo.cs`](https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/LinkInfo.cs) (API list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI orchestration"]
  node_program["Batch CLI<br/>[Program.cs]"]
end

subgraph group_inputs["Link resolution"]
  node_parser["Link parser<br/>[LinkParser.cs]"]
  node_folder_codes["Folder expansion<br/>[Client.cs]"]
end

subgraph group_api["Uptobox API"]
  node_client["API client<br/>[Client.cs]"]
  node_file_info["File metadata<br/>[FileCodeInfo.cs]"]
  node_waiting["Wait token<br/>[WaitingToken.cs]"]
  node_folder_response["Folder response<br/>[PublicFolder.cs]"]
  node_folder_item["Folder item"]
  node_remote_list["API list<br/>[LinkInfo.cs]"]
  node_status["Status mapping<br/>[StatusCode.cs]"]
  node_client_exception["API exception<br/>[ClientException.cs]"]
end

subgraph group_transfer["Download transfer"]
  node_download["File transfer<br/>[Program.cs]"]
end

node_user(("User"))
node_uptobox{{"Uptobox API"}}
node_local_file[("Local file")]

node_user -->|"provides options"| node_program
node_program -->|"classifies links"| node_parser
node_program -->|"expands folders"| node_folder_codes
node_program -->|"gets metadata"| node_client
node_program -->|"gets wait token"| node_client
node_program -->|"gets download URL"| node_client
node_folder_codes -->|"requests folder pages"| node_client
node_client -->|"calls API"| node_uptobox
node_client -->|"checks status"| node_status
node_client -->|"throws errors"| node_client_exception
node_client -->|"deserializes token"| node_waiting
node_client -->|"deserializes folder"| node_folder_response
node_folder_response -->|"contains items"| node_folder_item
node_client -->|"deserializes list"| node_remote_list
node_remote_list -->|"contains metadata"| node_file_info
node_program -->|"downloads URL"| node_download
node_download -->|"writes bytes"| node_local_file

click node_program "https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/Program.cs"
click node_parser "https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/LinkParser.cs"
click node_folder_codes "https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/Client.cs"
click node_client "https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/Client.cs"
click node_file_info "https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/FileCodeInfo.cs"
click node_waiting "https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/WaitingToken.cs"
click node_folder_response "https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/PublicFolder.cs"
click node_folder_item "https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/PublicFolderItem.cs"
click node_remote_list "https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/LinkInfo.cs"
click node_status "https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/StatusCode.cs"
click node_client_exception "https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/ClientException.cs"
click node_download "https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/Program.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_program,node_user toneBlue
class node_parser,node_folder_codes,node_local_file toneAmber
class node_client,node_file_info,node_waiting,node_folder_response,node_folder_item,node_remote_list,node_status,node_client_exception,node_uptobox toneMint
class node_download toneRose
```

## Components

### CLI orchestration

- [Batch CLI](https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/Program.cs): `uptobox-dl/Program.cs`

### Link resolution

- [Link parser](https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/LinkParser.cs): `uptobox-dl/UptoboxClient/LinkParser.cs`
- [Folder expansion](https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/Client.cs): `uptobox-dl/UptoboxClient/Client.cs`

### Uptobox API

- [API client](https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/Client.cs): `uptobox-dl/UptoboxClient/Client.cs`
- [File metadata](https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/FileCodeInfo.cs): `uptobox-dl/UptoboxClient/FileCodeInfo.cs`
- [Wait token](https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/WaitingToken.cs): `uptobox-dl/UptoboxClient/WaitingToken.cs`
- [Folder response](https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/PublicFolder.cs): `uptobox-dl/UptoboxClient/PublicFolder.cs`
- [Folder item](https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/PublicFolderItem.cs): `uptobox-dl/UptoboxClient/PublicFolderItem.cs`
- [API list](https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/LinkInfo.cs): `uptobox-dl/UptoboxClient/LinkInfo.cs`
- [Status mapping](https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/StatusCode.cs): `uptobox-dl/UptoboxClient/StatusCode.cs`
- [API exception](https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/UptoboxClient/ClientException.cs): `uptobox-dl/UptoboxClient/ClientException.cs`

### Download transfer

- [File transfer](https://github.com/aerion/uptobox-dl/blob/master/uptobox-dl/Program.cs): `uptobox-dl/Program.cs`

### Other components

- **User**
- **Uptobox API**
- **Local file**

## Connections

- User → Batch CLI: provides options (evidence: `README.md`)
- Batch CLI → Link parser: classifies links (evidence: `uptobox-dl/Program.cs`)
- Batch CLI → Folder expansion: expands folders (evidence: `uptobox-dl/Program.cs`)
- Batch CLI → API client: gets metadata (evidence: `uptobox-dl/Program.cs`)
- Batch CLI → API client: gets wait token (evidence: `uptobox-dl/Program.cs`)
- Batch CLI → API client: gets download URL (evidence: `uptobox-dl/Program.cs`)
- Folder expansion → API client: requests folder pages (evidence: `uptobox-dl/UptoboxClient/Client.cs`)
- API client → Uptobox API: calls API (evidence: `uptobox-dl/UptoboxClient/Client.cs`)
- API client → Status mapping: checks status (evidence: `uptobox-dl/UptoboxClient/Client.cs`)
- API client → API exception: throws errors (evidence: `uptobox-dl/UptoboxClient/Client.cs`)
- API client → Wait token: deserializes token (evidence: `uptobox-dl/UptoboxClient/Client.cs`)
- API client → Folder response: deserializes folder (evidence: `uptobox-dl/UptoboxClient/Client.cs`)
- Folder response → Folder item: contains items (evidence: `uptobox-dl/UptoboxClient/PublicFolder.cs`)
- API client → API list: deserializes list (evidence: `uptobox-dl/UptoboxClient/Client.cs`)
- API list → File metadata: contains metadata (evidence: `uptobox-dl/UptoboxClient/LinkInfo.cs`)
- Batch CLI → File transfer: downloads URL (evidence: `uptobox-dl/Program.cs`)
- File transfer → Local file: writes bytes (evidence: `uptobox-dl/Program.cs`)
