Documentation ¶
Index ¶
- Constants
- func Domain(url string) string
- func FileName(name string) string
- func FilePath(name, ext string, escape bool) (string, error)
- func FileSize(filePath string) (int64, bool, error)
- func GetNameAndExt(uri string) (string, string, error)
- func ItemInSlice(item, list interface{}) bool
- func LimitLength(s string, length int) string
- func M3u8URLs(uri string) ([]string, error)
- func MatchAll(text, pattern string) [][]string
- func MatchOneOf(text string, patterns ...string) []string
- func Md5(text string) string
- func MergeAudioAndVideo(paths []string, mergedFilePath string) error
- func MergeToMP4(paths []string, mergedFilePath string, filename string) error
- func NeedDownloadList(length int) []int
- func PrintVersion()
- func Range(min, max int) []int
- func Reverse(s string) string
- type WaitGroupPool
Constants ¶
const MAXLENGTH = 80
MAXLENGTH Maximum length of file name
Variables ¶
This section is empty.
Functions ¶
func GetNameAndExt ¶
GetNameAndExt return the name and ext of the URL https://img9.bcyimg.com/drawer/15294/post/1799t/1f5a87801a0711e898b12b640777720f.jpg -> 1f5a87801a0711e898b12b640777720f, jpg
func ItemInSlice ¶
func ItemInSlice(item, list interface{}) bool
ItemInSlice if a item is in the list
func LimitLength ¶
LimitLength Handle overly long strings
func MatchOneOf ¶
MatchOneOf match one of the patterns
func MergeAudioAndVideo ¶
MergeAudioAndVideo merge audio and video
func MergeToMP4 ¶
MergeToMP4 merge video parts to MP4
func NeedDownloadList ¶
NeedDownloadList return the indices of playlist that need download
Types ¶
type WaitGroupPool ¶
type WaitGroupPool struct {
// contains filtered or unexported fields
}
WaitGroupPool pool of WaitGroup
func NewWaitGroupPool ¶
func NewWaitGroupPool(size int) *WaitGroupPool
NewWaitGroupPool creates a sized pool for WaitGroup
func (*WaitGroupPool) Add ¶
func (p *WaitGroupPool) Add()
Add increments the WaitGroup counter by one. See sync.WaitGroup documentation for more information.
func (*WaitGroupPool) Done ¶
func (p *WaitGroupPool) Done()
Done decrements the WaitGroup counter by one. See sync.WaitGroup documentation for more information.
func (*WaitGroupPool) Wait ¶
func (p *WaitGroupPool) Wait()
Wait blocks until the WaitGroup counter is zero. See sync.WaitGroup documentation for more information.