Hojun-Cho 10672f3816 all: cut bloat found in the pike audit
Dead, vestigial, and over-built code with no behavior change (except the
bool-vocabulary trim, a deliberate behavior tightening):

- httpdl: drop the vestigial sort+copy in validSegs (work-stealing was
  removed in 270812d, so segments always tile [0,total) ascending now);
  validate order in place, which also rejects a scrambled sidecar. Inline
  the endOff() accessor to s.end.
- cli: shrink the boolean vocabulary to true/false, which is all that's
  accepted. The invented yes/no/1/0/on/off spellings are gone, so e.g.
  --enable-dht=yes (or yes in got.conf) is now a usage error.
- download: remove the dead, never-called Stat.Done() method.
- progress: drop speed(), a pure alias of humanSize; call humanSize directly.
- main: replace the jobsHolder mutex box with atomic.Pointer[[]job] for the
  forced-exit session save; the capability stays, the lock and type go.
- bt: collapse isAddrInUse's X||X (missinggo.IsAddrInUse is that exact
  string match); drop the now-unused missinggo import (tidy -> indirect).
- option: note that prealloc and falloc are identical here.
2026-06-21 15:45:56 +09:00
2026-06-21 15:45:56 +09:00
2026-06-21 15:45:56 +09:00
2026-06-19 12:32:14 +09:00
2026-06-21 15:45:56 +09:00

got

A command-line download tool in Go. It fetches HTTP(S) files over multiple connections and downloads BitTorrent magnets and .torrent files — one binary, familiar flags.

Build

go build -o got .

Needs Go 1.25+.

Usage

# HTTP download: parallel out of the box (5 connections); -s turns it up
got https://example.com/big.iso
got -s16 https://example.com/big.iso

# resume an interrupted download
got -c https://example.com/big.iso

# one file from several mirrors (connections spread across servers,
# a dead mirror falls over); -Z downloads them as separate files instead.
# -x caps connections per server when mirroring.
got -s16 -x4 https://a.example/big.iso https://b.example/big.iso

# a torrent or magnet; seed for 30 minutes after finishing
got --seed-time=30 ubuntu.torrent
got 'magnet:?xt=urn:btih:...'

# many downloads, two at a time
got -j2 -i urls.txt

Run got --help (or --help=all) for every option.

Common options

flag meaning default
-d, --dir output directory .
-o, --out output filename from URL
-c, --continue resume a partial download false
-s, --split connections per download (the speed dial) 5
-x, --max-connection-per-server cap connections per server (116) 1 (= split when unset)
-j, --max-concurrent-downloads files downloaded at once 5
--max-overall-download-limit global speed cap 0 (off)
--checksum verify the finished file: TYPE=DIGEST (sha-256, sha-1, …)
--seed-time minutes to seed after a torrent finishes by ratio
--seed-ratio stop seeding at this ratio 1.0
-S, --show-files list torrent files and exit
-q, --quiet no progress output false

Resume

HTTP downloads resume from a small <file>.got sidecar — just re-run with -c. Torrents resume from the data already on disk. To resume across runs, point --save-session and -i at the same file:

got -c --save-session=got.session -i got.session  <urls/magnets...>

Notes

  • BitTorrent uses anacrolix/torrent; HTTP uses the standard library.
  • Not implemented: FTP/SFTP, Metalink, and the JSON-RPC server.
  • When several torrents run at once, --max-download-limit / --max-upload-limit apply per run rather than per torrent (--max-overall-* are exact).
Description
No description provided
Readme 591 KiB
Languages
Go 100%