Documentation
¶
Index ¶
- Constants
- Variables
- type CacheRegexps
- type Color
- type EmbyRegexps
- type FNTVRouterRegexps
- type FliterMode
- func (f FliterMode) MarshalJSON() ([]byte, error)
- func (f FliterMode) MarshalText() ([]byte, error)
- func (f FliterMode) MarshalYAML() (any, error)
- func (f FliterMode) String() string
- func (f *FliterMode) UnmarshalJSON(data []byte) error
- func (f *FliterMode) UnmarshalText(text []byte) error
- func (f *FliterMode) UnmarshalYAML(value *yaml.Node) error
- type JellyfinRegexps
- type JellyfinRouterRegexps
- type MediaServerType
- type OthersRegexps
- type ReferrerPolicy
- type RouterRegexps
- type StrmFileType
Constants ¶
View Source
const ( StatusCode200Color = ColorGreen // HTTP 200 成功响应颜色 StatusCode300Color = ColorGray // HTTP 300 重定向颜色 StatusCode400Color = ColorYellow // HTTP 400 客户端错误颜色 StatusCode500Color = ColorRed // HTTP 500 服务器错误颜色 )
HTTP 状态码对应颜色
View Source
const ( MethodGetColor = ColorBlue // GET 方法颜色 MethodPostColor = ColorCyan // POST 方法颜色 MethodPutColor = ColorYellow // PUT 方法颜色 MethodPatchColor = ColorGreen // PATCH 方法颜色 MethodDeleteColor = ColorRed // DELETE 方法颜色 MethodHeadColor = ColorPurple // HEAD 方法颜色 MethodOptionsColor = ColorGray // OPTIONS 方法颜色 )
HTTP 方法对应颜色
View Source
const LOGO = `` /* 1175-byte string literal not displayed */
Variables ¶
View Source
var EmbyRegexp = &EmbyRegexps{ Router: RouterRegexps{ VideosHandler: regexp.MustCompile(`(?i)^(/emby)?/Videos/\d+/(stream|original)(\.\w+)?$`), ModifyBaseHtmlPlayer: regexp.MustCompile(`(?i)^/web/modules/htmlvideoplayer/basehtmlplayer.js$`), ModifyIndex: regexp.MustCompile(`^/web/index.html$`), ModifyPlaybackInfo: regexp.MustCompile(`(?i)^(/emby)?/Items/\d+/PlaybackInfo$`), ModifySubtitles: regexp.MustCompile(`(?i)^(/emby)?/Videos/\d+/\w+/subtitles$`), }, Others: OthersRegexps{ VideoRedirectReg: regexp.MustCompile(`(?i)^(/emby)?/videos/(.*)/stream/(.*)`), }, Cache: CacheRegexps{ Image: regexp.MustCompile(`(?i)^(/emby)?/Items/\d+/Images(/.*)?$`), Subtitle: regexp.MustCompile(`(?i)/Videos/(.*)/Subtitles/(.*)/Stream\.(ass|ssa|srt|)?$`), }, }
View Source
var FNTVRegexp = &FNTVRouterRegexps{ StreamHandler: regexp.MustCompile(`^/v/api/v1/stream$`), Cache: CacheRegexps{ Image: regexp.MustCompile(`^/v/api/v1/sys/img/[\d\w]{2}/[\d\w]{2}/[\d\w]+\.[\d\w]+$`), Subtitle: regexp.MustCompile(`^/v/api/v1/subtitle/dl/[\d\w]+$`), }, }
View Source
var InvalidMediaServerErr = errors.New("invalid MediaServerType")
View Source
var JellyfinRegexp = &JellyfinRegexps{ Router: JellyfinRouterRegexps{ VideosHandler: regexp.MustCompile(`/Videos/[\w-]+/(stream|original)(\.\w+)?$`), ModifyIndex: regexp.MustCompile(`^/web/$`), ModifyPlaybackInfo: regexp.MustCompile(`^/Items/\w+/PlaybackInfo$`), ModifySubtitles: regexp.MustCompile(`/Videos/\d+/\w+/subtitles$`), }, Cache: CacheRegexps{ Image: regexp.MustCompile(`(?i)/Items/\w+/Images(/.*)?$`), Subtitle: regexp.MustCompile(`(?i)/Videos/(.*)/Subtitles/(.*)/Stream\.(ass|ssa|srt|)?$`), }, }
Functions ¶
This section is empty.
Types ¶
type CacheRegexps ¶
type Color ¶
type Color uint8
const ( ColorBlack Color = iota // 黑色 ColorRed // 红色 ColorGreen // 绿色 ColorYellow // 黄色 ColorBlue // 蓝色 ColorPurple // 紫色 ColorCyan // 青色 ColorGray // 灰色 )
基础颜色枚举
func (Color) ColorBackground ¶
func (Color) ColorString ¶
type EmbyRegexps ¶
type EmbyRegexps struct {
Router RouterRegexps
Others OthersRegexps
Cache CacheRegexps
}
type FNTVRouterRegexps ¶
type FNTVRouterRegexps struct {
StreamHandler *regexp.Regexp
Cache CacheRegexps
}
飞牛影视媒体服务器正则表达式
type FliterMode ¶
type FliterMode uint8
const ( WHITELIST FliterMode = iota BLACKLIST )
func (FliterMode) MarshalJSON ¶
func (f FliterMode) MarshalJSON() ([]byte, error)
func (FliterMode) MarshalText ¶
func (f FliterMode) MarshalText() ([]byte, error)
func (FliterMode) MarshalYAML ¶
func (f FliterMode) MarshalYAML() (any, error)
func (FliterMode) String ¶
func (f FliterMode) String() string
func (*FliterMode) UnmarshalJSON ¶
func (f *FliterMode) UnmarshalJSON(data []byte) error
func (*FliterMode) UnmarshalText ¶
func (f *FliterMode) UnmarshalText(text []byte) error
func (*FliterMode) UnmarshalYAML ¶
func (f *FliterMode) UnmarshalYAML(value *yaml.Node) error
type JellyfinRegexps ¶
type JellyfinRegexps struct {
Router JellyfinRouterRegexps
Cache CacheRegexps
}
type JellyfinRouterRegexps ¶
type MediaServerType ¶
type MediaServerType uint8 // 媒体服务器类型
const ( EMBY MediaServerType = iota // 媒体服务器类型:EmbyServer JELLYFIN // 媒体服务器类型:Jellyfin PLEX // 媒体服务器类型:Plex FNTV // 媒体服务器类型:飞牛影视 )
func (MediaServerType) String ¶
func (m MediaServerType) String() string
func (*MediaServerType) UnMarshalJSON ¶
func (m *MediaServerType) UnMarshalJSON(data []byte) error
func (*MediaServerType) UnmarshalYAML ¶
func (m *MediaServerType) UnmarshalYAML(value *yaml.Node) error
type OthersRegexps ¶
type ReferrerPolicy ¶
type ReferrerPolicy string
ReferrerPolicy 定义 HTTP Referer 策略类型
const ( NoReferrer ReferrerPolicy = "no-referrer" // 不发送 Referer 头部 NoReferrerWhenDowngrade ReferrerPolicy = "no-referrer-when-downgrade" // 从 HTTPS 到 HTTP 时不发送 Origin ReferrerPolicy = "origin" // 跨域发送域名,同域发送完整 URL OriginWhenCrossOrigin ReferrerPolicy = "origin-when-cross-origin" // 跨域仅发送域名 SameOrigin ReferrerPolicy = "same-origin" // 仅同域发送 StrictOrigin ReferrerPolicy = "strict-origin" // HTTPS 到 HTTPS 时发送域名 StrictOriginWhenCrossOrigin ReferrerPolicy = "strict-origin-when-cross-origin" // 跨域发送域名,同域完整 URL(仅 HTTPS) UnsafeURL ReferrerPolicy = "unsafe-url" // 始终发送完整 URL )
type RouterRegexps ¶
type StrmFileType ¶
type StrmFileType uint8 // Strm 文件类型
const ( UnknownStrm StrmFileType = iota HTTPStrm AlistStrm )
func (StrmFileType) String ¶
func (s StrmFileType) String() string
Click to show internal directories.
Click to hide internal directories.