Search, Play & Download YouTube Videos From Command Line

If You are using Linux,  You might be familiar with youtube-dl, a small command-line program to download videos from YouTube and a few more sites. But You need to go to YouTube, grab the url and then give it to youtube-dl to download it.

mps-youtube, a terminal based YouTube player makes it possible to browse, play & download videos right from the terminal.

You can install it using pip
pip install mps-youtube
and start using in with
mpsyt
It is better to set an alias for this
alias yt="mpsyt"
By default it is configured to search music category and stream audio only. You can change it
set music_search false
set show_video true
To get help, just press h.
To search for videos about Katy Perry, type /katy perry.
To stream a song, enter the number of the song and enter.
To download a video, type d <number> and it shows all the available formats, then you can select any video of your choice and download it.

Here are a few screenshots of it.