When it comes to download play YouTube videos, there are many CLI and GUI applications available, such as ClipGrab, Streamlink, NewPipe and Youtube-dl etc. Today, we are going to learn yet another command line YouTube Player and downloader named Mps-youtube. It is a commandline program based on mps, which is also a command line program used to search, stream and download music. Using mps-youtube, we can easily search, play and download Youtube videos from commandline. It needs Mplayer or mpv to play videos. It is a free, open source program written using Python. It supports Linux, Mac OS X, and Windows.
Key features of mps-youtube
Concerning about the features of mps-youtube application, we can list the following:
- Search and play audio/video from YouTube.
- Search tracks of albums by album title.
- Search and import YouTube playlists.
- Create and save local playlists.
- Download audio/video.
- Convert to mp3 and other formats (requires ffmpeg or avconv).
- View video comments.
- Free and open source.
Mps-youtube - A Commandline Youtube Player And Downloader
First, make sure you have installed the required dependencies:
- mplayer: Alternative to mpv for playback
- ffmpeg: for transcoding downloaded content
All of these packages are available in the official repositories of most Linux distribution.
Mps-youtube is available in the default repositories of some Linux distributions.
To install mps-youtube along with all required dependencies on Arch Linux and derivatives, run:
$ sudo pacman -S mps-youtube mplayer ffmpeg
On Debian, Ubuntu, linux Mint:
$ sudo apt-get install mps-youtube mplayer ffmpeg
Mps-youtube can also be installed using pip3, a python package manager. Make sure you have installed pip3. It is available in the default repositories as well. So, you can install it using your distribution's package manager.
For instance, pip3 can be installed using the following command in Debian, Ubuntu and other DEB based systems.
$ sudo apt-get install python3-pip
You can install mps-youtube using pip3 like below.
$ sudo pip3 install mps-youtube
Don't forget to install other required dependencies Mplayer and FFMpeg.
Once installed, you can launch mps-youtube using command:
The above command will take you to the mps-youtube console window. Here is how mps-youtube console looks like.
Before going further, we need to do some necessary configurations.
By default mps-youtube will search for videos in the music category. To change this to all categories, enter the following command in mps-youtube console:
$ set search_music false
After the successful execution of the above command, you will see the following output:
Also, mps-youtube is set to play audio only by default. To view video output, enter the following command in the mps-youtube console:
$ set show_video true
Now, it is time to see how to use mps-youtube application to play your videos and/or download them.
Searching Youtube videos
To search for a video, use / or . followed by your search term. For instance, to search for the youtube video "see you again", type the following in mps-youtube console.
$ /see you again
After entering the above command, you will see the list of youtube videos based on your search term:
As you see above, the results are displayed with serial number.
To go back and forth through search results, you can type "n" (for next video) or "p" (for previous video).
To play any video from the list just type its serial number and hit ENTER key. The video will play in the default player.
To adjust volume, use 9 and 0. Press Spacebar to pause the video. To seek, use left/right and up/down arrows. To exit the video, press q.
Viewing information about a video
To view the information of a specific video, say 1st video, type "i" followed by the serial number in the mps-youtube console window.
$ i 1
To go back, press ENTER key.
Viewing the comments of a video
To view the comments of a youtube video, type c followed by the specific video serial number.
$ c 1
To download a video from the list, type d followed the serial number in the mps-youtube console.
$ d 1
This command will display the list of available formats. Choose any format to download by entering the respective number.
The downloaded files will stored in /home/user/Downloads/mps/ directory.
Show related videos
To view the similar videos type "r" followed by the video number.
$ r 1
Show videos by uploader
To show videos uploaded by uploader of a video, use "u" followed by number.
$ u 1
Copying URL to clipboard
To copy the URL of a video to clipboard, use "x" followed by the video number. Make sure you have installed python-pyperclip package.
$ x 1
Exit from Mps-youtube
To exit mps-youtube application, simply type q in the console.
To view the help topics, just type "h".