Skip to content

Repository files navigation

GoDownloader

A self-hosted download manager for direct files, media streams, and torrents — unified in one clean interface.

CIGo 1.25React 19SQLiteLicense


Overview

GoDownloader is a unified download management system that orchestrates three specialized engines behind a single API and UI. Paste a link — GoDownloader routes it to the right backend, manages the lifecycle, and streams progress to your browser in real time.

EngineProtocolsCapabilities
aria2HTTP / HTTPS / FTPMulti-connection, resumable, segmented downloads
yt-dlp1800+ media sitesFormat selection, audio/video merge via FFmpeg
qBittorrentBitTorrent / MagnetFile selection, priority control, seeding lifecycle

Everything runs locally. No cloud services, no accounts, no telemetry.


Key Features

🎯 Intelligent Routing

Paste any URL, magnet link, or upload a .torrent file. The engine router analyzes the source and dispatches to the optimal backend automatically.

📊 Priority Queue & Scheduler

A built-in scheduler manages download concurrency with configurable limits. Jobs are organized into priority lanes (high, normal, low) and processed in FIFO order within each lane. Higher priority jobs advance in the queue without interrupting active downloads.

🔄 Real-Time Progress

All job updates — speed, ETA, progress, state changes — stream to the browser via Server-Sent Events. No polling, no page refreshes.

📦 Batch & Bulk Operations

Submit up to 100 links at once. Select multiple jobs and pause, resume, cancel, retry, or delete them in a single action.

🎬 Media Downloads

  • Auto-detects 1800+ supported platforms via yt-dlp
  • Presents available formats (4K, 1080p, 720p, audio-only) with codec info and estimated file sizes
  • Merges video + audio streams automatically using FFmpeg
  • Isolated temporary workspace with safe finalization to destination

🌊 Torrent Support

  • Accepts magnet links and .torrent file uploads
  • Full file tree with per-file selection and priority control before starting
  • Live seeding statistics (upload speed, ratio, connected peers)
  • Five seeding policies: none, unlimited, ratio, duration, ratio_or_duration

🗂️ Storage & File Lifecycle

  • Per-job destinations with path snapshotting at creation time
  • Download categories with folder mappings (relative or absolute)
  • Disk-space preflight validation before start/resume
  • Filename conflict policies: rename, overwrite, or fail
  • Safe deletion with ownership verification — only files GoDownloader created are touched

🔒 Network & Protocol Controls (v0.7)

  • Global and per-job bandwidth limits (download + upload)
  • Proxy support (HTTP, HTTPS, SOCKS5) with per-engine capability awareness
  • Custom User-Agent, HTTP headers, retry/timeout controls
  • AES-256-GCM encryption for proxy passwords and sensitive headers
  • HTTP(S) tracker subscriptions with bounded refresh and transactional persistence
  • qBittorrent operations scoped exclusively to GoDownloader-owned hashes

🛡️ Restart Recovery

Active downloads reattach after server restart. Queued jobs are preserved. Torrent jobs automatically reconnect to the qBittorrent daemon.


Architecture

┌─────────────────────────────────────────────────────┐
│ React UI (Vite + TS) │
└──────────────────────┬──────────────────────────────┘
│ REST API + SSE
▼
┌─────────────────────────────────────────────────────┐
│ Go HTTP Server │
│ │
│ ┌─────────────┐ ┌────────────┐ ┌──────────────┐ │
│ │ Job Manager │─▶│ Scheduler │─▶│ Queue DB │ │
│ │ │ │ │ │ (SQLite) │ │
│ │ State Machine│ │ Priority │ └──────────────┘ │
│ │ Recovery │ │ Lanes │ │
│ └──────┬──────┘ └────────────┘ │
│ │ │
│ ┌──────▼──────┐ ┌───────────┐ │
│ │Engine Router│ │ Event Bus │──▶ SSE Stream │
│ └──┬───┬───┬──┘ └───────────┘ │
└─────┼───┼───┼───────────────────────────────────────┘
│ │ │
▼ ▼ ▼
aria2 yt-dlp qBittorrent

Prerequisites

DependencyVersionInstall
Go1.25+go.dev/dl
Node.js18+nodejs.org
aria2anywinget install aria2 · brew install aria2 · apt install aria2
yt-dlpanywinget install yt-dlp · brew install yt-dlp · pip install yt-dlp
FFmpeganywinget install ffmpeg · brew install ffmpeg · apt install ffmpeg
qBittorrent5.0+apt install qbittorrent-nox · Docker · Desktop with Web UI

Note: aria2 and qBittorrent run as separate daemon processes. GoDownloader communicates with them over their local APIs — it does not bundle or manage these processes.


