getparty

package module
v1.25.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: BSD-3-Clause Imports: 37 Imported by: 0

README

getparty

Build status Lint status

HTTP Download Manager with multi-parts

showcase

Installation

Homebrew
$ brew tap vbauerster/getparty
$ brew install getparty
AUR
$ paru -S getparty
From source
$ git clone --depth 1 https://github.com/vbauerster/getparty.git
$ cd getparty/cmd/getparty && go build

Usage

Usage:
  getparty [OPTIONS] [<url>]

Application Options:
  -p, --parts=n                                    number of parts (default: 1)
  -r, --max-retry=n                                max retries per each part, 0 for infinite (default: 10)
      --max-redirect=n                             max redirections allowed, 0 for infinite (default: 10)
  -t, --timeout=sec                                initial timeout to fill a buffer (default: 10)
  -b, --buf-size=KiB[2|4|8|16]                     buffer size, prefer smaller for slow connection (default: 8)
  -l, --speed-limit=[1|2|3|4|5]                    speed limit gauge
  -s, --session=FILE                               session state of incomplete download, file with json extension
  -U, --user-agent=[chrome|firefox|safari|edge]    User-Agent header (default: getparty/ver)
      --username=                                  basic http auth username
      --password=                                  basic http auth password
  -H, --header=key:value                           http header, can be specified more than once
  -x, --proxy=<[scheme://]host[:port]>             use the specified proxy, if scheme is empty http is assumed
  -q, --quiet                                      quiet mode, no progress bars
  -d, --debug                                      enable debug to stderr
  -v, --version                                    show version

Https Options:
  -c, --certs-file=certs.crt                       root certificates to use when verifying server certificates
      --no-check-cert                              don't verify the server's certificate chain and host name

Output Options:
  -o, --output.name=FILE                           output file name
  -f, --output.overwrite                           overwrite existing file silently
      --output.use-path                            resolve name from url path first (default: Content-Disposition header)

Best-mirror Options:
  -m, --mirror.list=FILE|-                         mirror list input
  -g, --mirror.max=n                               max concurrent http request (default: number of logical CPUs)
      --mirror.top=n                               list top n mirrors, download condition n=1 (default: 1)
      --mirror.pass=n                              query each mirror n times to get average result (default: 1)

Help Options:
  -h, --help                                       Show this help message

Arguments:
  <url>:                                           http location
Best mirror example:

read mirrors.txt from a file and proceed to download from the best mirror:

getparty -m mirrors.txt

read mirrors.txt from a stdin and proceed to download from the best mirror:

cat mirrors.txt | getparty -m -

just list top 3 mirrors without any download:

getparty -m mirrors.txt --mirror.top 3

License

BSD 3-Clause

Documentation

Index

Constants

View Source
const (
	ErrBadInvariant   = ExpectedError("Bad invariant")
	ErrCanceledByUser = ExpectedError("Canceled by user")
	ErrMaxRedirect    = ExpectedError("Max redirections")
	ErrMaxRetry       = ExpectedError("Max retries")
	ErrZeroParts      = ExpectedError("No parts no work")
	ErrTooFragmented  = ExpectedError("Too fragmented, reduce number of parts maybe?")
)
View Source
const (
	DBUG = iota
	INFO
	WARN
	ERRO
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BadProxyURL added in v1.25.0

type BadProxyURL struct {
	// contains filtered or unexported fields
}

func (BadProxyURL) Error added in v1.25.0

func (e BadProxyURL) Error() string

func (BadProxyURL) Unwrap added in v1.25.0

func (e BadProxyURL) Unwrap() error

type Cmd

type Cmd struct {
	Ctx context.Context
	Out io.Writer
	Err io.Writer
	// contains filtered or unexported fields
}

func (Cmd) Exit

func (m Cmd) Exit(err error) (status int)

func (*Cmd) Run

func (m *Cmd) Run(args []string, version, commit string) (err error)

type ContentMismatch added in v1.23.0

type ContentMismatch struct {
	// contains filtered or unexported fields
}

func (ContentMismatch) Error added in v1.23.0

func (e ContentMismatch) Error() string

type ExpectedError

type ExpectedError string

func (ExpectedError) Error

func (e ExpectedError) Error() string

type Part

type Part struct {
	Start   int64
	Stop    int64
	Written int64
	// contains filtered or unexported fields
}

Part represents state of each download part

type Session

type Session struct {
	URL           string
	OutputName    string
	ContentMD5    string
	AcceptRanges  string
	ContentType   string
	StatusCode    int
	ContentLength int64
	Redirected    bool
	Single        bool
	Elapsed       time.Duration
	HeaderMap     map[string]string
	Parts         []*Part
	// contains filtered or unexported fields
}

Session represents download session state

type UnexpectedHttpStatus added in v1.23.0

type UnexpectedHttpStatus int

func (UnexpectedHttpStatus) Error added in v1.23.0

func (e UnexpectedHttpStatus) Error() string

Directories

Path Synopsis
cmd
getparty command