Skip to content

nisiddharth/ytplay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

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
Screenshot with video Screenshot 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/ytplay

Also, 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 this

Presents these 10 search results on fzf and plays the selected video on pressing enter:

Screenshot

Releases

No releases published

Packages

No packages published

Languages