mps-youtube: Play YouTube content from the terminal

mps-youtube

YouTube has become one of the great services which we can turn to pTo search for videos of almost any type and it is that this is considered a social network. The use that we generally make of this service is in search of tutorials, news, in search of information, among others.

In Gnu / Linux we have various tools with which we can enjoy this social network, from using our web browser, a multimedia player or also from the terminal.

About mps-youtube

It is because of that this time I will take the opportunity to talk about mps-youtube, with which we can play music from YouTube completely in the terminal, although it can also play videos using mplayer or mpv.

mps-youtube is an open source cross-platform application written in the Python programming language and that is based on mpv which is an application that allows us to use the terminal to search, play and download music.

Features of mps-youtube

El main purpose of the application is to serve as a YouTube music player, which offers options for:

  • Search and play audio
  • Create and save local playlists
  • Find and import YouTube playlists
  • Set the default audio format

With additional options such as:

  • Playing videos externally using mpv, mplayer or vlc
  • View video comments
  • Optional notifications about song change
  • MPRIS v2 support
  • Last.fm scrobbling support

Also, as an additional feature over audio playback is that the application gives us the possibility to convert the audio to mp3, aac, wma, among others, only that it requires ffmpeg and avconv for it.

How to install mps-youtube on Linux?

mps-youtube-video

If you want to try or start using this great application We must first have some dependencies for the correct execution of mps-youtube in our system.

As mentioned mps-youtube is written in Python, so we must have it installed on our system, if not, simply look for the package in the repositories of your system since it is found in most distribution repositories.

If we want to know if we have Python installed on our computer we must open a terminal and execute:

python3 --version

Where they should receive a message with the installed version or otherwise they will get a "not found" and they will have to install it:

For Debian, Ubuntu and derivatives we install with:

sudo apt-get install python3-pip mpv

For the case of Fedora, openSUSE, CentOS and derivatives:

dnf -y install python-pip python3 mpv

For Arch Linux, Manjaro and derivatives:

sudo pacman -S python3 python-pip mpv

Done this now we must add a path to our folder staff with:

echo "export PATH=\"\$PATH:\$HOME/.local/bin\"" >> ~/.bashrc

. ~/.bashrc

Now we can proceed to install the application with:

pip3 install --user mps-youtube youtube-dl

How to Live Aligned with optional step can install dbus-python and pygobject for your user if they want mps-youtube to support MPRIS v2, which means they will get the media player controls in the Sound Menu:

pip3 install --user dbus-python pygobject

As mentioned, if you want to integrate video playback, you can do it with vlc, which is your total option to install.

How to use mps-youtube?

Only we must open a terminal and execute the following command to start the application:

mpsyt

Now we can use the internal search engine To find an audio track or a video, just use the following command:

help search

Mps-youtube is quite customizable too. For example, the search results screen can be configured to display additional fields. To see all available settings, type "help settings" in mps-youtube.

To enable video playback in the application we must execute this command:

set show_video true

Done this We must configure which player will be the one that will be executed for the video playback.

set player <player>

Where to configure the mpv player just substitute for mplayer or to configure vlc use "cvlc".


A comment, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   carlos santiago said

    Excellent article, it helped me to know how to play video. Greetings