Documentation
¶
Index ¶
- Constants
- Variables
- func ReadFromFile(path string) error
- func ServerInternalRequestHost() string
- type Cache
- type Config
- type DlStrategy
- type Emby
- type Initializer
- type LocalTreeGen
- func (ltg *LocalTreeGen) Init() error
- func (ltg *LocalTreeGen) IsIgnore(container string) bool
- func (ltg *LocalTreeGen) IsMusic(container string) bool
- func (ltg *LocalTreeGen) IsStrm(container string) bool
- func (ltg *LocalTreeGen) IsValidPrefix(path string) bool
- func (ltg *LocalTreeGen) IsVirtual(container string) bool
- type Log
- type Openlist
- type Path
- type PeStrategy
- type Ssl
- type Strm
- type VideoPreview
Constants ¶
View Source
const SslDir = "ssl"
SslDir ssl 证书存放目录名称
Variables ¶
View Source
var BasePath string
BasePath 配置文件所在的基础路径
View Source
var DataRoot string
DataRoot 程序数据根目录
Functions ¶
func ServerInternalRequestHost ¶
func ServerInternalRequestHost() string
ServerInternalRequestHost 服务内部自请求 host
Types ¶
type Cache ¶
type Cache struct {
Enable bool `yaml:"enable"` // 是否启用缓存
Expired string `yaml:"expired"` // 缓存过期时间
// contains filtered or unexported fields
}
func (*Cache) ExpiredDuration ¶
type Config ¶
type Config struct {
// Emby emby 相关配置
Emby *Emby `yaml:"emby"`
// Openlist openlist 相关配置
Openlist *Openlist `yaml:"openlist"`
// VideoPreview 网盘转码链接代理配置
VideoPreview *VideoPreview `yaml:"video-preview"`
// Path 路径相关配置
Path *Path `yaml:"path"`
// Cache 缓存相关配置
Cache *Cache `yaml:"cache"`
// Ssl ssl 相关配置
Ssl *Ssl `yaml:"ssl"`
// Log 日志相关配置
Log *Log `yaml:"log"`
}
var C *Config
C 全局唯一配置对象
type DlStrategy ¶
type DlStrategy string
DlStrategy 下载策略类型
const ( DlStrategyOrigin DlStrategy = "origin" // 代理到源服务器 DlStrategyDirect DlStrategy = "direct" // 获取并重定向到直链 DlStrategy403 DlStrategy = "403" // 拒绝响应 )
type Emby ¶
type Emby struct {
// Emby 源服务器地址
Host string `yaml:"host"`
// rclone 或者 cd 的挂载目录
MountPath string `yaml:"mount-path"`
// EpisodesUnplayPrior 在获取剧集列表时是否将未播资源优先展示
EpisodesUnplayPrior bool `yaml:"episodes-unplay-prior"`
// ResortRandomItems 是否对随机的 items 进行重排序
ResortRandomItems bool `yaml:"resort-random-items"`
// ProxyErrorStrategy 代理错误时的处理策略
ProxyErrorStrategy PeStrategy `yaml:"proxy-error-strategy"`
// ImagesQuality 图片质量
ImagesQuality int `yaml:"images-quality"`
// Strm strm 配置
Strm *Strm `yaml:"strm"`
// DownloadStrategy 下载接口响应策略
DownloadStrategy DlStrategy `yaml:"download-strategy"`
// LocalMediaRoot 本地媒体根路径
LocalMediaRoot string `yaml:"local-media-root"`
// DlCacheTime 直链缓存时间
DlCacheTime string `yaml:"dl-cache-time"`
// DlCacheIgnore 直链缓存忽略域名 (支持通配符或关键字)
DlCacheIgnore []string `yaml:"dl-cache-ignore"`
// DlCacheIgnoreMode 直链缓存忽略模式 (blacklist: 黑名单, whitelist: 白名单)
DlCacheIgnoreMode string `yaml:"dl-cache-ignore-mode"`
}
Emby 相关配置
type Initializer ¶
type Initializer interface {
// Init 配置初始化
Init() error
}
type LocalTreeGen ¶
type LocalTreeGen struct {
// Enable 是否启用
Enable bool `yaml:"enable"`
// FFmpegEnable 是否启用 ffmpeg
FFmpegEnable bool `yaml:"ffmpeg-enable"`
// VirtualContainers 虚拟媒体容器, 原始串, 以英文逗号分割
VirtualContainers string `yaml:"virtual-containers"`
// StrmContainers strm 媒体容器, 原始串, 以英文逗号分割
StrmContainers string `yaml:"strm-containers"`
// MusicContainers 音乐媒体容器, 原始串, 以英文逗号分割
MusicContainers string `yaml:"music-containers"`
// AutoRemoveMaxCount 自动删除文件的最大数量
AutoRemoveMaxCount int `yaml:"auto-remove-max-count"`
// RefreshInterval 刷新间隔, 单位: 分钟
RefreshInterval int `yaml:"refresh-interval"`
// ScanPrefixes 指定扫描前缀
ScanPrefixes []string `yaml:"scan-prefixes"`
// IgnoreContainers 忽略指定的容器
IgnoreContainers string `yaml:"ignore-containers"`
// Threads 同步线程数
Threads int `yaml:"threads"`
// contains filtered or unexported fields
}
func (*LocalTreeGen) IsIgnore ¶
func (ltg *LocalTreeGen) IsIgnore(container string) bool
IsIgnore 判断一个容器是否需要被忽略
func (*LocalTreeGen) IsMusic ¶
func (ltg *LocalTreeGen) IsMusic(container string) bool
IsMusic 判断一个容器是否属于音乐容器
func (*LocalTreeGen) IsStrm ¶
func (ltg *LocalTreeGen) IsStrm(container string) bool
IsStrm 判断一个容器是否属于 strm 容器
func (*LocalTreeGen) IsValidPrefix ¶
func (ltg *LocalTreeGen) IsValidPrefix(path string) bool
IsValidPrefix 判断一个 openlist 路径是否在扫描前缀的范围中
func (*LocalTreeGen) IsVirtual ¶
func (ltg *LocalTreeGen) IsVirtual(container string) bool
IsVirtual 判断一个容器是否属于虚拟容器
type Openlist ¶
type Openlist struct {
// Token 访问 openlist 接口的密钥, 在 openlist 管理后台获取
Token string `yaml:"token"`
// Host openlist 访问地址(如果 openlist 使用本地代理模式, 则这个地址必须配置公网可访问地址)
Host string `yaml:"host"`
// LocalTreeGen 本地目录树生成相关
LocalTreeGen *LocalTreeGen `yaml:"local-tree-gen"`
}
type Path ¶
type Path struct {
// Emby2Openlist Emby 的路径前缀映射到 Openlist 的路径前缀, 两个路径使用 : 符号隔开
Emby2Openlist []string `yaml:"emby2openlist"`
// contains filtered or unexported fields
}
type PeStrategy ¶
type PeStrategy string
PeStrategy 代理异常策略类型
const ( PeStrategyOrigin PeStrategy = "origin" // 回源 PeStrategyReject PeStrategy = "reject" // 拒绝请求 )
type Ssl ¶
type Strm ¶
type Strm struct {
// PathMap 远程路径映射
PathMap []string `yaml:"path-map"`
// InternalRedirectEnable 是否启用 strm 内部重定向
InternalRedirectEnable bool `yaml:"internal-redirect-enable"`
// contains filtered or unexported fields
}
Strm strm 配置
type VideoPreview ¶
type VideoPreview struct {
// Enable 是否开启网盘转码链接代理
Enable bool `yaml:"enable"`
// Containers 对哪些容器使用网盘转码链接代理
Containers []string `yaml:"containers"`
// IgnoreTemplateIds 忽略的转码清晰度
IgnoreTemplateIds []string `yaml:"ignore-template-ids"`
// contains filtered or unexported fields
}
func (*VideoPreview) ContainerValid ¶
func (vp *VideoPreview) ContainerValid(container string) bool
ContainerValid 判断某个视频容器是否启用代理
func (*VideoPreview) Init ¶
func (vp *VideoPreview) Init() error
func (*VideoPreview) IsTemplateIgnore ¶
func (vp *VideoPreview) IsTemplateIgnore(templateId string) bool
IsTemplateIgnore 返回一个转码清晰度是否需要被忽略
Click to show internal directories.
Click to hide internal directories.