A lightweight YouTube music player for terminal, written in Ruby.
- 🎧 Play music directly from YouTube
- 🖥️ Simple terminal interface
- ⚡ Lightweight and fast
- 🎮 Intuitive controls
- 🔍 Integrated YouTube search
- Ruby 2.7+
yt-dlp(for getting YouTube URLs)mpv(for audio playback)
sudo apt-get install yt-dlp mpvbrew install yt-dlp mpvsudo pacman -S yt-dlp mpv# Clone the repository
git clone https://github.com/vitoyayo/ongaku-player.git
cd ongaku-player
# Run installer (installs everything automatically)
./install.shThe installer will detect your operating system and install:
- System dependencies (yt-dlp, mpv)
- Required Ruby gems
- The
ongakuexecutable in your PATH
# Clone the repository
git clone https://github.com/vitoyayo/ongaku-player.git
cd ongaku-player
# Build and install the gem
gem build ongaku-player.gemspec
gem install ongaku-player-*.gem
# Install system dependencies manually
# Ubuntu/Debian:
sudo apt-get install yt-dlp mpv
# macOS:
brew install yt-dlp mpv
# Arch Linux:
sudo pacman -S yt-dlp mpv# Clone the repository
git clone https://github.com/vitoyayo/ongaku-player.git
cd ongaku-player
# Install system dependencies first (see Method 2)
# Install with rake
rake install# Clone the repository
git clone https://github.com/vitoyayo/ongaku-player.git
cd ongaku-player
# Install system dependencies
sudo apt-get install yt-dlp mpv # Ubuntu/Debian
# Install Ruby gems
gem install tty-prompt tty-box tty-cursor pastel
# Make executable
chmod +x ongaku.rb# If installed with install.sh or as gem
ongaku
# Or run directly from the repository
./bin/ongaku
# With ruby
ruby ongaku.rb
# With rake (development mode)
rake run
# Demo mode (without internet connection)
DEMO_MODE=1 ongaku
# or
rake demoNormal Mode: Searches and plays music directly from YouTube using yt-dlp.
Demo Mode: If there's no internet connection, the player automatically uses a sample song list. You can force demo mode with:
DEMO_MODE=1 ./ongaku.rb🔍 Search music: Search songs on YouTube (or in demo list)- Normal search: "lofi hip hop"
- Search by tags: "#ambient" or "#lofi beats"
- Combined: "study music #chill"
📋 View queue: View and manage playback queue⏯️ Playback: Playback controls (pause, next, volume, etc.)❌ Exit: Close the player
- ⏸️ Pause/Resume
- ⏹️ Stop
- ⏭️ Next song
- ⏮️ Previous song
- 🔊 Volume up
- 🔉 Volume down
- ⏩ Forward 10 seconds
- ⏪ Rewind 10 seconds
The player is designed to be as lightweight as possible:
- Uses
yt-dlpto get streaming URLs from YouTube - Uses
mpvas audio backend (very efficient) - Minimalist interface with
tty-prompt - No file downloads (direct streaming)
# Build the gem
rake build
# Install locally
rake install
# Uninstall
rake uninstall
# Run in development
rake run
# Demo mode
rake demo
# Show visual demo
rake show_demo
# Test search
rake test_search
# Clean and reinstall
rake reinstallongaku-player/
├── bin/
│ └── ongaku # Main executable
├── lib/
│ ├── ongaku_player.rb # Main module
│ ├── youtube_search.rb # YouTube search
│ ├── player.rb # Player with mpv
│ ├── ui.rb # User interface
│ └── demo_mode.rb # Demo mode
├── ongaku-player.gemspec # Gem specification
├── Gemfile # Dependencies
├── Rakefile # Rake tasks
├── install.sh # Automatic installer
├── README.md # This file
├── FEATURES.md # Detailed features
└── LICENSE # MIT License
- Fork the project
- Create your feature branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -m 'Add new feature') - Push to the branch (
git push origin feature/new-feature) - Open a Pull Request
MIT - See LICENSE for more details.