NI
nisiddharth/ytplay
A simple bash script to play YouTube videos from terminal.
ytplay
A simple bash script to play YouTube videos from terminal.
Supports:
- Music only playback
- List of search results to select from
- Play on infinite loop
- No login required, age restricted videos are also playable
Screenshots
| With video | Without video |
|---|---|
![]() |
![]() |
Lyrics on the right shown using lyrics-in-terminal.
Requirements
mpv, yt-dlp, jq, curl, awk and fzf.
Usage
ytplay [OPTION] query
OPTIONS:
-m, --music Music only mode. No video playback.
-t, --top Play the top search result. No options presented.
-l, --loop Play the media on an infinite loop
-r, --results COUNT Specify the number of options to be presented
-h, --help Show this help
Install
Copy ytplay to your ~/.local/bin directory, like so:
curl https://raw.githubusercontent.com/nisiddharth/ytplay/main/ytplay > ~/.local/bin/ytplay && chmod +x ~/.local/bin/ytplayAlso, the script needs YouTube Data API key for searching. You can either keep that in ~/.api_keys/YT_API_KEY or edit the appropriate line in the script.
Example
ytplay something just like thisPresents these 10 search results on fzf and plays the selected video on pressing enter:
On this page
Contributors
Created February 3, 2022
Updated April 9, 2025


