Ubuntu / Linux news and application reviews.

mps-youtube is a command line tool that can be used to search, play and download YouTube videos, which supports both local and YouTube playlists.

By default, mps-youtube is basically a YouTube audio player (and downloader), but you can enable external video playback (via mpv or MPlayer) from its options:


Features:
  • 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 from YouTube, with support for DASH (so it can mux separate audio and video streams - that means it can download 1080p YouTube videos since all 1080p YouTube videos use DASH);
  • view video comments;
  • works under Linux, Windows and Mac OSX;
  • many other small but useful features.

The latest mps-youtube 0.2.0, released today, adds quite a few new features and improvements, such as:
  • auto detect terminal size;
  • transcode audio to mp3 and other formats (requires ffmpeg or avconv);
  • added "da" (download best available audio file) and "dv" (download best available video file) commands to playlist search results;
  • added options to download YouTube playlists (use "dapl" for audio and "dvpl" for video) by url or id;
  • the progress indicator now works with mpv;
  • added option to show system notifications (on Ubuntu, install "libnotify-bin" and enable notifications using "set notifier notify-send");
  • Added overwrite true/false option for downloads (skips download if downloaded file already exists);
  • added copy to clipboard feature (requires "xclip" from the repositories and "xerox" which you can install via python-pip);
  • remux audio downloads for better file compatibility.


Getting started with mps-youtube


To start mps-youtube, use the following command:
mpsyt

Before using mps-youtube, let's configure it.

mps-youtube uses mplayer as the default media player but you can change this to mpv by using the following command:
set player mpv

By default, mps-youtube searches for music only. If you want to disable this, use the following command:
set search_music false

Also, mps-youtube plays just the audio by default so if you wish to enable playing videos (using the player set above), run the command below (once again, after running "mpsyt"):
set show_video true

You can view all the available configuration options by using the command below:
set


Searching for music / videos using mps-youtube is as easy as adding "." or "/" in front of the search terms (without the quotes). For instance, to search for Led Zeppelin, you can use:
.led zeppelin
or:
/led zeppelin
You can navigate to the next / previous page of results by using "n" (next) and "p" (previous).

To play an item, enter its number. You can also play multiple items, for instance, use "1-5" to play items 1 to 5 or "1, 2, 6" to play the first, second and sixth item and so on.



To download an item, use:
d ITEM-NUMBER
For example, to download the 3rd search result, use "d 3" - this displays all the available audio and video formats and lets you choose which to download. You can also download the best audio (use "da ITEM-NUMBER") or best video (use "dv ITEM-NUMBER"). This works for both searches and playlists.

This is just to get you started so for more information on using mps-youtube, type "h" and then "help TOPIC" (where topic is "basic", "search" and so on) as explained in mps-youtube:



Install mps-youtube


Arch Linux users can install the latest mps-youtube via AUR

mps-youtube is available in Ubuntu 14.10 and 15.04 repositories as well as Debian Sid and Jessie however, that's an older version so if you want to install the latest version in Ubuntu, Debian, Linux Mint and so on, you can use PIP:

1. Install Python PIP:
sudo apt-get install python3-pip

2. Install mps-youtube using Python PIP:
sudo pip3 install mps-youtube

3. You'll also need either mpv or mplayer if you want to play audio or video via mps-youtube.

mpv is available in the official Ubuntu 14.04, 14.10 and 15.04 repositories as well as in Debian Jessie and Sid so to install it, use the following command:
sudo apt-get install mpv

Of course, you can also use mplayer, which is available in the official repositories for any Ubuntu / Debian version - install it using the following command:
sudo apt-get install mplayer

If you had mps-youtube installed and you want to upgrade it (or you want to upgrade it later on, when a new version is released), use the following command:
sudo pip3 install mps-youtube --upgrade

For Windows and Mac OS X installation instructions, bug reports and so on, see the mps-youtube GitHub page.