Documentation
¶
Index ¶
- func Download(url, outputPath, socks5Url string, newInfoFunc NewInfoFunc) error
- func GenHttpClient(socks5Url string) (*http.Client, error)
- func LoadInfos(statusFilename string) (map[string]*Info, error)
- func NewFileInfos(httpClient *http.Client, url, outpath string, status chan *Info) (map[string]*Info, error)
- func NewM3u8Infos(httpClient *http.Client, m3u8Url, outpath string, status chan *Info) (map[string]*Info, error)
- func ParseM3u8(httpClient *http.Client, m3u8Url, outpath string) ([]map[string]string, error)
- func ReadBody(resp *http.Response, out *os.File, processFb FBFunc) error
- func TaskComsume(httpClient *http.Client, infos map[string]*Info, tasks, status chan *Info, ...)
- func TaskProduce(infos map[string]*Info, tasks, status chan *Info, wg *sync.WaitGroup)
- func TaskStatus(status chan *Info, outputPath string, wg *sync.WaitGroup)
- type DownInfo
- type FBFunc
- type Info
- type NewInfoFunc
- type Speed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Download ¶
func Download(url, outputPath, socks5Url string, newInfoFunc NewInfoFunc) error
func NewFileInfos ¶
func NewM3u8Infos ¶
func ReadBody ¶
type ReadBodyParams struct { chunk_size int64 // = 1024 * 1024 * 10 fsize int64 // = resp.ContentLength buf // = make([]byte, chunk_size) written int64 }
这部分需要修改
func TaskComsume ¶
func TaskProduce ¶
Types ¶
type DownInfo ¶
type Info ¶
type Info struct { Key string `json: key` Url string `json: url` Length int64 `json: length` DownLen int64 `json: downLen` Scale float64 `json: scale` Error string `json: error` Start int64 `json: start` End int64 `json: end` Status int64 `json: status` Output string `json: output` Retry int64 `json: retry` }
type NewInfoFunc ¶
Click to show internal directories.
Click to hide internal directories.