Skip to content
This repository was archived by the owner on Aug 6, 2024. It is now read-only.

linlichieh/golang-parallel-download-with-accept-ranges

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

About

This is an example to show you how to download a file in efficient way.

If a URL supports http header - Accept-Ranges, it will be divided into several parts and download it concurrently.

Run

Download a file with 5 connections (default: 5)

./golang-parallel-download-with-accept-ranges

File name with timestamp

./golang-parallel-download-with-accept-ranges -t

Specify the connection count

./golang-parallel-download-with-accept-ranges -c=7

Dependencies

pb - show multiple progress bar

go get github.com/cheggaaa/pb

Compile command

mac

GOOS=darwin GOARCH=amd64 go build -o download.command

windows

GOOS=windows GOARCH=amd64 go build -o download.exe

FIXME

  • File's body download on windows is different from one on mac. (e.g. mp4)

TODO

  • Support request header

About

Parallel download with Accept-Ranges in golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages