fastget - ultra fast download files over HTTP(S)

Prasanna KumarPrasanna Kumar
2 min read

fastget is an open source CLI tool as well as Go library to ultra fast download files over HTTP(S).

DISCLAIMER: FastGet performance heavily reliant on the network and CPU performance of the client machine. More importantly HTTP(s) endpoint must allow partial requests presenting Accept-Ranges and accepting Range headers.

Features

  • Concurrent download of files over HTTP(S) if server supports Accept-Ranges. Otherwise, fallback to single thread download.
  • Increase no. of concurrent workers to speed up download. Use flag --workers.
  • Add curl like custom headers to authentifacte HTTP(S) requests. Use flag --header.
  • Specify output file to write downloads. Default to file name of URL.

    Repo: https://github.com/pgollangi/fastget

    • Star if you find this tool useful.
    • Open an Issue if you come accross any problem using tool.
    • Submit a PR if you would like an improvement

Usage

fastget available as Commnad-Line tool and Go library.

Commnad-Line

fastget [options] <URL_TO_DOWNLOAD>

Examples

$ fastget http://speedtest.tele2.net/10MB.zip
Download started..
3.50 MB / 3.50 MB 100 % [====================================================| 0s ] 267.59 KB/s
3.50 MB / 3.50 MB 100 % [====================================================| 0s ] 165.65 KB/s
3.50 MB / 3.50 MB 100 % [====================================================| 0s ] 116.10 KB/s
Download finished in 3s. File: E:\10MB.zip

For more information on CLI usage, please refer pgollangi.github.io/fastget.

Go Library

Here is a simple example that finds fastest hosts:

fg, err := fastget.NewFastGetter("http://speedtest.tele2.net/10MB.zip")
if err != nil {
    panic(err)
}

result, err := fg.Get()
if err != nil {
    panic(err)
}
file := result.OutputFile
elapsedTime := result.ElapsedTime

For more information on library usage, please refer API documentation on pkg.go.dev.

Installation

Scoop

$ scoop bucket add pgollangi-bucket https://github.com/pgollangi/scoop-bucket.git
$ scoop install fastget

Updating:

$ scoop update fastget

Homebrew

$ brew install pgollangi/tap/fastget

Updating:

$ brew upgrade fastget

Go

$ go get github.com/pgollangi/fastget/cmd/fastget
$ fastget

Manual

  1. Download and install binary from the latest release.
  2. Recommended: add fastget executable to your $PATH.

Building from source

fastget CLI is written in the Go programming language, so to build the CLI yourself, you first need to have Go installed and configured on your machine.

Install Go

To download and install Go, please refer to the Go documentation. Please download Go 1.14.x or above.

Clone this repository

$ git clone https://gitlab.com/pgollangi/fastget.git
$ cd fastget

Build

$ go build cmd/fastget/main.go
$ fastget

Happy fastget!!

0
Subscribe to my newsletter

Read articles from Prasanna Kumar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Prasanna Kumar
Prasanna Kumar

I’m Prasanna Kumar Gollangi, experienced software engineer, a full stack developer, code quality oriented, thrilled about AI and other computer science technologies.