• Stars
    star
    636
  • Rank 68,454 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 4 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Got: Simple golang package and CLI tool to download large files faster πŸƒ than cURL and Wget!

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.

More Repositories

1

goph

🀘 The native golang ssh client to execute your commands over ssh connection. πŸš€πŸš€
Go
1,334
star
2

seo

🐘 Simple PHP library to help developers 🍻 do better on-page SEO optimization πŸ€–
PHP
263
star
3

Http2Pusher

PHP Http2 Server Push
PHP
27
star
4

semver

Simple PHP Semantic Versioning Parser and Comparator
PHP
22
star
5

environ

🐘 PHP environment variables πŸ”ƒ loader in $_ENV ONLY 🚀 with the power of INI syntax and ARRAY support
PHP
11
star
6

loginer

oauth Login with facebook and google & twitter using php/mysqli
PHP
10
star
7

ron

Ron: A simple bash task runner to run any executable file inside a .ron directory or `ron.yaml` file!
Go
10
star
8

ctl

πŸ™Œ All systemd commands and tools in one easy command `ctl`! One to rule them all.😼
Go
7
star
9

Sevent

Sevent: Server-Sent Events PHP & JQuery Plugin
PHP
6
star
10

phpsls

phpsls is a Secure Login System for any website
PHP
5
star
11

Simple_SEO_PHP

Meta Tags & Social Meta and XML Sitemaps PHP Generator for Search Engines
5
star
12

image_sizer

Resize and save or show png, jpg and gif images using PHP
PHP
3
star
13

localcert

Localcert: A command-line utility to generate self signed certificates for localhost servers. (DO NOT USE IN PRODUCTION)
Shell
2
star
14

promptui

Interactive prompt for command-line applications
Go
1
star
15

submy

Submy: JQuery Validation Forms and Ajax Submit Data
JavaScript
1
star
16

bundler

(WIP) The simplest tool to create installers and bundle GUI apps.
Go
1
star
17

Mysqli_Manager

PHP MySQLi Manager Class : Access MySQL database using MySQLi
PHP
1
star
18

fordelay

Javascript foreach with delay ⌚π’₯
JavaScript
1
star
19

global-laravel-artisan

make laravel artisan command global
PHP
1
star