alidevhere / go-fast-downloader

Go fast downloader package with concurrency support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go Fast Downloader

NOTE:

This is concurrent downloader is for educational purposes, not to be used in production.

Add package

go get github.com/alidevhere/go-fast-downloader

Example:

Check out examples directory or this example below:

package main

import "github.com/alidevhere/go-fast-downloader"


func main() {
	url := "https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_5MB.mp4"
	options := Options{
		Url:                 url,
		ChunkSizeInBytes:    1024 * 1024 * 5,
		Concurrency:         5,
		Retries:             3,
		OutputFileDirectory: ".",
		OutputFileName:      "output.mp4",
	}

	d, err := NewConcurrentDownloader(options)
	if err != nil {
		println(err.Error())
	}

	err = d.StartDownload()
	if err != nil {
		println(err.Error())
	}
	println(d.DownloadTime().Seconds())
}

About

Go fast downloader package with concurrency support


Languages

Language:Go 100.0%