Quick Start

1. Start the external engines

# aria2 RPC daemon
aria2c --enable-rpc --rpc-listen-all=false --rpc-listen-port=6800 --rpc-allow-origin-all
# qBittorrent Web API (separate terminal)
qbittorrent-nox --webui-port=8081

2. Build and run

# Build the frontendcd web && npm install && npm run build &&cd ..
# Start the server
go run ./cmd/server

3. Open the UI

Navigate to http://localhost:8080 in your browser.


Development

Local Development Setup

# Terminal 1 — Go backend
go run ./cmd/server
# Terminal 2 — React dev server with hot reload (proxies API to :8080)cd web && npm run dev

Dev UI available at http://localhost:5173.

Running Tests

# Backend — all unit tests
go test ./...
# Backend — with race condition detection
go test -race ./...
# Frontend — full verification suitecd web && npm run typecheck && npm test -- --run && npm run lint && npm run build

CI Pipeline

Automated CI runs on every push and pull request against main:

JobChecks
Go Backend Verificationgofmt, go vet, unit tests, race detector
Web Frontend VerificationTypeScript typecheck, Vitest, linting, production build

API Reference

Jobs

MethodEndpointDescription
POST/api/v1/jobsCreate a download job
POST/api/v1/jobs/batchSubmit multiple jobs
POST/api/v1/jobs/bulkBulk pause / resume / cancel / retry
GET/api/v1/jobsList all jobs
GET/api/v1/jobs/{id}Get job details
POST/api/v1/jobs/{id}/pausePause a job
POST/api/v1/jobs/{id}/resumeResume a job
POST/api/v1/jobs/{id}/retryRetry a failed job
POST/api/v1/jobs/{id}/cancelCancel a job
DELETE/api/v1/jobs/{id}Delete a job (with optional file removal)
PUT/api/v1/jobs/{id}/priorityChange priority lane

Torrents

MethodEndpointDescription
POST/api/v1/jobs/torrentUpload a .torrent file
GET/api/v1/jobs/{id}/torrent/filesGet torrent file list
POST/api/v1/jobs/{id}/torrent/startSet file priorities and start
POST/api/v1/jobs/{id}/stop-seedingStop seeding
POST/api/v1/jobs/{id}/torrent/trackersAdd trackers to an owned public torrent
PUT/api/v1/jobs/{id}/torrent/seeding-policyUpdate seeding policy

Network & Capabilities

MethodEndpointDescription
PUT/api/v1/jobs/{id}/networkUpdate live bandwidth limits
GET/api/v1/jobs/{id}/capabilitiesGet normalized controls for a job
GET/api/v1/capabilitiesGet capability profiles
POST/api/v1/capabilities/resolveResolve source or batch intersection

Tracker Subscriptions

MethodEndpointDescription
GET/api/v1/tracker-sourcesList tracker subscriptions
POST/api/v1/tracker-sourcesCreate a tracker subscription
PUT/api/v1/tracker-sources/{id}Update a subscription
DELETE/api/v1/tracker-sources/{id}Delete a subscription
POST/api/v1/tracker-sources/{id}/refreshRefresh one subscription
POST/api/v1/tracker-sources/refreshRefresh all enabled subscriptions

Media, Categories & Queue

MethodEndpointDescription
POST/api/v1/jobs/{id}/formatSelect media format
GET/api/v1/categoriesList download categories
POST/api/v1/categoriesCreate a category
PUT/api/v1/categories/{id}Update a category
DELETE/api/v1/categories/{id}Delete a category
GET/api/v1/queueQueue snapshot and capacity
PUT/api/v1/queue/reorderReorder jobs within a lane
GET/api/v1/settingsGet current settings
PUT/api/v1/settingsUpdate settings
GET/api/v1/eventsSSE stream for live updates

Configuration

All settings are optional. Defaults work out of the box for a typical local setup.

Core Settings
VariableDefaultDescription
LISTEN_ADDR127.0.0.1:8080Server listen address
MAX_CONCURRENT_DOWNLOADS3Maximum simultaneous downloads
DOWNLOAD_DIR./downloadsDefault download directory
DATA_DIR./dataApplication data storage
TEMP_DIR<DATA_DIR>/tmpTemporary workspace for media downloads
WEB_DIR./web/distBuilt frontend directory
MIN_FREE_SPACE_BYTES1073741824Minimum free disk space reserve (1 GiB)
DEFAULT_CONFLICT_POLICYrenameFilename conflict policy: rename, overwrite, fail
Engine Connections
VariableDefaultDescription
ARIA2_RPC_URLhttp://localhost:6800/jsonrpcaria2 JSON-RPC endpoint
ARIA2_SECRETaria2 RPC secret
QBIT_URLhttp://127.0.0.1:8081qBittorrent Web API address
QBIT_USERNAMEadminqBittorrent username
QBIT_PASSWORDqBittorrent password
QBIT_TIMEOUT30qBittorrent request timeout (seconds)
YTDLP_PATHyt-dlpPath to yt-dlp binary
FFMPEG_PATH""Path to FFmpeg binary (empty = auto-detect via PATH)
Network & Security
VariableDefaultDescription
GLOBAL_DOWNLOAD_LIMIT_BYTES_PER_SECOND0Global download limit (0 = unlimited)
DEFAULT_TORRENT_DOWNLOAD_LIMIT_BYTES_PER_SECOND0Default per-torrent download limit
DEFAULT_TORRENT_UPLOAD_LIMIT_BYTES_PER_SECOND0Default per-torrent upload limit
DEFAULT_PROXY_MODEdisableddisabled, system, or custom
DEFAULT_PROXY_PROTOCOLhttp, https, or socks5
DEFAULT_PROXY_HOST / DEFAULT_PROXY_PORTCustom proxy endpoint
DEFAULT_PROXY_USERNAME / DEFAULT_PROXY_PASSWORDProxy credentials
DEFAULT_NO_PROXYComma-separated proxy bypass list
DEFAULT_USER_AGENTDefault User-Agent
V0.7_SETTINGS_ENCRYPTION_KEYAES-256-GCM key for persisted secrets
MANAGE_QBIT_GLOBAL_NETWORK_SETTINGSfalseOpt-in for managed qBittorrent proxy settings
Download Tuning
VariableDefaultDescription
DEFAULT_MAX_ATTEMPTS0Retry attempts (0 = engine default)
DEFAULT_RETRY_WAIT_SECONDS0Wait between retries (0–3600s)
DEFAULT_CONNECT_TIMEOUT_SECONDS0Connection timeout (0 = engine default)
DEFAULT_REQUEST_TIMEOUT_SECONDS0Request timeout (0 = engine default)
DEFAULT_ARIA2_SPLIT5aria2 split count (1–16)
DEFAULT_ARIA2_MAX_CONNECTIONS_PER_SERVER1aria2 connections per server (1–16)
DEFAULT_ARIA2_MIN_SPLIT_SIZE_BYTES20971520aria2 minimum split size (1 MiB–1 GiB)
DEFAULT_SEEDING_MODEnoneSeeding policy: none, unlimited, ratio, duration, ratio_or_duration
DEFAULT_SEED_RATIORatio threshold for ratio-based modes
DEFAULT_SEED_TIME_SECONDSTime threshold for duration-based modes
TRACKER_AUTO_APPLYfalseAuto-apply tracker entries to new public torrents

Engine Capability Matrix

ControlDirect (aria2)Media (yt-dlp)Torrent (qBittorrent)
Pause / Resume✅ Live✅ Live
Download Limit✅ Live⚡ Startup-only✅ Live
Upload Limit✅ Live
Delete with Files✅ Ownership-verified✅ Ownership-verified✅ Selected-only
ProxySnapshot HTTPSnapshot HTTP/HTTPS/SOCKS5Managed global opt-in
Headers / Retry / TimeoutsSnapshotSnapshot
Trackers / Seeding✅ Owned torrents only

Project Structure

GoDownloader/
├── cmd/server/ Application entry point
├── internal/
│ ├── api/ HTTP handlers and REST routing
│ ├── config/ Environment and configuration loading
│ ├── database/ SQLite storage, migrations, and repositories
│ ├── engine/ Engine registry and adapters
│ │ ├── aria2/ aria2 JSON-RPC client
│ │ ├── ytdlp/ yt-dlp process runner and format analyzer
│ │ └── qbittorrent/ qBittorrent Web API client
│ ├── events/ Event bus and SSE handler
│ ├── job/ Job state machine, scheduler, queue, and recovery
│ ├── networkpolicy/ Capability profiles and policy validation
│ ├── securestore/ Field-bound AES-256-GCM secret storage
│ ├── settings/ Application settings persistence
│ ├── storage/ Storage resolution, disk preflight, and file lifecycle
│ └── tracker/ Bounded tracker subscription management
├── web/
│ └── src/
│ ├── components/ React UI components
│ ├── hooks/ Custom React hooks
│ ├── api.ts API client
│ └── App.tsx Application root
├── .github/workflows/ CI pipeline definitions
└── go.mod Go module definition

License

This project is for personal use.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages