Documentation ¶
Index ¶
- func SetConfigRootPath(configRootPath string)
- func SetFullNewSettings(inSettings *Settings) error
- type AdvancedSettings
- type ApiKeySettings
- type AssrtSettings
- type AutoChangeSubEncode
- type ChsChtChanger
- type CommonSettings
- type DeveloperSettings
- type DownloadFileCache
- type EmbySettings
- type ExperimentalFunction
- type ExtendLog
- type LocalChromeSettings
- type OneSupplierSettings
- type ProxySettings
- type RemoteChromeSettings
- type ScanLogic
- type Settings
- type ShareSubSettings
- type SubShareCenter
- type SubtitleBestSettings
- type SubtitleSources
- type SuppliersSettings
- type SysLog
- type TaskQueue
- type TimelineFixerSettings
- type TmdbApiSettings
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetConfigRootPath ¶
func SetConfigRootPath(configRootPath string)
SetConfigRootPath 需要先设置这个信息再调用 Get
func SetFullNewSettings ¶
SetFullNewSettings 从 Web 端传入新的 Settings 完整设置
Types ¶
type AdvancedSettings ¶
type AdvancedSettings struct { ProxySettings *ProxySettings `json:"proxy_settings"` TmdbApiSettings TmdbApiSettings `json:"tmdb_api_settings"` DebugMode bool `json:"debug_mode"` // 是否开启调试模式,这个是写入一个特殊的文件来开启日志的 Debug 输出 SaveFullSeasonTmpSubtitles bool `json:"save_full_season_tmp_subtitles"` // 保存整季的缓存字幕 SubTypePriority int `json:"sub_type_priority"` // 字幕下载的优先级,0 是自动,1 是 srt 优先,2 是 ass/ssa 优先 SubNameFormatter int `json:"sub_name_formatter"` // 字幕命名格式(默认不填写或者超出范围,则为 emby 格式),0,emby 支持的的格式(AAA.chinese(简英,subhd).ass or AAA.chinese(简英,xunlei).default.ass),1常规格式(兼容性更好,AAA.zh.ass or AAA.zh.default.ass) SaveMultiSub bool `json:"save_multi_sub"` // 保存多个网站的 Top 1 字幕 CustomVideoExts []string `json:"custom_video_exts""` // 自定义视频扩展名,是在原有基础上新增。 FixTimeLine bool `json:"fix_time_line"` // 开启校正字幕时间轴,默认 false Topic int `json:"topic"` // 搜索结果的时候,返回 Topic N 以内的 SuppliersSettings *SuppliersSettings `json:"suppliers_settings"` // 每个字幕源的设置 ScanLogic *ScanLogic `json:"scan_logic"` // 扫描的逻辑 TaskQueue *TaskQueue `json:"task_queue"` // 任务队列的设置 DownloadFileCache *DownloadFileCache `json:"download_file_cache"` // 下载文件的缓存 }
func NewAdvancedSettings ¶
func NewAdvancedSettings() *AdvancedSettings
type ApiKeySettings ¶
func NewApiKeySettings ¶
func NewApiKeySettings(enabled bool, key string) *ApiKeySettings
type AssrtSettings ¶
type AutoChangeSubEncode ¶
type AutoChangeSubEncode struct { Enable bool `json:"enable"` DesEncodeType int `json:"des_encode_type"` // 默认 0 是 UTF-8,1 是 GBK }
func (AutoChangeSubEncode) GetDesEncodeType ¶
func (a AutoChangeSubEncode) GetDesEncodeType() string
type ChsChtChanger ¶
type ChsChtChanger struct { Enable bool `json:"enable"` DesChineseLanguageType int `json:"des_chinese_language_type"` // 默认 0 是 简体 ,1 是 繁体 }
func (ChsChtChanger) GetDesChineseLanguageTypeString ¶
func (c ChsChtChanger) GetDesChineseLanguageTypeString() string
type CommonSettings ¶
type CommonSettings struct { IntervalOrAssignOrCustom int `json:"interval_or_assign_or_custom"` // 扫描时间是,使用间隔还是指定时间 ScanInterval string `json:"scan_interval"` // 一轮字幕扫描的间隔 Threads int `json:"threads"` // 同时扫描的并发数 RunScanAtStartUp bool `json:"run_scan_at_start_up"` // 完成引导设置后,下次运行程序就开始扫描 MoviePaths []string `json:"movie_paths"` // 电影的目录 SeriesPaths []string `json:"series_paths"` // 连续剧的目录 LocalStaticFilePort string `json:"local_static_file_port"` // 本地静态文件的端口,取消 }
func NewCommonSettings ¶
func NewCommonSettings() *CommonSettings
type DeveloperSettings ¶
type DeveloperSettings struct { Enable bool `json:"enable"` // 是否启用 BarkServerAddress string `json:"bark_server_address"` // Bark 服务器的地址 }
func NewDeveloperSettings ¶
func NewDeveloperSettings() *DeveloperSettings
type DownloadFileCache ¶
type DownloadFileCache struct { TTL int `json:"ttl" default:"4320"` // 单位需要根据下面的单位转换,默认是小时的单位,然后是半年的过期时间 Unit string `json:"unit" default:"hour"` // second, hour, 目前仅仅支持 秒和小时 }
func NewDownloadFileCache ¶
func NewDownloadFileCache() *DownloadFileCache
func (DownloadFileCache) Check ¶ added in v0.50.1
func (d DownloadFileCache) Check()
type EmbySettings ¶
type EmbySettings struct { Enable bool `json:"enable"` // 是否启用 AddressUrl string `json:"address_url"` // 内网服务器的 url APIKey string `json:"api_key"` // API key MaxRequestVideoNumber int `json:"max_request_video_number"` // 最大请求获取视频的数量 SkipWatched bool `json:"skip_watched"` // 是否跳过已经观看的 MoviePathsMapping map[string]string `json:"movie_paths_mapping"` // 电影目录的映射,一旦 common setting 的目录修改,需要提示用户确认映射 SeriesPathsMapping map[string]string `json:"series_paths_mapping"` // 连续剧目录的映射,一旦 common setting 的目录修改,需要提示用户确认映射 AutoOrManual bool `json:"auto_or_manual"` // 自动或手动模式,自动 IMDB ID 匹配,还是使用手动目录 Threads int `json:"threads"` // 同时扫描的并发数 }
func NewEmbySettings ¶
func NewEmbySettings() *EmbySettings
func (*EmbySettings) Check ¶
func (e *EmbySettings) Check()
type ExperimentalFunction ¶
type ExperimentalFunction struct { AutoChangeSubEncode AutoChangeSubEncode `json:"auto_change_sub_encode"` ChsChtChanger ChsChtChanger `json:"chs_cht_changer"` RemoteChromeSettings RemoteChromeSettings `json:"remote_chrome_settings"` ApiKeySettings ApiKeySettings `json:"api_key_settings"` LocalChromeSettings LocalChromeSettings `json:"local_chrome_settings"` ExtendLog ExtendLog `json:"extend_log"` }
ExperimentalFunction 实验性功能
func NewExperimentalFunction ¶
func NewExperimentalFunction() *ExperimentalFunction
type LocalChromeSettings ¶
type OneSupplierSettings ¶
type OneSupplierSettings struct { Name string `json:"name"` RootUrl string `json:"root_url"` SearchUrl string `json:"search_url"` DailyDownloadLimit int `json:"daily_download_limit" default:"-1"` // -1 是无限制 }
func NewOneSupplierSettings ¶
func NewOneSupplierSettings(name string, rootUrl, searchUrl string, dailyDownloadLimit int) *OneSupplierSettings
func (*OneSupplierSettings) GetSearchUrl ¶
func (s *OneSupplierSettings) GetSearchUrl() string
type ProxySettings ¶
type ProxySettings struct { UseProxy bool `json:"use_proxy"` // 是否使用代理 UseWhichProxyProtocol string `json:"use_which_proxy_protocol"` // 是使用 socks5 还是 http 代理 LocalHttpProxyServerPort string `json:"local_http_proxy_server_port" default:"19036"` // 本地代理服务器端口 InputProxyAddress string `json:"input_proxy_address"` // 输入的代理地址 InputProxyPort string `json:"input_proxy_port"` // 输入的代理端口 NeedPWD bool `json:"need_pwd"` // 是否使用用户名密码 InputProxyUsername string `json:"input_proxy_username"` // 输入的代理用户名 InputProxyPassword string `json:"input_proxy_password"` // 输入的代理密码 Referer string `json:"-"` // 可能下载文件的时候需要设置 }
func NewProxySettings ¶
func (*ProxySettings) CopyOne ¶
func (p *ProxySettings) CopyOne() *ProxySettings
type RemoteChromeSettings ¶
type RemoteChromeSettings struct { Enable bool `json:"enable"` RemoteDockerURL string `json:"remote_docker_url"` // 整个是 go-rod 的远程镜像容器地址 ws://192.168.50.135:9222 RemoteAdblockPath string `json:"remote_adblock_path"` // 注意这个 go-rod 的远程镜像容器对应的目录, ADBlock 需要展开成文件夹 /mnt/share/adblock1_2_3 ReMoteUserDataDir string `json:"remote_user_data_dir"` // 注意这个 go-rod 的远程镜像容器对应的目录,用户缓存文件地址 }
type ScanLogic ¶
type ScanLogic struct { SkipChineseMovie bool `json:"skip_chinese_movie" default:"false"` // 跳过中文的电影 SkipChineseSeries bool `json:"skip_chinese_series" default:"false"` // 跳过中文的连续剧 }
func NewScanLogic ¶
type Settings ¶
type Settings struct { SpeedDevMode bool // 是否为开发模式,代码开启这个会跳过某些流程,加快测试速度 UserInfo *UserInfo `json:"user_info"` CommonSettings *CommonSettings `json:"common_settings"` SubtitleSources *SubtitleSources `json:"subtitle_sources"` AdvancedSettings *AdvancedSettings `json:"advanced_settings"` EmbySettings *EmbySettings `json:"emby_settings"` DeveloperSettings *DeveloperSettings `json:"developer_settings"` TimelineFixerSettings *TimelineFixerSettings `json:"timeline_fixer_settings"` ExperimentalFunction *ExperimentalFunction `json:"experimental_function"` // contains filtered or unexported fields }
func NewSettings ¶
func (*Settings) GetNoPasswordSettings ¶
type ShareSubSettings ¶
type ShareSubSettings struct {
}type SubShareCenter ¶
type SubShareCenter struct {}
func NewSubShareCenter ¶
func NewSubShareCenter(SenderSMTPAddress string, SenderSMTPPort int, InsecureSkipVerify bool, SenderEmailAddress, SenderEmailPwd, ShareCenterEmailAddress string) *SubShareCenter
type SubtitleBestSettings ¶ added in v0.47.0
type SubtitleSources ¶
type SubtitleSources struct { AssrtSettings AssrtSettings `json:"assrt_settings"` SubtitleBestSettings SubtitleBestSettings `json:"subtitle_best_settings"` }
func NewSubtitleSources ¶
func NewSubtitleSources() *SubtitleSources
type SuppliersSettings ¶
type SuppliersSettings struct { Xunlei *OneSupplierSettings `json:"xunlei"` Shooter *OneSupplierSettings `json:"shooter"` Assrt *OneSupplierSettings `json:"assrt"` A4k *OneSupplierSettings `json:"a4k"` SubHD *OneSupplierSettings `json:"subhd"` Zimuku *OneSupplierSettings `json:"zimuku"` SubtitleBest *OneSupplierSettings `json:"subtitle_best"` }
func NewSuppliersSettings ¶
func NewSuppliersSettings() *SuppliersSettings
func (*SuppliersSettings) ReSetSearchUrl ¶ added in v0.53.3
func (s *SuppliersSettings) ReSetSearchUrl()
ReSetSearchUrl 因为 SuppliersSettings 中每个网站的 searchUrl 参数没有开放更改,所以如果有变动,需要重新设置
type TaskQueue ¶
type TaskQueue struct { MaxRetryTimes int `json:"max_retry_times" default:"3"` // 单个任务失败后,最大重试次数,超过后会降一级 OneJobTimeOut int `json:"one_job_time_out" default:"300"` // 单个任务的超时时间 5 * 60 s Interval int `json:"interval" default:"10"` // 任务的间隔,单位 s,这里会有一个限制,不允许太快,然后会做一定的随机时间范围,当前值 x ~ 2*x 之内随机 ExpirationTime int `json:"expiration_time" default:"90"` // 单位天。1. 一个视频的 CreatedTime 在这个时间范围内,都会被下载字幕(除非已经观看跳过启用了)。2. 如果下载失败的任务,AddTime 超过了这个时间,那么就标记为 Failed DownloadSubDuringXDays int `json:"download_sub_during_x_days" default:"7"` // 如果创建了 x 天,且有内置的中文字幕,那么也不进行下载了 OneSubDownloadInterval int `json:"one_sub_download_interval" default:"12"` // 一个字幕下载的间隔(单位 h),不然老是一个循环。对比的基准是 OneJob 的 UpdateTime CheckPublicIPTargetSite string `json:"check_pulic_ip_target_site" default:""` // 检测本机外网 IP 的目标地址,必须是返回直接的 IP 字符串,不需要解析。; 分割 }
func NewTaskQueue ¶
func NewTaskQueue() *TaskQueue
type TimelineFixerSettings ¶
type TimelineFixerSettings struct { MaxOffsetTime int `json:"max_offset_time"` // 最大支持校正时间偏移的范围,单位秒 MinOffset float64 `json:"min_offset"` // 最小的时间片校正偏移,低于这个(正负)就跳过不校正,单位秒 }
func NewTimelineFixerSettings ¶
func NewTimelineFixerSettings() *TimelineFixerSettings
func (*TimelineFixerSettings) Check ¶
func (t *TimelineFixerSettings) Check()
type TmdbApiSettings ¶
type TmdbApiSettings struct { Enable bool `json:"enable"` ApiKey string `json:"api_key"` UseAlternateBaseURL bool `json:"use_alternate_base_url"` }
func NewTmdbApiSettings ¶
func NewTmdbApiSettings(enable bool, apiKey string, useAlternateBaseURL bool) *TmdbApiSettings
Source Files ¶
- advanced_settings.go
- api_key_settings.go
- assrt_settings.go
- auto_change_sub_encode.go
- chs_cht_changer.go
- common_settings.go
- developer_settings.go
- download_file_cache.go
- emby_settings.go
- experimental_function.go
- extend_log.go
- jellyfin_settings.go
- local_chrome_settings.go
- plex_settings.go
- proxy_settings.go
- remote_chrome_settings.go
- scan_logic.go
- settings.go
- share_sub_settings.go
- sub_share_center.go
- subtitle_best.go
- subtitle_sources.go
- supplier_settings.go
- task_queue.go
- timeline_fixer_settings.go
- tmdb_api_settings.go
- user_info.go
Click to show internal directories.
Click to hide internal directories.