dler

package module
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: MIT Imports: 16 Imported by: 1

Documentation

Overview

Package godler provides ...

Index

Constants

View Source
const (
	DOWNLOAD_DIR string = "~/Downloads"
)

Variables

View Source
var ErrFileExists = errors.New("文件已存在")
View Source
var (
	LoggerPath string
)
View Source
var Version = "0.7.1"

Functions

func WriteFile

func WriteFile(filePath string, b []byte) error

Types

type FileDownloadTaskInfo

type FileDownloadTaskInfo struct {
	Index      int
	RangeStart int
	RangeEnd   int
	Path       string
}

type FileDownloadTasker

type FileDownloadTasker struct {
	*tasker.Tasker
	// 迁移的地址
	RawURL     string
	URL        *tools.URL
	OutputFunc OutputFunc
	Out        io.Writer
	Request    *Request
	IsNotCover bool
	// contains filtered or unexported fields
}

func NewFileDownloadTasker

func NewFileDownloadTasker(url string) *FileDownloadTasker

func (*FileDownloadTasker) AfterRun

func (d *FileDownloadTasker) AfterRun() error

func (*FileDownloadTasker) BeforeRun

func (d *FileDownloadTasker) BeforeRun() error

func (*FileDownloadTasker) Build

func (d *FileDownloadTasker) Build() error

func (*FileDownloadTasker) BuildTasks

func (d *FileDownloadTasker) BuildTasks() error

func (*FileDownloadTasker) Exec

func (d *FileDownloadTasker) Exec() error

func (*FileDownloadTasker) GetDownloadPath

func (d *FileDownloadTasker) GetDownloadPath() string

获取下载地址

func (*FileDownloadTasker) GetProgress added in v0.7.2

func (d *FileDownloadTasker) GetProgress() (float64, error)

func (FileDownloadTasker) RunTask

func (d FileDownloadTasker) RunTask(task *tasker.Task) error

func (*FileDownloadTasker) SetCacheDir added in v0.7.1

func (d *FileDownloadTasker) SetCacheDir(dir string) *FileDownloadTasker

func (*FileDownloadTasker) SetDownloadDir

func (d *FileDownloadTasker) SetDownloadDir(dir string) *FileDownloadTasker

func (*FileDownloadTasker) SetDownloadPath

func (d *FileDownloadTasker) SetDownloadPath(path string) *FileDownloadTasker

func (*FileDownloadTasker) SetNotCover added in v0.7.1

func (d *FileDownloadTasker) SetNotCover(flag bool) *FileDownloadTasker

func (*FileDownloadTasker) SetProxyURL added in v0.7.2

func (d *FileDownloadTasker) SetProxyURL(url string) *FileDownloadTasker

func (*FileDownloadTasker) SetRequest added in v0.7.2

func (d *FileDownloadTasker) SetRequest(req *Request) *FileDownloadTasker

func (*FileDownloadTasker) SetSegmentSize

func (d *FileDownloadTasker) SetSegmentSize(s int) *FileDownloadTasker

type FilterMediaFunc added in v0.7.2

type FilterMediaFunc func(v []*m3u8.Variant) *m3u8.Variant

定义获取视频源的方法

type IDLTasker added in v0.7.1

type IDLTasker interface {
	Exec() error
}

type M3U8DownloadTaskInfo added in v0.7.1

type M3U8DownloadTaskInfo struct {
	Url  string
	Path string
}

type M3U8DownloadTasker added in v0.7.1

type M3U8DownloadTasker struct {
	*FileDownloadTasker
	// contains filtered or unexported fields
}

func NewM3U8DownloadTasker added in v0.7.1

func NewM3U8DownloadTasker(fdlTasker *FileDownloadTasker) *M3U8DownloadTasker

func (*M3U8DownloadTasker) AddUrlTask added in v0.7.1

func (m *M3U8DownloadTasker) AddUrlTask(uri string)

func (*M3U8DownloadTasker) AfterRun added in v0.7.1

func (d *M3U8DownloadTasker) AfterRun() error

func (*M3U8DownloadTasker) BeforeRun added in v0.7.1

func (m *M3U8DownloadTasker) BeforeRun() error

func (*M3U8DownloadTasker) Build added in v0.7.1

func (m *M3U8DownloadTasker) Build() error

func (*M3U8DownloadTasker) BuildTasks added in v0.7.1

func (m *M3U8DownloadTasker) BuildTasks() error

func (*M3U8DownloadTasker) Exec added in v0.7.1

func (d *M3U8DownloadTasker) Exec() error

func (M3U8DownloadTasker) RunTask added in v0.7.1

func (m M3U8DownloadTasker) RunTask(task *tasker.Task) error

func (*M3U8DownloadTasker) SetFilterMediaFunc added in v0.7.2

func (m *M3U8DownloadTasker) SetFilterMediaFunc(fn FilterMediaFunc) *M3U8DownloadTasker

选择下载地址 只有当给定地址为 playlist 时才会生效

type OutputFunc added in v0.7.1

type OutputFunc func(w io.Writer, out string)

type Request

type Request struct {
	Client *req.Client
	// contains filtered or unexported fields
}

func GetGlobalRequst

func GetGlobalRequst() *Request

func NewRequest

func NewRequest() *Request

func (*Request) EnableVerbose

func (r *Request) EnableVerbose() *Request

func (*Request) GetBytes

func (r *Request) GetBytes(url string) ([]byte, error)

func (*Request) GetBytesByRange

func (r *Request) GetBytesByRange(url string, start, end int) ([]byte, error)

func (*Request) GetReader added in v0.7.2

func (r *Request) GetReader(url string) (io.Reader, error)

func (*Request) Head

func (r *Request) Head(url string) (*req.Response, error)

func (*Request) SetHeader

func (r *Request) SetHeader(key, value string) *Request

func (*Request) SetHeaders

func (r *Request) SetHeaders(hds map[string]string) *Request

Directories

Path Synopsis
cmd
dler
Package main provides ...
Package main provides ...
godler module

Jump to

Keyboard shortcuts

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