downloader

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aria2Input

type Aria2Input struct {
	// The file name of the downloaded file
	Out string `json:"out"`
	// For a simple download, only add headers
	Header []string `json:"header"`
}

Aria2Input is options for `aria2.addUri` https://aria2.github.io/manual/en/html/aria2c.html#id3

type Aria2RPCData

type Aria2RPCData struct {
	// More info about RPC interface please refer to
	// https://aria2.github.io/manual/en/html/aria2c.html#rpc-interface
	JSONRPC string `json:"jsonrpc"`
	ID      string `json:"id"`
	// For a simple download, only inplemented `addUri`
	Method string `json:"method"`
	// secret, uris, options
	Params [3]interface{} `json:"params"`
}

Aria2RPCData defines the data structure of json RPC 2.0 info for Aria2

type Downloader

type Downloader struct {
	// contains filtered or unexported fields
}

Downloader is the default downloader.

func New

func New(option Options) *Downloader

New returns a new Downloader implementation.

func (*Downloader) Download

func (downloader *Downloader) Download(data *types.Data) error

Download download urls

type FilePartMeta

type FilePartMeta struct {
	Index float32
	Start int64
	End   int64
	Cur   int64
}

FilePartMeta defines the data structure of file meta info.

type Options

type Options struct {
	InfoOnly       bool
	Stream         string
	Refer          string
	OutputPath     string
	OutputName     string
	FileNameLength int
	Caption        bool

	MultiThread  bool
	ThreadNumber int
	RetryTimes   int
	ChunkSizeMB  int
	// Aria2
	UseAria2RPC bool
	Aria2Token  string
	Aria2Method string
	Aria2Addr   string
}

Options defines options used in downloading.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL