An open API service indexing awesome lists of open source software.

https://github.com/cdhtlr/goparalleldownload

Golang basic file downloader using Accept-Ranges for parallel downloads to download a file in efficient way with the help of concurrency.
https://github.com/cdhtlr/goparalleldownload

accept-range concurrency content-length downloader fast golang high-performance high-speed http parallel range-get

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# 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

![](https://raw.githubusercontent.com/cdhtlr/GoParallelDownload/main/Run.png)

## QuickStart

```go
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()