A terminal-based YouTube audio player with keyboard controls for searching and playing YouTube audio.
- 🔍 Search YouTube directly from terminal
- 🎵 Play audio from YouTube URLs or search results
- ⌨️ Full keyboard controls for navigation and playback
- 📦 Auto-install missing dependencies (mpv, yt-dlp, fzf)
- ⬆️ Auto-check yt-dlp against the latest GitHub release and update when needed
- 🎨 Beautiful interactive search interface with fzf
- ⚡ Live search results display as they arrive
- 🎛️ Complete MPV player controls (volume, seek, speed, loop)
- 🔄 Playlist navigation (next/previous through search results)
- ↩️ Return to menu after playback ends
- 🔁 Loop controls (entire track or A-B section)
- 🎯 Clean, clutter-free output interface
- 📱 User-friendly notifications for track changes
mpv- Media playeryt-dlp- YouTube downloaderfzf- Fuzzy finder
The tool will offer to install missing dependencies automatically on first run.
For yt-dlp, it checks the latest stable release from https://github.com/yt-dlp/yt-dlp and installs or updates the appropriate binary according to the OS when possible.
# Clone the repository
git clone https://github.com/nahidhasan98/ytac.git
cd ytac
# Build
./build.sh
# Run
bin/ytac <search terms>bin/ytac nasheed
bin/ytac tafseerbin/ytac https://www.youtube.com/watch?v=VIDEO_IDbin/ytac --verbose nasheed
bin/ytac -v https://www.youtube.com/watch?v=VIDEO_IDbin/ytac --search-count 3 nasheed
bin/ytac -c 10 tafseerbin/ytac --help| Key | Action |
|---|---|
↑/↓ or j/k |
Navigate up/down |
Enter |
Select and play |
Ctrl+c / Esc |
Cancel |
/ |
Toggle search mode |
| Key | Action |
|---|---|
Space |
Pause/Resume |
→/← |
Seek forward/backward 5s |
↑/↓ |
Volume up/down 5% |
>/< |
Next/Previous track in playlist |
9/0 |
Volume down/up 2% |
[/] |
Speed down/up |
Backspace |
Reset speed to 1.0x |
r |
Restart from beginning |
l |
Loop entire track (toggle on/off) |
a |
A-B loop (set start, end, clear) |
m |
Mute/Unmute |
q |
Stop and return to menu |
- Search: Enter your search terms to find YouTube videos
- Select: Browse results with arrow keys and press Enter
- Play: Audio starts playing with all search results as a playlist
- Navigate: Use
>and<to move between tracks - Return: Press
qto stop and return to the selection menu - Repeat: Select another video or exit
# Standard build
./build.sh
# Manual build
CGO_ENABLED=0 go build -ldflags "-s -w" -o bin/ytac ./cmd/ytacgo test ./...
go vet ./...yt-dlpinstallation is OS-aware and selects a release asset based on the platform- The overall app is best supported on Linux and macOS right now because dependency installation still assumes
apt,dnf,pacman, orbrew, and playback uses/dev/stdinfor mpv bindings
- All search results become a playlist - navigate with
>and< - Press
qto return to menu anytime during playback - Use
lto loop your favorite track continuously - Use
akey to loop specific sections (A-B loop) - Use
--search-countor-cto choose how many results to fetch, from 1 to 10 - Add
--verbosewhen you want full mpv logs for troubleshooting playback issues
MIT