radikocast

package module
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: GPL-3.0 Imports: 30 Imported by: 0

README

radikocast

Record radiko programs, and publish your private podcast.

Usage

$ radikocast help                                                                                                                                                                                                               
Usage: radikocast [--version] [--help] <command> [<args>]

Available commands are:
    publish     Publish podcast
    rec         Record a radiko program
    rss         Generate podcast RSS
    rec_schedule    Rec a program by schedule expression.
rec

Record a radiko program.

$ radikocast rec -h
Usage: radikocast rec [options]
  Record a radiko program.
Options:
  -id=name                 Station id
  -start,s=201610101000    Start time
  -area,a=name             Area id
  -bucket=bucketname	   S3 bucket name
rec_schedule

Record a radiko program by schedule expression.

$ radikocast rec_schedule -h
Usage: radikocast rec_schedule [options]
  Record a radiko program.
Options:
  -id=name                 Station id
  -day=wednesday           everyday or weekday, sunday, monday, ..., saturday
  -at=13:00
  -area,a=name             Area id
  -bucket=bucketname	   S3 bucket name
rss

Generate podcast RSS file.

$ radikocast rss -h
Usage: radikocast rss [options]
  Generate podcast RSS
Options:
  -title title
  -host host
  -image image
  -bucket bucket
  -feed feed

Installation

Download binary from release page and place it in $PATH directory.

Requirements
  • ffmpeg

Documentation

Index

Constants

View Source
const (
	AudioFormatM4A = "m4a"
	AudioFormatMP3 = "mp3"
)

Variables

View Source
var Ui cli.Ui

Functions

func BulkDownload

func BulkDownload(list []string, output string) error

func CalcDate added in v0.0.5

func CalcDate(day string, baseTime time.Time) (time.Time, error)

func ConcatAACFiles added in v0.0.7

func ConcatAACFiles(ctx context.Context, input []string, resourcesDir string, output string) error

func ConcatAACFilesAll added in v0.0.7

func ConcatAACFilesAll(ctx context.Context, files []string, resourcesDir string, output string) error

ConcatAACFiles concatenate files of the same type.

func ConcatAACFilesFromList added in v0.0.7

func ConcatAACFilesFromList(ctx context.Context, resourcesDir string) (string, error)

ConcatAACFilesFromList concatenates files from the list of resources.

func GenerateRss

func GenerateRss(title string, host string, image string, bucket string) (*podcast.Podcast, error)

func HashFileMd5

func HashFileMd5(filePath string) (string, error)

func PutRss added in v0.0.5

func PutRss(rss *podcast.Podcast, bucket string, feedName string) error

func RecAndUploadProgram added in v0.0.7

func RecAndUploadProgram(stationID string, start string, areaID string, bucket string, format string) error

func RecCommandFactory

func RecCommandFactory() (cli.Command, error)

func RecProgram

func RecProgram(stationID string, start string, areaID string, format string) error

func RecScheduleCommandFactory added in v0.0.5

func RecScheduleCommandFactory() (cli.Command, error)

func RssCommandFactory

func RssCommandFactory() (cli.Command, error)

func Version

func Version() string

Version returns the app version.

Types

type Converter added in v0.0.7

type Converter interface {
	Convert(ctx context.Context, input, output string) error
}

func NewConverter added in v0.0.7

func NewConverter(format string) (Converter, error)

type ConverterM4A added in v0.0.7

type ConverterM4A struct {
}

func (*ConverterM4A) Convert added in v0.0.7

func (c *ConverterM4A) Convert(ctx context.Context, input, output string) error

type ConverterMP3 added in v0.0.7

type ConverterMP3 struct {
}

func (*ConverterMP3) Convert added in v0.0.7

func (c *ConverterMP3) Convert(ctx context.Context, input, output string) error

type MetaData

type MetaData struct {
	StartAt       time.Time `json:"start_at"`
	Title         string    `json:"title"`
	Desc          string    `json:"desc"`
	StartCode     string    `json:"start_code"`
	URL           string    `json:"url"`
	AudioFilename string    `json:"audio_filename"`
	AudioSize     int64     `json:"audio_size"`
}

func NewMetadata added in v0.0.7

func NewMetadata(pg *radiko.Prog, audioPath string) (*MetaData, error)

MetadataFromProg return metadata from prog

type OutputConfig added in v0.0.7

type OutputConfig struct {
	DirFullPath  string
	FileBaseName string // base name of the file
	FileFormat   string // m4a, mp3
}

OutputConfig contains the configuration for output files.

func NewOutputConfig added in v0.0.7

func NewOutputConfig(fileBaseName, fileFormat string) (*OutputConfig, error)

func (*OutputConfig) AbsPath added in v0.0.7

func (c *OutputConfig) AbsPath() string

func (*OutputConfig) AudioExt added in v0.0.7

func (c *OutputConfig) AudioExt() string

func (*OutputConfig) AudioFormat added in v0.0.7

func (c *OutputConfig) AudioFormat() string

func (*OutputConfig) IsExist added in v0.0.7

func (c *OutputConfig) IsExist() bool

func (*OutputConfig) SetupDir added in v0.0.7

func (c *OutputConfig) SetupDir() error

SetupDir configures the output directory or returns an error if failed to create it.

func (*OutputConfig) TempAACDir added in v0.0.7

func (c *OutputConfig) TempAACDir() (string, error)

type S3 added in v0.0.5

type S3 struct {
	Bucket string
	// contains filtered or unexported fields
}

func NewS3 added in v0.0.5

func NewS3(bucket string) *S3

func (*S3) GetObject added in v0.0.5

func (s *S3) GetObject(o *s3.Object) (*s3.GetObjectOutput, error)

func (*S3) PutObject added in v0.0.5

func (s *S3) PutObject(key string, content io.Reader, contentType string) error

func (*S3) PutObjectFromFile added in v0.0.5

func (s *S3) PutObjectFromFile(filePath string, contentType string) error

func (*S3) Scan added in v0.0.5

func (s *S3) Scan() ([]*s3.Object, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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