MCPcopy Index your code
hub / github.com/Code-Hex/pget

github.com/Code-Hex/pget @v0.2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.1 ↗ · + Follow
64 symbols 177 edges 13 files 16 documented · 25% updated 2y agov0.2.1 · 2023-09-15★ 1,17611 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Pget - The fastest file download client

.github/workflows/main.yaml codecov Go Report Card GitHub release MIT License

Ad: I'm currently developing a new date and time library synchro for the modern era. please give it ⭐!!

Description

Multi-Connection Download using parallel requests.

  • Fast
  • Resumable
  • Cross-compiled (windows, linux, macOS)

This is an example to download linux kernel. It will be finished between 15s.

pget

Disclaimer

This program comes with no warranty. You must use this program at your own risk.

Note

  • Using a large number of connections to a single URL can lead to DOS attacks.
  • The case is increasing that if you use multiple connections to 1 URL does not increase the download speed with the spread of CDNs.
  • I recommend to use multiple mirrors simultaneously for faster downloads (And the number of connections is 1 for each).

Installation

Homebrew

$ brew install pget

Go

$ go install github.com/Code-Hex/pget/cmd/pget@latest

Synopsis

This example will be used 2 connections per URL.

$ pget -p 2 MIRROR1 MIRROR2 MIRROR3

If you have created such as this file

cat list.txt
MIRROR1
MIRROR2
MIRROR3

You can do this

cat list.txt | pget -p 2

Options

  Options:
  -h,  --help                   print usage and exit
  -p,  --procs <num>            the number of connections for a single URL (default 1)
  -o,  --output <filename>      output file to <filename>
  -t,  --timeout <seconds>      timeout of checking request in seconds
  -u,  --user-agent <agent>     identify as <agent>
  -r,  --referer <referer>      identify as <referer>
  --check-update                check if there is update available
  --trace                       display detail error messages

Pget vs Wget

URL: https://mirror.internet.asn.au/pub/ubuntu/releases/21.10/ubuntu-21.10-desktop-amd64.iso

Using

time wget https://mirror.internet.asn.au/pub/ubuntu/releases/21.10/ubuntu-21.10-desktop-amd64.iso
time pget -p 6 https://mirror.internet.asn.au/pub/ubuntu/releases/21.10/ubuntu-21.10-desktop-amd64.iso

Results

wget   3.92s user 23.52s system 3% cpu 13:35.24 total
pget -p 6   10.54s user 34.52s system 25% cpu 2:56.93 total

wget 13:35.24 total, pget -p 6 2:56.93 total (6x faster)

Binary

You can download from here

Author

codehex

Extension points exported contracts — how you extend this code

DownloadOption (FuncType)
(no doc)
download.go

Core symbols most depended-on inside this repo

New
called by 6
pget.go
Run
called by 6
pget.go
parseOptions
called by 4
pget.go
String
called by 4
download.go
makeIgnoreErr
called by 4
error.go
errTop
called by 3
error.go
getPartialFilePath
called by 3
util.go
usage
called by 3
option.go

Shape

Function 33
Method 16
Struct 13
FuncType 1
Interface 1

Languages

Go100%

Modules by API surface

download.go16 symbols
requests.go9 symbols
error.go7 symbols
util.go6 symbols
pget.go6 symbols
client.go5 symbols
pget_test.go4 symbols
option.go4 symbols
parse_test.go3 symbols
run_test.go2 symbols
error_test.go1 symbols
cmd/pget/main.go1 symbols

For agents

$ claude mcp add pget \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact