Documentation ¶
Index ¶
- func FetchData(uri string) ([]byte, error)
- func GetDefaultHttpClient() *http.Client
- func LoadTvBoxData(uri string) ([]byte, error)
- func ParseEPGConfig(r io.Reader) (*epg.EPG, error)
- func ParseM3U8Config(r io.Reader) (m3u.Playlist, error)
- type ArrayMixOpt
- type Config
- type EPGFilterType
- type EPGOpt
- type FlexInt
- type LogOpt
- type M3UOpt
- type MixOpt
- type Source
- type SourceType
- type TvBoxDOH
- type TvBoxLive
- type TvBoxMultiRepoConfig
- type TvBoxMultiRepoOpt
- type TvBoxParse
- type TvBoxRepoConfig
- type TvBoxRepoURLConfig
- type TvBoxRule
- type TvBoxSingleRepoOpt
- type TvBoxSite
- type TvBoxStyle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultHttpClient ¶ added in v1.1.0
func LoadTvBoxData ¶ added in v1.1.0
Types ¶
type ArrayMixOpt ¶
type Config ¶
type Config struct { ServerPort int `mapstructure:"server_port"` // 服务端口, 默认 8080 ExternalURL string `mapstructure:"external_url"` // 外部访问地址, eg. http://localhost:8080 Log LogOpt `mapstructure:"log"` // 日志配置 Sources []Source `mapstructure:"sources"` // 源配置 TvBoxSingleRepoOpt TvBoxSingleRepoOpt `mapstructure:"tvbox_single_repo_opt"` // TvBox单仓源配置 TvBoxMultiRepoOpt TvBoxMultiRepoOpt `mapstructure:"tvbox_multi_repo_opt"` // TvBox多仓源配置 EPGOpt EPGOpt `mapstructure:"epg"` // EPG源配置 M3UOpt M3UOpt `mapstructure:"m3u"` // M3U源配置 }
func DefaultConfig ¶ added in v1.2.0
func DefaultConfig() *Config
func LoadServerConfig ¶
type EPGFilterType ¶ added in v1.1.0
type EPGFilterType string
const ( EPGFilterTypeChannelID EPGFilterType = "channel_id" EPGFilterTypeProgramTitle EPGFilterType = "program_title" )
type EPGOpt ¶ added in v1.1.0
type EPGOpt struct { Disable bool `mapstructure:"disable"` // 是否禁用EPG源 // 过滤频道配置 // 可根据 channel_id 或者 program_title 过滤 // 支持多个源 Filters []ArrayMixOpt `mapstructure:"filters"` }
type FlexInt ¶
type FlexInt int
FlexInt 是一个灵活的整数类型,可以从 JSON 中的数字或字符串解析
func (FlexInt) MarshalJSON ¶
MarshalJSON 实现了 json.Marshaler 接口
func (*FlexInt) UnmarshalJSON ¶
UnmarshalJSON 实现了 json.Unmarshaler 接口
type M3UOpt ¶ added in v1.1.0
type M3UOpt struct { Disable bool `mapstructure:"disable"` // 是否禁用M3U源 MediaPlaylistFallback MixOpt `mapstructure:"media_playlist_fallback"` // 媒体播放列表降级配置 MediaPlaylistFilters []ArrayMixOpt `mapstructure:"media_playlist_filters"` // 媒体播放列表过滤配置 }
type Source ¶
type Source struct { Name string `mapstructure:"name"` // 源名称, 唯一标识, 用来标识用在配置中 URL string `mapstructure:"url"` // 源地址 Type SourceType `mapstructure:"type"` // 源类型 Interval int `mapstructure:"interval"` // 源更新频率,单位为秒, 默认 60 秒 }
type SourceType ¶
type SourceType string
const ( SourceTypeTvBoxSingle SourceType = "tvbox_single" // tvbox单仓源 SourceTypeTvBoxMulti SourceType = "tvbox_multi" // tvbox多仓源 SourceTypeEPG SourceType = "epg" // epg源 SourceTypeM3U SourceType = "m3u" // m3u源 )
type TvBoxMultiRepoConfig ¶ added in v1.1.0
type TvBoxMultiRepoConfig struct {
Repos []TvBoxRepoURLConfig `json:"urls"`
}
func LoadTvBoxMultiRepoConfig ¶ added in v1.1.0
func LoadTvBoxMultiRepoConfig(uri string) (*TvBoxMultiRepoConfig, error)
func ParseTvBoxMultiRepoConfig ¶ added in v1.1.0
func ParseTvBoxMultiRepoConfig(r io.Reader) (*TvBoxMultiRepoConfig, error)
type TvBoxMultiRepoOpt ¶ added in v1.1.0
type TvBoxMultiRepoOpt struct { Disable bool `mapstructure:"disable"` // 是否禁用多仓源 IncludeSingleRepo bool `mapstructure:"include_single_repo"` // 是否包含代理的单仓源 Repos []ArrayMixOpt `mapstructure:"repos"` // 仓库配置 }
type TvBoxParse ¶ added in v1.1.0
type TvBoxRepoConfig ¶ added in v1.1.0
type TvBoxRepoConfig struct { Spider string `json:"spider,omitempty"` Lives []TvBoxLive `json:"lives,omitempty"` Wallpaper string `json:"wallpaper,omitempty"` Sites []TvBoxSite `json:"sites,omitempty"` Parses []TvBoxParse `json:"parses,omitempty"` Flags []string `json:"flags,omitempty"` DOH []TvBoxDOH `json:"doh,omitempty"` Rules []TvBoxRule `json:"rules,omitempty"` Ads []string `json:"ads,omitempty"` Logo string `json:"logo,omitempty"` // 保留原有字段 }
func LoadTvBoxConfig ¶
func LoadTvBoxConfig(uri string) (*TvBoxRepoConfig, error)
func ParseTvBoxConfig ¶
func ParseTvBoxConfig(r io.Reader) (*TvBoxRepoConfig, error)
type TvBoxRepoURLConfig ¶ added in v1.1.0
type TvBoxSingleRepoOpt ¶ added in v1.1.0
type TvBoxSingleRepoOpt struct { Disable bool `mapstructure:"disable"` // 是否禁用单仓源 Spider MixOpt `mapstructure:"spider"` Wallpaper MixOpt `mapstructure:"wallpaper"` Logo MixOpt `mapstructure:"logo"` Sites []ArrayMixOpt `mapstructure:"sites"` DOH []ArrayMixOpt `mapstructure:"doh"` Lives []ArrayMixOpt `mapstructure:"lives"` Parses []ArrayMixOpt `mapstructure:"parses"` Flags []ArrayMixOpt `mapstructure:"flags"` Rules []ArrayMixOpt `mapstructure:"rules"` Ads []ArrayMixOpt `mapstructure:"ads"` Fallback MixOpt `mapstructure:"fallback"` // 降级配置 }
type TvBoxSite ¶ added in v1.1.0
type TvBoxSite struct { Key string `json:"key"` Name string `json:"name"` Type FlexInt `json:"type"` API string `json:"api,omitempty"` Searchable FlexInt `json:"searchable,omitempty"` QuickSearch FlexInt `json:"quickSearch,omitempty"` Filterable FlexInt `json:"filterable,omitempty"` Ext any `json:"ext,omitempty"` Jar string `json:"jar,omitempty"` PlayerType FlexInt `json:"playerType,omitempty"` Changeable FlexInt `json:"changeable,omitempty"` Timeout FlexInt `json:"timeout,omitempty"` }
type TvBoxStyle ¶ added in v1.1.0
Click to show internal directories.
Click to hide internal directories.