Giter Club home page Giter Club logo

got's Introduction

Got.

Simple and fast concurrent downloader.

Installation โ˜ CLI Usage โ˜ Module Usage โ˜ License

Tests

Comparison

Comparison in cloud server:

[root@centos-nyc-12 ~]# time got -o /tmp/test -c 20 https://proof.ovh.net/files/1Gb.dat
URL: https://proof.ovh.net/files/1Gb.dat done!

real    0m8.832s
user    0m0.203s
sys 0m3.176s


[root@centos-nyc-12 ~]# time curl https://proof.ovh.net/files/1Gb.dat --output /tmp/test1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
								 Dload  Upload   Total   Spent    Left  Speed
100 1024M  100 1024M    0     0  35.6M      0  0:00:28  0:00:28 --:--:-- 34.4M

real    0m28.781s
user    0m0.379s
sys 0m1.970s

Installation

Download and install the latest release:

# go to tmp dir.
cd /tmp

# Download latest version.
curl -sfL https://git.io/getgot | sh

# Make the binary executable.
chmod +x /tmp/bin/got

# Move the binary to your PATH
sudo mv /tmp/bin/got /usr/bin/got

Or Go ahead compile it yourself:

go install github.com/melbahja/got/cmd/got@latest

Or from the AUR

Install got for the latest release version or got-git for the latest development version.

Note: these packages are not maintained by melbahja

Command Line Tool Usage

Simple usage:

got https://example.com/file.mp4

You can specify destination path:

got -o /path/to/save https://example.com/file.mp4

You can download multiple URLs and save them to directory:

got --dir /path/to/dir https://example.com/file.mp4 https://example.com/file2.mp4

You can download multiple URLs from a file:

got --dir /path/to/dir -f urls.txt

You can pipe multiple URLs:

cat urls.txt | got --dir /path/to/dir

Docs for available flags:

got help

Module Usage

You can use Got to download large files in your go code, the usage is simple as the CLI tool:

package main

import "github.com/melbahja/got"

func main() {

	g := got.New()

	err := g.Download("http://localhost/file.ext", "/path/to/save")

	if err != nil {
		// ..
	}
}

For more see PkgDocs.

How It Works?

Got takes advantage of the HTTP range requests support in servers RFC 7233, if the server supports partial content Got split the file into chunks, then starts downloading and merging the chunks into the destinaton file concurrently.

License

Got is provided under the MIT License ยฉ Mohammed El Bahja.

got's People

Contributors

melbahja avatar renbou avatar suzaku avatar mpldr avatar ink-splatters avatar dependabot[bot] avatar darmiel avatar kingwrcy avatar ant1k9 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.