8000
Skip to content

kanoshiou/radiko-tui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

84 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Radiko TUI

English | ζ—₯本θͺž | δΈ­ζ–‡

A Terminal User Interface (TUI) for streaming Radiko Japanese internet radio, written in Go.

Release Go Version Docker License

✨ Features

  • 🎡 Stream live Radiko radio stations
  • πŸ—Ύ Support for all 47 Japanese prefectures
  • πŸ–₯️ Interactive terminal UI (TUI)
  • 🌐 Server mode for HTTP streaming (AAC/PCM)
  • πŸ”Œ Client mode to connect to remote server (no local ffmpeg)
  • πŸ”Š Volume control with mute support
  • ⏺️ Record streams to AAC files
  • πŸ”„ Auto-reconnect on stream failure
  • πŸ’Ύ Remembers last station and settings
  • 🌏 Cross-platform (Windows/Linux/macOS)

πŸ“Έ Screenshot

πŸ“» Radiko  πŸ”Š 80%
  β—€ εŸΌηŽ‰ 千葉 [東京] η₯žε₯ˆε· ζ–°ζ½Ÿ β–Ά [13/47]
──────────────────────────────────────────────
  TBSラジγ‚ͺ TBS
 β–Ά ζ–‡εŒ–ζ”Ύι€ QRR 
  ニッポン放送 LFR
  ラジγ‚ͺNIKKEI第1 RN1
  ラジγ‚ͺNIKKEI第2 RN2
  ↓ さらに葨瀺

──────────────────────────────────────────────
β–Ά ζ–‡εŒ–ζ”Ύι€ QRR  β™ͺ 倧竹まことゴールデンラジγ‚ͺ  ⏺ 録音中 02:15
↑↓ 選択  Enter ε†η”Ÿ  ←→ εœ°εŸŸεˆ‡ζ›Ώ  +- ιŸ³ι‡  m γƒŸγƒ₯γƒΌγƒˆ  s 停歒  r 再ζŽ₯碚  Esc η΅‚δΊ†

πŸ“¦ Installation

Download Pre-built Binary (Recommended)

Download from Releases.

Build from Source

git clone https://github.com/kanoshiou/radiko-tui.git
cd radiko-tui
go mod tidy
go build -o radiko

Server-Only Build (No Audio Dependencies)

For headless Linux servers without audio support:

go build -tags noaudio -o radiko-server

This build excludes audio playback dependencies (oto) and only supports server mode (-server flag).

Build with Default Server URL

You can specify a default server URL at build time, so clients don't need to provide -server-url every time:

go build -ldflags "-X main.defaultServerURL=http://your-server-ip:8080" -o radiko-tui

Note: If --server-url is provided at runtime, it takes precedence over the built-in default.

Docker (Recommended for Server Mode)

Pull from GitHub Container Registry:

docker pull ghcr.io/kanoshiou/radiko-tui:latest

Run with Docker:

docker run -d --name radiko -p 8080:8080 ghcr.io/kanoshiou/radiko-tui:latest

Custom port and grace period:

docker run -d --name radiko -p 9000:9000 ghcr.io/kanoshiou/radiko-tui:latest \
  -server -port 9000 -grace 60

Docker Compose:

version: '3.8'
services:
  radiko:
    image: ghcr.io/kanoshiou/radiko-tui:latest
    ports:
      - "8080:8080"
    environment:
      - TZ=Asia/Tokyo
    restart: unless-stopped

⚠️ Requirements

ffmpeg is required for audio decoding and recording.

# Windows (Chocolatey)
choco install ffmpeg

# Linux (Ubuntu/Debian)
sudo apt install ffmpeg

# macOS (Homebrew)
brew install ffmpeg

πŸš€ Usage

TUI Mode (Default)

./radiko-tui

Client Mode (No ffmpeg required)

Connect to a running radiko-tui server:

./radiko-tui -server-url http://192.168.1.100:8080

In this mode, audio decoding is handled internally. No local ffmpeg installation is required on the client. All TUI features (volume, region switching) are supported.

Server Mode

Run as an HTTP streaming server:

./radiko-tui -server -port 8080

Then stream in VLC or any audio player:

vlc http://localhost:8080/api/play/QRR

Server Mode Features

  • Multi-client support: Multiple clients can listen to the same station, sharing one ffmpeg instance
  • Smart ffmpeg reuse: When a client disconnects, ffmpeg keeps running for a grace period (default 10 seconds)
  • Automatic reconnection: If a client reconnects within the grace period, the existing stream is reused instantly

Server Options

Option Default Description
-port 8080 HTTP server port
-grace 10 Seconds to keep ffmpeg alive after last client disconnects

Example with custom grace period:

./radiko-tui -server -port 8080 -grace 30

Server API Endpoints

Endpoint Description
GET /api/play/{stationID} Stream audio (AAC) for VLC/Browser
GET /api/play/{stationID}/pcm Stream audio (PCM) for radiko-tui client
GET /api/status Get JSON status of active streams

Controls

Key Action
↑/↓ or k/j Navigate stations
←/β†’ or h/l Switch regions
Enter/Space Play station
+/- Volume up/down
0-9 Set volume level
m Toggle mute
s Start/Stop recording
r Reconnect
Esc Exit

Recording

Press s to start/stop recording the current stream. Recordings are saved to your Downloads folder as AAC files with the format: radiko_StationName_YYYYMMDD_HHMMSS.aac

When recording a different station than currently playing, the station name will be shown in brackets: ⏺ 録音中[StationName] MM:SS

πŸ“– Documentation

πŸ—οΈ Tech Stack

πŸ™ Special Thanks

Special thanks to rajiko for inspiration and reference.

πŸ“‹ System Requirements

  • ffmpeg (runtime)
  • Go 1.18+ (build only)
  • Terminal with UTF-8 support

🀝 Contributing

Issues and Pull Requests are welcome!

πŸ“„ License

MIT License - See LICENSE


Note: This project is for learning and personal use. Please comply with Radiko's terms of service.

About

A Radiko Japanese internet radio player written in Go with an interactive TUI.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

0