Skip to content

Golang basic file downloader using Accept-Ranges for parallel downloads to download a file in efficient way with the help of concurrency.

License

Notifications You must be signed in to change notification settings

cdhtlr/GoParallelDownload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoParallelDownload

Golang basic file downloader using Accept-Ranges for parallel downloads to download a file in efficient way with the help of concurrency.

If a URL supports http header - Accept-Ranges, it will be divided into several parts and download it concurrently. Otherwise, the files will still be downloaded but not in parallel

QuickStart

go get -u github.com/cdhtlr/GoParallelDownload

how does it work?

  • Gets head of http response
  • Initializes go routines for partial downloads if range downloads are supported
  • Run them simultaneously until all is Done

Compile command

CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -extldflags=-static" -a -o downloader.exe .

Disclaimer

This program comes with no warranty. You must use this program at your own risk. This program slightly copies the source code from Raviraa Speedtest

Note

  • Using a large number of connections to a single URL can lead to DOS attacks.

Todo

  • Performs memory efficiency without debug.FreeOSMemory()

About

Golang basic file downloader using Accept-Ranges for parallel downloads to download a file in efficient way with the help of concurrency.

Topics

Resources

License

Stars

Watchers

Forks

Languages