Documentation ¶
Index ¶
- Variables
- func ConvertFileTime(info04 string) (*time.Time, error)
- func DownloadEpisode(s PodcastSettings, ep Episode) error
- func DownloadEpisodes(s PodcastSettings, p Program) error
- func DownloadProgramEpisodes(s PodcastSettings, progs []Program) error
- func FileNameToIDAndStarted(filePath string) (*string, *time.Time, error)
- func GeneratePodcast(s PodcastSettings, program Program) (*podcast.Podcast, error)
- func GetAudioFiles(audioDir string, program Program) ([]fs.FileInfo, error)
- func GetAvailablePrograms() (*[]Program, error)
- func GetM3U8URL(url string) (*string, error)
- func GetenvOrDefault(exists, key, defaultVal string) string
- func HandleError(w http.ResponseWriter, err error)
- func HandlePrograms(w http.ResponseWriter, r *http.Request)
- func NewEpisodesFrom(programURL string) (*[]Episode, error)
- func PodcastTitle(s PodcastSettings, program Program) string
- func PreparePodcastRootDir(e Env, programId, cornerId string) (string, error)
- func SetupDir(dirs []string) error
- func SetupLogOutput(e Env) error
- func StartScheduler(e Env) error
- func StartServer(e Env) error
- func UpdatePodcast(s PodcastSettings, programs *[]Program) error
- func UpdatePodcasts(e Env) error
- func WritePodcastFile(s PodcastSettings, program Program) error
- type Conf
- type Env
- type Episode
- func (e *Episode) AudioFile(destDir string) string
- func (e *Episode) ConvertToAudioFile(workDir, destDir string) (string, error)
- func (e *Episode) DeleteAudioFile(destDir string) error
- func (e *Episode) DeleteTSFile(workDir string) error
- func (e *Episode) Download(workDir, destDir string) error
- func (e *Episode) DownloadTS(workDir string) error
- func (e *Episode) Exists(destDir string) bool
- func (e *Episode) GetTSRawFileDir(workDir string) string
- func (e *Episode) GetTSRawFilePath(workDir string) string
- func (e *Episode) RecoverTSPanic() error
- func (e *Episode) WriteTag(destDir string) error
- type PodcastSettings
- type Program
- type ProgramDetailJson
- type TimeTableJson
Constants ¶
This section is empty.
Variables ¶
View Source
var Encoding = ".aac"
View Source
var Pubdate = time.Date(2011, 9, 1, 0, 0, 0, 0, time.UTC)
View Source
var TFormat = "200601021504"
View Source
var TFormatZone = TFormat + "-0700"
Functions ¶
func DownloadEpisode ¶
func DownloadEpisode(s PodcastSettings, ep Episode) error
func DownloadEpisodes ¶
func DownloadEpisodes(s PodcastSettings, p Program) error
func DownloadProgramEpisodes ¶
func DownloadProgramEpisodes(s PodcastSettings, progs []Program) error
func FileNameToIDAndStarted ¶
func GeneratePodcast ¶
func GeneratePodcast(s PodcastSettings, program Program) (*podcast.Podcast, error)
func GetAvailablePrograms ¶
func GetM3U8URL ¶
func GetenvOrDefault ¶
func HandleError ¶
func HandleError(w http.ResponseWriter, err error)
func HandlePrograms ¶
func HandlePrograms(w http.ResponseWriter, r *http.Request)
func NewEpisodesFrom ¶
func PodcastTitle ¶
func PodcastTitle(s PodcastSettings, program Program) string
func PreparePodcastRootDir ¶
func SetupLogOutput ¶
func StartScheduler ¶
func StartServer ¶
func UpdatePodcast ¶
func UpdatePodcast(s PodcastSettings, programs *[]Program) error
func UpdatePodcasts ¶
func WritePodcastFile ¶
func WritePodcastFile(s PodcastSettings, program Program) error
Types ¶
type Conf ¶
type Env ¶
type Env struct { Schedule string //cron format LogFile string AssetsDir string AudioDir string WorkDir string ConfPath string Port string Host string Https bool BaseURL string }
func (*Env) InitBaseURl ¶
func (e *Env) InitBaseURl()
type Episode ¶
type Episode struct { ID string M3u8Url string Started time.Time Program string Title string Description string FilePath string Size int64 }
func (*Episode) ConvertToAudioFile ¶
func (*Episode) DeleteAudioFile ¶
func (*Episode) DeleteTSFile ¶
func (*Episode) DownloadTS ¶
func (*Episode) GetTSRawFileDir ¶
func (*Episode) GetTSRawFilePath ¶
func (*Episode) RecoverTSPanic ¶
type PodcastSettings ¶
type Program ¶
type ProgramDetailJson ¶
type ProgramDetailJson struct { Main struct { SiteID string `json:"site_id"` ProgramTitle string `json:"program_name"` CornerID string `json:"corner_id"` CornerTitle string `json:"corner_name"` DetailList []struct { FileList []struct { FileID string `json:"file_id"` FileTitle string `json:"file_title"` FileTitleSub string `json:"file_title_sub"` FileName string `json:"file_name"` AAVInfo1 string `json:"aa_vinfo1"` AAVInfo4 string `json:"aa_vinfo4"` } `json:"file_list"` } `json:"detail_list"` } `json:"main"` }
type TimeTableJson ¶
type TimeTableJson struct { DataList []struct { SiteID string `json:"site_id"` ProgramName string `json:"program_name"` DetailJson string `json:"detail_json"` CornerID string `json:"corner_id"` CornerName string `json:"corner_name"` ThumbnailP string `json:"thumbnail_p"` } `json:"data_list"` }
func GetTimeTable ¶
func GetTimeTable() (*TimeTableJson, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.