Documentation ¶
Index ¶
- Constants
- func AESIv16() string
- func AESKey16() string
- func AdblockTmpFolder() string
- func AddBaseUrl(baseUrl, url string) string
- func AppVersion() string
- func AppVersionInt() (int, int, int)
- func BaseKey() string
- func Bool2Int(inBool bool) int
- func BytesToInt(b []byte) (int, error)
- func ClearFolder(folderFullPath string) error
- func ClearIdleSubFixCacheFolder(l *logrus.Logger, rootSubFixCacheFolder string, outOfDate time.Duration) error
- func ClearManualSubUploadCacheFolder() error
- func ClearPluginFolderByName(folderName string) error
- func ClearRodTmpRootFolder() error
- func ClearRootTmpFolder() error
- func ClearShareSubFolderByYear(year int) error
- func ClearShareSubFolderByYearAndName(year int, name string) error
- func ClearTmpFolderByName(folderName string) error
- func ClearVideoAndSubPreviewCacheFolder() error
- func CloseChrome(l *logrus.Logger)
- func ConfigRootDirFPath() string
- func CopyDir(src string, dst string) error
- func CopyFile(src, dst string) error
- func CopyFiles2DebugFolder(names []string, subFiles []string) error
- func DefDebugFolder() string
- func DefRodTmpRootFolder() string
- func DefSubFixCacheFolder() string
- func DefTmpFolder() string
- func DownFile(l *logrus.Logger, urlStr string) ([]byte, string, error)
- func ExtEnCode() string
- func FileNameIsBDMV(id_bdmv_fileFPath string) (bool, string)
- func FixWindowPathBackSlash(path string) string
- func GenerateAccessToken() string
- func Get2UUID() string
- func GetConfigRootDirFPath() string
- func GetDebugFolderByName(names []string) (string, error)
- func GetEpisodeKeyName(season, eps int, zerofill ...bool) string
- func GetFileName(l *logrus.Logger, resp *http.Response) string
- func GetFileSHA1(srcFileFPath string) (string, error)
- func GetFileSHA1String(fileFPath string) (string, error)
- func GetFileSHA256String(fileFPath string) (string, error)
- func GetManualSubUploadCacheFolder() (string, error)
- func GetMaxSizeFile(path string) string
- func GetNowTimeString() (string, int, int, int)
- func GetPluginFolderByName(folderName string) (string, error)
- func GetPluginRootFolder() (string, error)
- func GetPublicIP(log *logrus.Logger, queue *settings.TaskQueue) string
- func GetRestOfDaySec() time.Duration
- func GetRodTmpRootFolder() (string, error)
- func GetRootCacheCenterFolder() (string, error)
- func GetRootDebugFolder() (string, error)
- func GetRootSubFixCacheFolder() (string, error)
- func GetRootTmpFolder() (string, error)
- func GetShareFolderByYear(year int) (string, error)
- func GetShareSubRootFolder() (string, error)
- func GetSubFixCacheFolderByName(folderName string) (string, error)
- func GetTmpFolderByName(folderName string) (string, error)
- func GetVideoAndSubPreviewCacheFolder() (string, error)
- func IntToBytes(n int) ([]byte, error)
- func IsDir(path string) bool
- func IsEqual(f1, f2 float64) bool
- func IsFile(filePath string) bool
- func IsWantedVideoExtDef(fileName string) bool
- func LinuxConfigPathInSelfPath() string
- func LiteMode() bool
- func MakeCeil10msMultipleFromFloat(input float64) float64
- func MakeCeil10msMultipleFromTime(input time.Time) time.Time
- func MakeFloor10msMultipleFromFloat(input float64) float64
- func MakeFloor10msMultipleFromTime(input time.Time) time.Time
- func MakePowerOfTwo(x int64) int64
- func NewHttpClient(referer ...string) (*resty.Client, error)
- func OSCheck() bool
- func ParseTime(inTime string) (time.Time, error)
- func PrintPanicStack(log *logrus.Logger)
- func RandStringBytesMaskImprSrcSB(n int) string
- func RandomSecondDuration(min, max int32) time.Duration
- func ReadCustomAuthFile(log *logrus.Logger) bool
- func ReadCustomPortFile(log *logrus.Logger) int
- func ReplaceSpecString(inString string, rep string) string
- func ResetWantedVideoExt()
- func Round(x float64) int64
- func Second2Time(sec int64) time.Time
- func SetAESIv16(aESIv16 string)
- func SetAESKey16(aESKey16 string)
- func SetAppVersion(appVersion string)
- func SetBaseKey(baseKey string)
- func SetExtEnCode(extEnCode string)
- func SetLinuxConfigPathInSelfPath(setPath string)
- func SetLiteMode(liteMode bool)
- func Time2Duration(inTime time.Time) time.Duration
- func Time2SecondNumber(inTime time.Time) float64
- func Time2SubTimeString(inTime time.Time, timeFormat string) string
- func TimeNumber2Time(inputTimeNumber float64) time.Time
- func UrlJoin(hostUrl, subUrl string) (string, error)
- func WriteFile(desFileFPath string, bytes []byte) error
- func WriteStrings2File(desfilePath string, strings []string) error
Constants ¶
const ( TmpFolder = "tmp" // 临时缓存的文件夹 RodCacheFolder = "rod" // rod 的缓存目录 PluginFolder = "Plugin" // 插件的目录 DebugFolder = "CSF-DebugThings" // 调试相关的文件夹 SubFixCacheFolder = "CSF-SubFixCache" // 字幕时间校正的缓存文件夹,一般可以不清理 CacheCenterFolder = "CSF-CacheCenter" // 下载缓存、队列缓存、下载次数缓存的文件夹 ManualSubUploadCacheFolder = "CSF-ManualSubUploadCache" // 手动上传字幕的缓存文件夹 VideoAndSubPreviewCacheFolder = "CSF-VideoAndSubPreviewCache" // 视频和字幕的预览缓存 )
缓存文件的位置信息,都是在程序的根目录下的 cache 中
const (
Plugin_Adblock = "adblock"
)
Variables ¶
This section is empty.
Functions ¶
func AdblockTmpFolder ¶
func AdblockTmpFolder() string
func AppVersion ¶
func AppVersion() string
func AppVersionInt ¶
func ClearIdleSubFixCacheFolder ¶
func ClearIdleSubFixCacheFolder(l *logrus.Logger, rootSubFixCacheFolder string, outOfDate time.Duration) error
ClearIdleSubFixCacheFolder 清理闲置的字幕修正缓存文件夹
func ClearManualSubUploadCacheFolder ¶
func ClearManualSubUploadCacheFolder() error
ClearManualSubUploadCacheFolder 清理手动上传字幕的缓存文件夹
func ClearPluginFolderByName ¶
ClearPluginFolderByName 清理指定的缓存文件夹
func ClearShareSubFolderByYear ¶
ClearShareSubFolderByYear 清理指定的缓存文件夹
func ClearShareSubFolderByYearAndName ¶
ClearShareSubFolderByYearAndName 清理指定的缓存文件夹
func ClearTmpFolderByName ¶
ClearTmpFolderByName 清理指定的缓存文件夹
func ClearVideoAndSubPreviewCacheFolder ¶
func ClearVideoAndSubPreviewCacheFolder() error
ClearVideoAndSubPreviewCacheFolder 清理视频和字幕的预览缓存
func ConfigRootDirFPath ¶
func ConfigRootDirFPath() string
ConfigRootDirFPath ---------------------------------------------
func CopyFiles2DebugFolder ¶
CopyFiles2DebugFolder 把文件放入到 Debug 文件夹中,新建 desFolderName 文件夹
func DefDebugFolder ¶
func DefDebugFolder() string
func DefRodTmpRootFolder ¶
func DefRodTmpRootFolder() string
func DefSubFixCacheFolder ¶
func DefSubFixCacheFolder() string
func DefTmpFolder ¶
func DefTmpFolder() string
func FileNameIsBDMV ¶
FileNameIsBDMV 是否是 BDMV 蓝光目录,符合返回 true,以及 fakseVideoFPath
func FixWindowPathBackSlash ¶
FixWindowPathBackSlash 修复 Windows 反斜杠的梗
func GetConfigRootDirFPath ¶
func GetConfigRootDirFPath() string
GetConfigRootDirFPath 获取 Config 的根目录,不同系统不一样
func GetDebugFolderByName ¶
GetDebugFolderByName 根据传入的 strings (["aa", "bb"]) 组成 DebugFolder/aa/bb 这样的路径
func GetEpisodeKeyName ¶
func GetFileName ¶
GetFileName 获取下载文件的文件名
func GetFileSHA1String ¶
GetFileSHA1String 获取文件的 SHA1 字符串
func GetFileSHA256String ¶
GetFileSHA256String 获取文件的 SHA256 字符串
func GetManualSubUploadCacheFolder ¶
GetManualSubUploadCacheFolder 手动上传字幕的缓存文件夹
func GetMaxSizeFile ¶
func GetNowTimeString ¶
GetNowTimeString 获取当前的时间,没有秒
func GetPluginFolderByName ¶
GetPluginFolderByName 获取缓存的文件夹,没有则新建
func GetPluginRootFolder ¶
GetPluginRootFolder 在程序的根目录新建,取缓用文件夹,每一个视频的缓存将在其中额外新建子集文件夹
func GetRestOfDaySec ¶
func GetRodTmpRootFolder ¶
GetRodTmpRootFolder 在程序的根目录新建,rod 缓存用文件夹
func GetRootCacheCenterFolder ¶
GetRootCacheCenterFolder 下载缓存、队列缓存、下载次数缓存的文件夹
func GetRootDebugFolder ¶
GetRootDebugFolder 在程序的根目录新建,调试用文件夹
func GetRootSubFixCacheFolder ¶
GetRootSubFixCacheFolder 在程序的根目录新建,字幕时间校正的缓存文件夹
func GetRootTmpFolder ¶
GetRootTmpFolder 在程序的根目录新建,取缓用文件夹,每一个视频的缓存将在其中额外新建子集文件夹
func GetShareFolderByYear ¶
GetShareFolderByYear 缓存的文件夹以发行的年为一个单位存储
func GetShareSubRootFolder ¶
GetShareSubRootFolder 在程序的根目录新建,字幕共享的缓存根目录,下级还有具体是按发行的时间去划分的子集目录
func GetSubFixCacheFolderByName ¶
GetSubFixCacheFolderByName 获取缓存的文件夹,没有则新建
func GetTmpFolderByName ¶
GetTmpFolderByName 获取缓存的文件夹,没有则新建
func GetVideoAndSubPreviewCacheFolder ¶
GetVideoAndSubPreviewCacheFolder 视频和字幕的预览缓存
func IsWantedVideoExtDef ¶
IsWantedVideoExtDef 后缀名是否符合规则
func LinuxConfigPathInSelfPath ¶
func LinuxConfigPathInSelfPath() string
LinuxConfigPathInSelfPath --------------------------------------------- 针对制作群晖的 SPK 应用,无法写入默认的 /config 目录而给出的新的编译条件,直接指向这个目录到当前程序的目录
func MakeCeil10msMultipleFromFloat ¶
MakeCeil10msMultipleFromFloat 将传入的秒,规整到 10ms 的倍数,返回依然是 秒,向上取整
func MakeCeil10msMultipleFromTime ¶
MakeCeil10msMultipleFromTime 向上取整,规整到 10ms 的倍数
func MakeFloor10msMultipleFromFloat ¶
MakeFloor10msMultipleFromFloat 将传入的秒,规整到 10ms 的倍数,返回依然是 秒,向下取整
func MakeFloor10msMultipleFromTime ¶
MakeFloor10msMultipleFromTime 向下取整,规整到 10ms 的倍数
func MakePowerOfTwo ¶
MakePowerOfTwo 2的整次幂数 buffer length is not a power of two
func NewHttpClient ¶
NewHttpClient 新建一个 resty 的对象
func PrintPanicStack ¶
func RandomSecondDuration ¶
func ReadCustomAuthFile ¶
func ReadCustomPortFile ¶
func ReplaceSpecString ¶
ReplaceSpecString 替换特殊的字符
func Second2Time ¶
func SetAESIv16 ¶
func SetAESIv16(aESIv16 string)
SetAESIv16 ---------------------------------------------
func SetAESKey16 ¶
func SetAESKey16(aESKey16 string)
SetAESKey16 ---------------------------------------------
func SetAppVersion ¶
func SetAppVersion(appVersion string)
SetAppVersion ---------------------------------------------
func SetBaseKey ¶
func SetBaseKey(baseKey string)
SetBaseKey ---------------------------------------------
func SetExtEnCode ¶
func SetExtEnCode(extEnCode string)
SetExtEnCode ---------------------------------------------
func SetLinuxConfigPathInSelfPath ¶
func SetLinuxConfigPathInSelfPath(setPath string)
func SetLiteMode ¶
func SetLiteMode(liteMode bool)
func Time2SecondNumber ¶
func Time2SubTimeString ¶
Time2SubTimeString 时间转字幕格式的时间字符串
func TimeNumber2Time ¶
func WriteStrings2File ¶
Types ¶
This section is empty.