Documentation ¶
Index ¶
- Constants
- Variables
- func CheckRecorder() error
- func FetchDocument(url string) (*goquery.Document, error)
- func LoadConfigFromFile(path string, config *Config) error
- func LoadStreamsFromFile(path string, streams *map[string]string) error
- func RecordVideo(stream, output string, duration time.Duration) error
- func SetupLogging(debug, json bool)
- func WatchStreams() error
- type Config
- type EpgEntry
- type Station
- type StationController
Constants ¶
View Source
const ( // EpgURL contains the query url for the epg informations // %s is the placeholder for the date in the format YYYY-MM-dd EpgURL = "https://www.zdf.de/live-tv?airtimeDate=%s" // EpgDescriptionURL is the base path to the show description EpgDescriptionURL = "https://www.zdf.de%s" )
View Source
const (
// RecorderBinary contains the name of the ffmpeg binary
RecorderBinary = "ffmpeg"
)
View Source
const (
// Version contains the version of the thek tool
Version = "0.6.1"
)
Variables ¶
View Source
var ( // ConfigPath is the path to the config file to use ConfigPath string // EnableDebugging enables debugging EnableDebugging bool // EnableJSON enables json output EnableJSON bool // PrintVersion enables the version printing PrintVersion bool )
View Source
var DateFormat = "2006-01-02"
DateFormat is the used format...douh
View Source
var Streams map[string]string
Streams contains the available streams
Functions ¶
func CheckRecorder ¶
func CheckRecorder() error
CheckRecorder checks if the Recorder binary is available
func FetchDocument ¶
FetchDocument fetches the website and returns a goquery Document
func LoadConfigFromFile ¶
LoadConfigFromFile loads the schedule plan from a file
func LoadStreamsFromFile ¶
LoadStreamsFromFile loads the streams from the given file
func RecordVideo ¶
RecordVideo records the given stream for the given duration and saves it to the given output
Types ¶
type Config ¶
type Config struct { // Defaults contains all the default values which can be overwritten in other places Defaults struct { // DefaultOutputDir is the place where the videos will be saved to DefaultOutputDir string `yaml:"output_directory"` // DefaultSafetyDuration is the time before and after a video DefaultSafetyDuration string `yaml:"safety_duration"` // DefaultFileExistAction is the action in case a file already exist DefaultFileExistAction string `yaml:"file_exist_action"` } `yaml:"defaults"` // StationURLS is a station to stream mapping StationURLS map[string]string `yaml:"stations"` // RecorderSchedule contains all the recording tasks RecordingTasks []struct { // Station is the tv station to follow Station string `yaml:"station,omitempty"` // ShowKeywords are the words to look out for (all must match) ShowKeywords string `yaml:"show_keywords"` // SafetyDuration overwrites Defaults.DefaultSafetyDuration SafetyDuration string `yaml:"safety_duration,omitempty"` // OutputDir overwrites Defaults.DefaultOutputDir OutputDir string `yaml:"output_directory,omitempty"` // FileExistAction overwrites Defaults.DefaultFileExistAction FileExistAction string `yaml:"file_exist_action"` } `yaml:"recording_tasks"` }
Config represents the config structure
var CurrentConfig Config
CurrentConfig is the current config...
type StationController ¶
type StationController struct {
Stations []*Station
}
StationController holds the station array
func (*StationController) UpdateStationsByDates ¶
func (sc *StationController) UpdateStationsByDates(date []time.Time) error
UpdateStationsByDates updates the stations with data from the given dates
Source Files ¶
Click to show internal directories.
Click to hide internal directories.