Discover how to watch YouTube videos from your terminal

mps-youtube

I am more and more convinced that when I say that the Linux terminal is a powerful tool and unfairly valued by all those outside the operating system, I mean it with some reason. The terminal has so many possibilities that you can even search for YouTube videos and play them through it.

Do you want to know how it is done? Then do not miss what we are going to show you next, which is neither more nor less than the mps-youtube program, a terminal application that is lightweight, simple and useful and that allows us to play and download YouTube videos based on commands, and we are going to show you how to install and use it.

Installing mps-youtube

mps-youtube is already in the Ubuntu repositories, it just isn't in its most current version. For install the latest version We will have to resort to PIP, so first we will have to open a terminal and type this:

sudo apt-get install python-pip

After we have installed it, we have to use it to get mps-youtube, as we just discussed. For this we will have to enter these commands in the terminal:

sudo pip install mps-youtube

As for the player that we will use to watch the videos, we have two alternatives: MPlayer2 or mpv. To install MPlayer2 we enter this command:

sudo apt-get install mplayer2

And to install the mpv player this other:

sudo apt-get install mpv

As for which player to use, I leave it up to you, but mps-youtube works by default with mpv. This can be changed afterwards, but we will explain this below.

Using and configuring mps-youtube

For starting to use the app we have to write the following command:

mpsyt

Next we proceed to configure it. If instead of mpv we want to use MPlayer As the default player, within the interface that will open we write the following:

set player mplayer

By default mps-youtube only allows music search, but this can also be changed to watch videos of all kinds with the following command:

set search_music false

Finally, we only have configure video output:

set show_video true

With the command set may see all parameters available settings.

Performing a search is very easy. In the text input interface we place one point ahead of what we want to search for, For example:

.led zeppelin

Watching a video is very easy: All you have to do is write the list number that appears on the left and press Intro, and to download a video all we have to do is use this command:

d ITEM-NUMBER

Where ITEM-NUMBER is the number left of the name of the video that we discussed earlier.

As you can see, it is a tool simple, easy to use and configure, which will allow us to watch videos from the terminal and without the need to open a browser. Leave us a comment with your experience if you dare to try it.


6 comments, leave yours

Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  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.   Patrick said

    Good afternoon, thank you very much for the article, I wanted to know if I can automate the process, that is, every time I open it, I do not have to enter the command in the terminal to open the program (I am somewhat forgetful)

  2.   Sergio Acute said

    Hi Patrick, first of all thank you for your comment.

    I don't know of any way to automate the process, unless you want to create a script for it that you can place in the launcher on your desktop, but I'm going to try to find out if I find something.

    A greeting.

  3.   Jose Luis said

    First of all, thank you very much for the article. It is much more comfortable to see YouTube from the terminal than to have to be opening the browser.

    With regard to automating the process, perhaps it can be useful to create a launcher in a panel and in the command box put:
    mate-terminal -e mpsyt
    o
    xfce4-terminal -e mpsyt
    o
    gnome-terminal -e mpsyt

    depending on the terminal you use.

  4.   Miguel said

    Very good article and very good application. I had always missed being able to get a list of videos on youtube-dl
    (or I don't know how to do it at least).
    To Patrick: You can make an alias in .bashrc that is easy for you to remember
    alias vervideos = '/ path / to / mpsyt /'
    I use it for the commands that I often forget.

  5.   persinc said

    Hello, look what he threw at me:

    Traceback (most recent call last):
    File "/ usr / local / bin / mpsyt", line 9, in
    load_entry_point ('mps-youtube == 0.2.5', 'console_scripts', 'mpsyt') ()
    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
    return get_distribution (dist) .load_entry_point (group, name)
    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point
    return ep.load ()
    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
    entry = __import __ (self.module_name, globals (), globals (), ['__name__'])
    File "/usr/local/lib/python2.7/dist-packages/mps_youtube/__init__.py", line 1, in
    from .main import init
    File "/usr/local/lib/python2.7/dist-packages/mps_youtube/main.py", line 54, in
    from urllib.request import urlopen, build_opener
    ImportError: No module named request

    I already uninstalled the mps-youtube with $ sudo pip uninstall mps-youtube and I uninstalled the python-pip, I did everything again and the problem persists if you could help me I would appreciate it.

    1.    Jose Luis said

      Looking at the list of changes (https://github.com/np1/mps-youtube/blob/develop/CHANGELOG), in the latest version (0.2.5) it says:
      - Support python 3 only (will not run with python 2)

      And according to the trace you send you have python2.7
      Try installing python3-pip
      [sudo] apt-get install python3-pip

      And then install mps-youtube using pip3
      [sudo] pip3 install mps-youtube