goradiru

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download()

設定ファイル内のProgramsにあるEpisodeをダウンロード

func ListPrograms

func ListPrograms()

Types

type AvailableProgramJSON

type AvailableProgramJSON struct {
	AvailablePrograms []struct {
		SiteID          string `json:"site_id"`
		ProgramName     string `json:"program_name"`
		ProgramNameKana string `json:"program_name_kana"`
		MediaCode       string `json:"media_code"`
		CornerID        string `json:"corner_id"`
		CornerName      string `json:"corner_name"`
		ThumbnailP      string `json:"thumbnail_p"`
		ThumbnailC      string `json:"thumbnail_c"`
		OpenTime        string `json:"open_time"`
		CloseTime       string `json:"close_time"`
		OnairDate       string `json:"onair_date"`
		LinkURL         string `json:"link_url"`
		StartTime       string `json:"start_time"`
		UpdateTime      string `json:"update_time"`
		Dev             string `json:"dev"`
		DetailJSON      string `json:"detail_json"`
	} `json:"data_list"`
}

type ByEpisodeID

type ByEpisodeID DownloadedPrograms

func (ByEpisodeID) Len

func (a ByEpisodeID) Len() int

func (ByEpisodeID) Less

func (a ByEpisodeID) Less(i, j int) bool

func (ByEpisodeID) Swap

func (a ByEpisodeID) Swap(i, j int)

type Config

type Config struct {
	ProgDir                   string `mapstructure:"ProgDir"`
	FileType                  string `mapstructure:"FileType"`
	DownloadedHistoryConfFile string `mapstructure:"DownloadedHistoryConfFile"`
	Programs                  []struct {
		Name string `mapstructure:"Name"`
		URL  string `mapstructure:"Url"`
	} `mapstructure:"Programs"`
}

func GetConfig

func GetConfig() *Config

func LoadConfig

func LoadConfig() *Config

type DownloadedProgram

type DownloadedProgram struct {
	ProgramID    string `yaml:"ProgramID"`
	ProgramTitle string `yaml:"ProgramTitle"`
	EpisodeID    string `yaml:"EpisodeID"`
	EpisodeTitle string `yaml:"EpisodeTitle"`
}

type DownloadedPrograms

type DownloadedPrograms []DownloadedProgram

func LoadDownloadedPrograms

func LoadDownloadedPrograms(downloadedHistoryConfFile string) (dps *DownloadedPrograms)

func (DownloadedPrograms) Save

func (dps DownloadedPrograms) Save() error

type Episode

type Episode struct {
	ID       string    // ID
	Title    string    // エピソード名
	SubTitle string    // サブタイトル
	URL      string    // url
	Station  string    // 放送局 (aa_vinfo2の , より前)
	Start    time.Time // 開始時刻 (aa_vinfo4 の _ より前)
	End      time.Time // 終了時刻 (aa_vinfo4 の _ より後)
	Program  *Program
	Series   *Series
}

Episode シリーズのエピソード(各話)

type Program

type Program struct {
	ID     string   // 番組ID
	Title  string   // 番組名
	Series []Series // シリーズ
}

Program は番組

func CreateProgram

func CreateProgram(programURL string) (program Program, err error)

func (Program) Download

func (p Program) Download(dps *DownloadedPrograms) (err error)

Download program

type ProgramJSON

type ProgramJSON struct {
	Main struct {
		SiteID      string `json:"site_id"`
		ProgramName string `json:"program_name"`
		DetailList  []struct {
			HeadlineID  string `json:"headline_id"`
			Headline    string `json:"headline"`
			HeadlineSub string `json:"headline_sub"`
			FileList    []struct {
				FileID       string `json:"file_id"`
				FileTitle    string `json:"file_title"`
				FileTitleSub string `json:"file_title_sub"`
				FileName     string `json:"file_name"`
				AaVinfo2     string `json:"aa_vinfo2"`
				AaVinfo4     string `json:"aa_vinfo4"`
			} `json:"file_list"`
		} `json:"detail_list"`
	} `json:"main"`
}

ProgramJSON はJSONパース用の型

type Programs

type Programs []Program

Programs は番組の一覧

type Series

type Series struct {
	ID       string    // ID
	Title    string    // シリーズ名
	SubTitle string    // サブタイトル
	Episodes []Episode // エピソード
}

Series は 番組のシリーズ

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL