radigo

package module
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: GPL-3.0 Imports: 15 Imported by: 5

README

radigo

Record the radiko.jp program.

godoc go report CircleCI

Docker Stars Docker Build Status Docker Automated build

Please do not use this project for commercial use. Only for your personal, non-commercial use.
個人での視聴の目的以外で利用しないでください.

Installation

Docker images
$ docker pull yyoshiki41/radigo

You can launch a radigo container and exec radigo command.

# Mount the volume `"$PWD"/output`(default output path) into `/output` in the container
$ docker run -it \
    -v "$(pwd)"/output:/output \
    yyoshiki41/radigo rec -id=LFR -s=20180401010000
Now downloading..
/
+------------+---------------------------------+
| STATION ID |              TITLE              |
+------------+---------------------------------+
| LFR        |    オードリーのオールナイトニッポン              |
+------------+---------------------------------+
| Completed!
/output/20180401010000-LFR.aac

Open the output file created by the container on your local machine.

$ open $PWD/output/20180401010000-LFR.aac
Build the binary from source

・Go 1.11 or higher

$ make installdeps
$ make build
$ radigo help

Or release binaries are available on the releases page.

Requirements
  • ffmpeg
Build docker image from source
$ make docker-build
$ docker run -it yyoshiki41/radigo help

Usage

$ radigo help
usage: radigo [--version] [--help] <command> [<args>]

Available commands are:
    area           Get available station ids
    browse         Browse radiko.jp
    browse-live    Browse radiko.jp live
    rec            Record a radiko program
    rec-live       Record a live program
■ area
$ radigo area
Area ID: JP13
+----------------------+----------------+
|         NAME         |   STATION ID   |
+----------------------+----------------+
| TBSラジオ               | TBS            |
| 文化放送                             | QRR            |
| ニッポン放送            | LFR            |
| ラジオNIKKEI第1        | RN1            |
| ラジオNIKKEI第2        | RN2            |
| interfm              | INT            |
| TOKYO FM             | FMT            |
| J-WAVE               | FMJ            |
| ラジオ日本                           | JORF           |
| bayfm78              | BAYFM78        |
| NACK5                | NACK5          |
| FMヨコハマ                          | YFM            |
| LuckyFM 茨城放送             | IBS            |
| 放送大学                             | HOUSOU-DAIGAKU |
| NHKラジオ第1(東京)            | JOAK           |
| NHK-FM(東京)                    | JOAK-FM        |
+----------------------+----------------+
Note

Area ID is ISO 3166-2 code that is defined for 47 prefectures.

c.f. ISO 3166-2:JP - Wikipedia

■ rec

Record the program using the timefree.

$ radigo rec -id=LFR -s=20161126010000
Now downloading..
+------------+---------------------------------+
| STATION ID |              TITLE              |
+------------+---------------------------------+
| LFR        |    オードリーのオールナイトニッポン              |
+------------+---------------------------------+
Completed!
/tmp/output/20161126010000-LFR.aac
■ rec-live

Record the live streaming program.

$ radigo rec-live -id=LFR -t=3600
Now downloading..
+------------+---------------+
| STATION ID | DURATION(SEC) |
+------------+---------------+
| LFR        |          3600 |
+------------+---------------+
Completed!
/tmp/output/20161205083547-LFR.aac
■ browse / browse-live

Browse radiko.jp.

$ radigo browse -id=LFR -s=20161126010000
$ radigo browse-live -id=LFR
Optional
- working dir

Default: ${PWD}/output

If you want to change the working dir, set the environment variables.

  • RADIGO_HOME
- radiko premium

If use the area free, set the environment variables.

  • RADIKO_MAIL
  • RADIKO_PASSWORD
e.g.
# export RADIKO_MAIL="radigo@example.com" && export RADIKO_PASSWORD="password"
$ radigo rec -a=JP13 -id=LFR -s=20161126010000

Known Issues

ERROR: Failed to concat aac files

(caused by the limitation of file descriptors maybe.)

Increase the number of file descriptors.

$ ulimit -n 16384

Resources

License

radigo is licensed under the GPLv3 license for all open source applications.

Please do not use this project for commercial use, it is not intended to be used for commercial use.

Author

Yoshiki Nakagawa

Documentation

Index

Constants

View Source
const (
	AudioFormatAAC = "aac"
	AudioFormatMP3 = "mp3"
)

Variables

View Source
var Ui cli.Ui

Functions

func AreaCommandFactory

func AreaCommandFactory() (cli.Command, error)

func BrowseCommandFactory

func BrowseCommandFactory() (cli.Command, error)

func BrowseLiveCommandFactory

func BrowseLiveCommandFactory() (cli.Command, error)

func ConcatAACFiles added in v0.7.0

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

func ConcatAACFilesAll added in v0.9.0

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

ConcatAACFiles concatenate files of the same type.

func ConcatAACFilesFromList added in v0.7.0

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

ConcatAACFilesFromList concatenates files from the list of resources.

func ConvertAACtoMP3 added in v0.7.0

func ConvertAACtoMP3(ctx context.Context, input, output string) error

ConvertAACtoMP3 converts an aac file to a mp3 file.

func RecCommandFactory

func RecCommandFactory() (cli.Command, error)

func RecLiveCommandFactory

func RecLiveCommandFactory() (cli.Command, error)

func Version

func Version() string

Version returns the app version.

Types

type OutputConfig added in v0.7.0

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

OutputConfig contains the configuration for output files.

func NewOutputConfig added in v0.7.0

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

func (*OutputConfig) AbsPath added in v0.7.0

func (c *OutputConfig) AbsPath() string

func (*OutputConfig) AudioFormat added in v0.7.0

func (c *OutputConfig) AudioFormat() string

func (*OutputConfig) IsExist added in v0.7.0

func (c *OutputConfig) IsExist() bool

func (*OutputConfig) SetupDir added in v0.7.0

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.7.0

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

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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