pulldlr

package
v0.0.0-...-020d709 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONST_BASE_SLICE_FILE_EXT  = ".ts" // 分片文件扩展名
	CONST_BASE_RETRY_MAX_COUNT = 3     // 下载分片文件的最大重试次数
)

Variables

This section is empty.

Functions

func Command

func Command()

func CommandUI

func CommandUI()

func ShowProtocolInfo

func ShowProtocolInfo(url string)

显示协议信息

func ShowProtocolInfoMaster

func ShowProtocolInfoMaster(url string)

Types

type DownloadCacheData

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

func (*DownloadCacheData) Complete

func (cache *DownloadCacheData) Complete(downloadData DownloadData, err error)

完成下载,将下载对象从正在下载队列中移除 如果有错误,暂时放到异常队列中,等待重试

func (*DownloadCacheData) DownloadingLen

func (cache *DownloadCacheData) DownloadingLen() int

func (*DownloadCacheData) ErrorLen

func (cache *DownloadCacheData) ErrorLen() int

func (*DownloadCacheData) Pop

func (cache *DownloadCacheData) Pop() (result DownloadData, err error)

从待下载队列中取出一个下载对象,放到正在下载队列中

func (*DownloadCacheData) Push

func (cache *DownloadCacheData) Push(list []DownloadData)

将需要加载的数据对象,添加到等待下载队列中

func (*DownloadCacheData) ReadyLen

func (cache *DownloadCacheData) ReadyLen() int

type DownloadData

type DownloadData struct {
	Index        int    // 下载资源索引
	Key          string // 下载资源的唯一标示
	Title        string // 文件名
	Url          string // 下载链接
	DownloadPath string // 文件保存路径
	EncryptKey   string // 加密密钥

}

下载文件结构

type Downloader

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

下载器

func New

func New(url string) (result *Downloader, err error)

func (*Downloader) CheckMaster

func (dl *Downloader) CheckMaster() (result protocol.HlsMaster, err error)

func (*Downloader) SetOpts

func (dl *Downloader) SetOpts(opts1 DownloaderOption)

设置参数

func (*Downloader) Start

func (dl *Downloader) Start()

开始下载m3u8文件

type DownloaderOption

type DownloaderOption struct {
	FileName  string // 文件名
	MaxThread int    // 最大下载线程数
}

下载器参数

Jump to

Keyboard shortcuts

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