resume

command module
v0.0.0-...-762a1d2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2024 License: MIT Imports: 41 Imported by: 0

README

resume

A resumable multipart HTTP downloader.

Install

go install github.com/b97tsk/resume@latest

Usage

### Download with default options.
$ resume http://...
### Download with a specified output file.
$ resume -o dl.zip http://...
### Download with max parallel downloads set to 9.
$ resume -c9 http://...
### Download with a config file (see below).
$ resume -f resume.yaml
### Download with default config file (i.e. resume.yaml) found in current directory.
$ resume
### Print config to standard output.
$ resume config
### Print status to standard output.
$ resume status
### Stream to standard output while downloading.
$ resume stream | mpv -

For a list of command-line flags, type resume --help.

Config File

By default, a file named resume.yaml is read when the program starts, if it exists. You can specify the path of this config file by using command-line flag -f.

A config file is an YAML document that can specify following options:

  • alloc alloc disk space before the first write.
  • autoremove auto remove .resume file after successfully verified (Default: true).
  • connections maximum number of parallel downloads (Default: 1).
  • cookie cookie file. The file format is Netscape format.
  • disable-keep-alives disable HTTP keep alives, one request per connection.
  • interval request interval (Default: 2s).
  • keep-alive keep-alive duration (Default: 30s).
  • limit-rate limit download rate to this value (B/s).
  • listen HTTP listen address for remote control.
  • max-split maximum split size (MiB).
  • min-desired-rate minimum desired download rate (B/s).
  • min-split minimum split size (MiB).
  • output output file.
  • parallel maximum number of parallel requests (Default: =connections).
  • proxy a shorthand for setting http(s)_proxy environment variables.
  • range request range (MiB).
  • read-timeout read timeout (Default: 30s).
  • referer referer url.
  • response-header-timeout response header timeout (Default: 10s).
  • skip-etag skip unreliable ETag field or not.
  • skip-last-modified skip unreliable Last-Modified field or not.
  • stream-cache stream cache size (MiB).
  • stream-rate maximum number of stream rate (MiB/s) (Default: 12).
  • sync-period sync-to-disk period (Default: 10m).
  • timeout timeout for all, low priority (Default: 30s).
  • timeout-intolerant treat timeouts as errors.
  • tls-handshake-timeout tls handshake timeout (Default: 10s).
  • truncate truncate output file before the first write.
  • url the URL to download.
  • user-agent user agent.
  • verbose write additional information to stderr.
  • verify verify output file after download completes (Default: true).

Note that command-line arguments take precedence over this config file.

Global Config File

In addition to this config file (resume.yaml), the program also tries to read a global config file named .resumerc located at your home directory if it exists. Options specified by this global config file have the lowest priority and therefore can be overrided by resume.yaml or command-line arguments. The file format is the same.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL