# hmjz100/linkswift architecture

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

- Interactive diagram: https://gitdiagram.com/hmjz100/linkswift
- Repository: https://github.com/hmjz100/linkswift

## Overview

LinkSwift is a browser userscript for obtaining direct download links from cloud-drive services and handing them to download clients. The documented workflow is: a user opens a supported drive page, the script obtains a link through the provider’s public API, then presents or exports it for download. README capabilities also include UI customization, link caching, multi-threaded downloads, and downloader settings. The main userscript was not excerpted, so internal ownership and implementation details beyond the README are not verified; the other userscript in the tree is only a migration notice.

Main entry points: [`（改）网盘直链下载助手.user.js`](https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js) (LinkSwift Script), [`config`](https://github.com/hmjz100/linkswift/tree/dev/config) (Service Configurations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Page Interaction"]
  node_drive_page["Drive Page"]
  node_linkswift["LinkSwift Script"]
  node_download_ui["Download Interface"]
  node_ui_customization["UI Customization"]
end

subgraph group_links["Link Acquisition"]
  node_drive_services["Cloud Drives"]
  node_public_apis["Provider APIs"]
  node_link_retrieval["Direct Link Retrieval"]
  node_link_cache[("Link Cache")]
end

subgraph group_download["Download Delivery"]
  node_download_modes["Download Modes"]
  node_multithread["Multi-thread Downloads"]
  node_download_clients["Download Clients"]
end

subgraph group_settings["User Options"]
  node_client_settings["Client Settings"]
  node_service_configs["Service Configurations"]
end

node_user(("User"))

node_user -->|"opens"| node_drive_page
node_drive_page -->|"runs on"| node_linkswift
node_linkswift -->|"provides"| node_link_retrieval
node_link_retrieval -->|"queries"| node_public_apis
node_public_apis -->|"serves"| node_drive_services
node_link_retrieval -->|"caches links"| node_link_cache
node_linkswift -->|"shows"| node_download_ui
node_linkswift -->|"customizes"| node_ui_customization
node_download_ui -->|"offers"| node_download_modes
node_download_modes -->|"supports"| node_multithread
node_download_modes -->|"pushes links"| node_download_clients
node_user -->|"configures"| node_client_settings
node_client_settings -->|"configures"| node_download_clients
node_user -->|"manages"| node_service_configs

click node_linkswift "https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js"
click node_link_retrieval "https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js"
click node_link_cache "https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js"
click node_download_ui "https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js"
click node_ui_customization "https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js"
click node_download_modes "https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js"
click node_multithread "https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js"
click node_client_settings "https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js"
click node_service_configs "https://github.com/hmjz100/linkswift/tree/dev/config"

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_drive_page,node_linkswift,node_download_ui,node_ui_customization,node_user toneBlue
class node_drive_services,node_public_apis,node_link_retrieval,node_link_cache toneAmber
class node_download_modes,node_multithread,node_download_clients toneMint
class node_client_settings,node_service_configs toneRose
```

## Components

### Page Interaction

- **Drive Page**
- [LinkSwift Script](https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js): `（改）网盘直链下载助手.user.js`
- [Download Interface](https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js): `（改）网盘直链下载助手.user.js`
- [UI Customization](https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js): `（改）网盘直链下载助手.user.js`

### Link Acquisition

- **Cloud Drives**
- **Provider APIs**
- [Direct Link Retrieval](https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js): `（改）网盘直链下载助手.user.js`
- [Link Cache](https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js): `（改）网盘直链下载助手.user.js`

### Download Delivery

- [Download Modes](https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js): `（改）网盘直链下载助手.user.js`
- [Multi-thread Downloads](https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js): `（改）网盘直链下载助手.user.js`
- **Download Clients**

### User Options

- [Client Settings](https://github.com/hmjz100/linkswift/blob/dev/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js): `（改）网盘直链下载助手.user.js`
- [Service Configurations](https://github.com/hmjz100/linkswift/tree/dev/config): `config`

### Other components

- **User**

## Connections

- User → Drive Page: opens (evidence: `README.md`)
- Drive Page → LinkSwift Script: runs on (evidence: `README.md`)
- LinkSwift Script → Direct Link Retrieval: provides (evidence: `README.md`)
- Direct Link Retrieval → Provider APIs: queries (evidence: `README.md`)
- Provider APIs → Cloud Drives: serves (evidence: `README.md`)
- Direct Link Retrieval → Link Cache: caches links (evidence: `README.md`)
- LinkSwift Script → Download Interface: shows (evidence: `README.md`)
- LinkSwift Script → UI Customization: customizes (evidence: `README.md`)
- Download Interface → Download Modes: offers (evidence: `README.md`)
- Download Modes → Multi-thread Downloads: supports (evidence: `README.md`)
- Download Modes → Download Clients: pushes links (evidence: `README.md`)
- User → Client Settings: configures (evidence: `README.md`)
- Client Settings → Download Clients: configures (evidence: `README.md`)
- User → Service Configurations: manages (evidence: `README.md`)
