Documentation ¶
Index ¶
- Constants
- Variables
- func DownloadFile(url, path string, limit int64, headers map[string]string) error
- func DownloadFileMultiThreading(url, path string, limit int64, threadCount int, headers map[string]string) error
- func EncodeMP4(src string, dst string) error
- func EncoderSilk(data []byte) ([]byte, error)
- func EnsureBool(p interface{}, defaultVal bool) bool
- func ExtractCover(src string, target string) error
- func FindFile(file, cache, PATH string) (data []byte, err error)
- func GetBytes(url string) ([]byte, error)
- func GetSliderTicket(raw, id string) (string, error)
- func InitCodec()
- func IsAMRorSILK(b []byte) bool
- func NeteaseMusicSongInfo(id string) (gjson.Result, error)
- func PathExists(path string) bool
- func QQMusicSongInfo(id string) (gjson.Result, error)
- func ReadAllText(path string) string
- func SplitURL(s string) []string
Constants ¶
View Source
const ( //ImagePath go-cqhttp使用的图片缓存目录 ImagePath = "data/images" //ImagePathOld 兼容旧版go-cqhtto使用的图片缓存目录 ImagePathOld = "data/image" //VoicePath go-cqhttp使用的语音缓存目录 VoicePath = "data/voices" //VoicePathOld 兼容旧版go-cqhtto使用的语音缓存目录 VoicePathOld = "data/record" //VideoPath go-cqhttp使用的视频缓存目录 VideoPath = "data/videos" //CachePath go-cqhttp使用的缓存目录 CachePath = "data/cache" )
Variables ¶
View Source
var ( //ErrSyntax Path语法错误时返回的错误 ErrSyntax = errors.New("syntax error") //HeaderAmr AMR文件头 HeaderAmr = []byte("#!AMR") //HeaderSilk Silkv3文件头 HeaderSilk = []byte("\x02#!SILK_V3") )
View Source
var ( //Proxy 存储Config.proxy_rewrite,用于设置代理 Proxy string //ErrOverSize 响应主体过大时返回此错误 ErrOverSize = errors.New("oversize") //UserAgent HTTP请求时使用的UA UserAgent = "" /* 130-byte string literal not displayed */ )
Functions ¶
func DownloadFile ¶
DownloadFile 将给定URL对应的文件下载至给定Path
func DownloadFileMultiThreading ¶
func DownloadFileMultiThreading(url, path string, limit int64, threadCount int, headers map[string]string) error
DownloadFileMultiThreading 使用threadCount个线程将给定URL对应的文件下载至给定Path
func EnsureBool ¶
EnsureBool 判断给定的p是否可表示为合法Bool类型,否则返回defaultVal
支持的合法类型有
type bool
type gjson.True or gjson.False
type string "true","yes","1" or "false","no","0" (case insensitive)
func FindFile ¶
FindFile 从给定的File寻找文件,并返回文件byte数组。File是一个合法的URL。Path为文件寻找位置。 对于HTTP/HTTPS形式的URL,Cache为"1"或空时表示启用缓存
func GetSliderTicket ¶
GetSliderTicket 通过给定的验证链接raw和id,获取验证结果Ticket
func NeteaseMusicSongInfo ¶
NeteaseMusicSongInfo 通过给定id在wdd音乐上查找曲目信息
func QQMusicSongInfo ¶
QQMusicSongInfo 通过给定id在QQ音乐上查找曲目信息
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.