Home

Awesome

<h1 align="center">Aget-rs - Fast Asynchronous Downloader with Rust 🦀</h1>

CI

aget-rs is a fast asynchronous downloader written in Rust.
It requests a resource with a number of concurrent asynchronous request in a single thread.

Especially, the concurrent amount can be any positive number as your wish.

aget-rs supports to download a HTTP/S link, a M3U8 video link, a Torrent and a magnet link.

Installation

You can download the last release from https://github.com/PeterDing/aget-rs/releases

Benchmark

We conside that there is a file to download. This file has 10MB. The server which hosts the file has been set a limit rate to 100KB/s, but no connecting count limit.

It will be easy to calculate the total costing time when we use 1, 10, 100 connections to request the file.

In the benchmark test, we use nginx to simulate the environment where a limit rate is 100KB/s for downloading.

Following is the results of using curl and aget-rs. (For more details, you can find at here)

Usage

Options

Usage: ag [OPTIONS] <URL>

Arguments:
  <URL>

Options:
  -m, --method <METHOD>                Request method, e.g. GET, POST [default: GET]
  -H, --header <HEADER>                Request headers, e.g. -H "User-Agent: aget"
  -d, --data <DATA>                    Request with POST method with the data, e.g. -d "a=b"
      --insecure                       Skip to verify the server's TLS certificate
  -s, --concurrency <CONCURRENCY>      The number of concurrency request [default: 10]
  -k, --chunk-size <CHUNK_SIZE>        The number ofinterval length of each concurrent request [default: '50m']
  -t, --timeout <TIMEOUT>              Timeout(seconds) of request [default: 60]
      --dns-timeout <DNS_TIMEOUT>      DNS Timeout(seconds) of request [default: 10]
      --retries <RETRIES>              The maximum times of retring [default: 5]
      --retry-wait <RETRY_WAIT>        The seconds between retries [default: 0]
      --proxy <PROXY>                  [protocol://]host[:port] Use this proxy
      --type <TYPE>                    Task type, auto/http/m3u8/bt [default: auto]
      --bt-file-regex <BT_FILE_REGEX>  A regex to only download files matching it in the torrent
      --seed                           Seed the torrent
      --bt-trackers <BT_TRACKERS>      Trackers for the torrent, e.g. --bt-trackers "udp://tracker.opentrackr.org:1337/announce
                                       ,udp://opentracker.io:6969/announce"
      --bt-peer-connect-timeout <BT_PEER_CONNECT_TIMEOUT>
          Peer connect timeout in seconds. [default: 10]
      --bt-peer-read-write-timeout <BT_PEER_READ_WRITE_TIMEOUT>
          Peer read/write timeout in seconds. [default: 10]
      --bt-peer-keep-alive-interval <BT_PEER_KEEP_ALIVE_INTERVAL>
          Peer keep-alive interval in seconds. [default: 120]
      --debug                          Debug output. Print all trackback for debugging
      --quiet                          Quiet mode. Don't show progress bar and task information. But still show the error information
  -o, --out <OUT>                      The path of output for the request e.g. -o "/path/to/file"
  -h, --help                           Print help
  -V, --version                        Print version

Configuration

Aget can be configured by a configuration file. The file locates at ~/.config/aget/config. Following options can be set. Aget uses these options as the defaults for each command.

headers = [["key", "value"], ...]
concurrency = ...
chunk_size = "..."
timeout = ...
dns_timeout = ...
retries = ...
retry_wait = ...

If the file does not exist, aget will use the default configuration.

headers = [["user-agent", "aget/version"]]
concurrency = 10
chunk_size = "50m"
timeout = 60
dns_timeout = 10
retries = 5
retry_wait = 0