Documentation
¶
Index ¶
- Constants
- Variables
- func AesDecrypt(crypted, key []byte, ivs ...[]byte) ([]byte, error)
- func AesEncrypt(origData, key []byte, ivs ...[]byte) ([]byte, error)
- func DrawProgressBar(prefix string, proportion float32, width int, suffix ...string)
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- func Run(c *Config)
- type Config
- type Parser
- type TsInfo
Constants ¶
View Source
const ( // HEAD_TIMEOUT 请求头超时时间 HEAD_TIMEOUT = 10 * time.Second // PROGRESS_WIDTH 进度条长度 PROGRESS_WIDTH = 20 // TS_NAME_TEMPLATE ts视频片段命名规则 TS_NAME_TEMPLATE = "%05d.ts" )
Variables ¶
View Source
var DefaultConfig = &Config{
Url: "",
Num: 16,
Host: "apiv1",
Out: "movie",
Cookie: "",
Safe: 0,
Dir: "",
}
Functions ¶
func DrawProgressBar ¶
进度条
func PKCS7Padding ¶
func PKCS7UnPadding ¶
Types ¶
type Config ¶
type Config struct { // m3u8下载地址(http(s)://url/xx/xx/index.m3u8) Url string // 下载线程数 Num int // 设置getHost的方式(apiv1: `http(s):// + url.Host + filepath.Dir(url.Path)`; apiv2: `http(s)://+ u.Host` Host string // 自定义文件名(默认为movie) Out string // 自定义请求 cookie Cookie string // 是否允许不安全的请求(默认为0) Safe int // 文件保存路径(默认为当前路径) Dir string }
Click to show internal directories.
Click to hide internal directories.