A lightweight Radiko utility with three subcommands:
rec: record a program to m4afetch: resolve program information without recordinglist: list one day of schedule for a station
Recording uses FFmpeg libraries (libavformat / libavcodec / libavutil) for remuxing and metadata. Cover art is embedded when possible and falls back to audio-only when not.
- FFmpeg libraries and pkg-config
- Arch:
sudo pacman -S ffmpeg - Ubuntu/Debian:
sudo apt-get install -y libavformat-dev libavcodec-dev libavutil-dev pkg-config - macOS:
brew install ffmpeg pkg-config
- Arch:
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -jThe build fails if libav* are not found (CLI fallback is removed).
Radiko login settings are optional. Search order:
$XDG_CONFIG_HOME/radicc~/.config/radicc
RADIKO_USER=you@example.com
RADIKO_PASS=yourpasswordExample environment variable:
export RADICC_DIR="$HOME/Radiko/"RADICC_DIR is the default output root when no higher-priority path is provided.
Minimal fields are title (section name) and station.
- Global:
base_dirsets a common output root for all entries - Per-entry:
diris a subdirectory underbase_dir - Per-entry:
filenameis the filename base;-YYYYMMDD.m4ais appended automatically - Per-entry:
date_offsetadjusts the filename date only - Per-entry:
img/pfmare fallbacks used only if not fetched
base_dir = "$HOME/Radiko"
[example] # select via -t example
id = "my-program" # or select via -i my-program
title = "Program Title"
station = "JORF"
img = "" # used only if no image fetched
pfm = "" # used only if no pfm fetched
date_offset = 0 # adjust filename date only (days; e.g., 1)
dir = "" # subdirectory under base_dir; only used when explicitly set
filename = "" # defaults to <title>-YYYYMMDD.m4a (suffix always appended)- Discovery:
title + station→ weekly XML → nearest past entry (to <= now) - Fetched:
id/title/pfm/ft/to/img. Save-time priority: pfm/img → fetched > TOML; dir/filename → TOML if present; album is always title.
Output root/path is resolved in this order:
-oexplicit path- TOML global
base_dir RADICC_DIR- current directory
./
Examples:
-o my_pickWrites under the default output root asmy_pick-YYYYMMDD.m4a-o ./Writes in the current directory-o ./file.m4aWrites exactly to./file.m4a-o /path/to/file.m4aWrites exactly to that file path
Parent directories are created automatically. A subdirectory is created only when dir or a directory path in -o is explicitly provided.
Record a program from TOML or a Radiko timeshift URL.
./radicc rec -t example
./radicc rec --url 'https://radiko.jp/#!/ts/FMO/20250920140000'
./radicc rec --url 'https://radiko.jp/#!/ts/FMO/20250920140000' --date-offset 1Resolve program info without recording. This is the old --fetch behavior.
./radicc fetch -t example
./radicc fetch --url 'https://radiko.jp/#!/ts/FMO/20250920140000'
./radicc fetch --url 'https://radiko.jp/#!/ts/FMO/20250920140000' --jsonList one day of programs for a station.
./radicc list --station-id JORF
./radicc list --station-id JORF --date 20260327
./radicc list --station-id JORF --date 20260327 --json- If
--dateis omitted,radicctries the current JST date first, then the previous day, then the next day - Normal output prints a formatted list
--jsonprints an array suitable for tools likefzf- Each item includes a timefree URL in the form
https://radiko.jp/#!/ts/{station_id}/{ft}
-t, --target <section>: select TOML section-i, --id <id>: select byidin TOML-u, --url <url>: one-off URL mode-o, --output <name-or-path>: filename base, directory override, or explicit file path-d, --duration <min>: override duration in minutes--date-offset <days>: shift the filename date backward--json: print resolved result as JSON
--station-id <id>: station id--date <YYYYMMDD>: target date, max one day--json: print raw JSON array
- Album is always the resolved title; artist is pfm (fetched when available, empty otherwise).
- Library logging is reduced to errors to avoid noisy per-segment messages.
- See
FLOW.mdandFLOW-ja.mdfor detailed flow, required/optional fields, and priorities.
radicc-server is a small HTTP wrapper intended for personal use.
Start:
./radicc-server --port 8080Health check:
curl http://127.0.0.1:8080/healthRecord request:
curl -X POST \
-H 'Content-Type: application/json' \
-d '{"url":"https://radiko.jp/#!/ts/STATION/YYYYMMDDHHMMSS","date_offset":1}' \
http://127.0.0.1:8080/recordExample response:
{
"status": "done",
"job_id": "d18b6740d8fb41d2",
"download_url": "/download/d18b6740d8fb41d2",
"filepath": "/path/to/file.m4a",
"output_file": "file.m4a",
"title": "Program Title",
"start_time": "20260329000000",
"end_time": "20260329003000"
}Download:
curl -OJ http://127.0.0.1:8080/download/d18b6740d8fb41d2