Files
got/README.md
Hojun-Cho cf9082ff72 all: cut bloated HTTP-client and tuning options
This is a personal torrent client, not a web client or daemon, so the
rarely-used HTTP-client knobs and redundant tuning flags are gone — flag,
config field, implementation, and tests removed for each. The option
surface drops from 54 to 28.

Web-client cluster removed: --all-proxy (HTTP_PROXY env still works),
load/save-cookies, --referer, -U/--user-agent, --http-user/--http-passwd,
--conditional-get, --remote-time, --check-certificate, --ca-certificate,
--lowest-speed-limit. Pass --header for a one-off auth/cookie/UA header.

Redundant knobs removed: -x and -k (folded into -s), --connect-timeout,
--retry-wait, per-item --max-download-limit/-u, --bt-max-peers,
--bt-stop-timeout, --disable-ipv6, --auto-save-interval, --human-readable,
--stop, -T (a positional .torrent works). follow-torrent and human-readable
are now unconditional defaults.
2026-06-22 08:30:12 +09:00

75 lines
2.4 KiB
Markdown

# 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,
a small set of flags. It is a downloader, not a web client: there are no
cookie/proxy/auth flags — pass `--header` for a one-off header (auth token,
cookie, user-agent) when a download needs one.
## Build
```sh
go build -o got .
```
Needs Go 1.25+.
## Usage
```sh
# 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 (segments spread across the servers,
# a dead mirror falls over); -Z downloads them as separate files instead.
got -s16 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 |
| `-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:
```sh
got -c --save-session=got.session -i got.session <urls/magnets...>
```
## Notes
- BitTorrent uses [`anacrolix/torrent`](https://github.com/anacrolix/torrent);
HTTP uses the standard library.
- Not implemented: FTP/SFTP, Metalink, and the JSON-RPC server.
- Speed caps are global: `--max-overall-download-limit` /
`--max-overall-upload-limit` apply across the whole run.
- Standard `HTTP_PROXY` / `HTTPS_PROXY` environment variables are honored.