How to play YouTube videos from the terminal

Have you been watching YouTube on your school computer and got tired of seeing ads? Or have you wanted to download a video to your computer? Well now you can run YouTube on the terminal using a utility, and here’s how.

The first step you want to do is check for updates by going to the Penn Manor updates in the dash. Once you have made sure the computer is up to date proceed to the next step.

1. Open the Terminal and  type:

sudo apt-get install python3-pip

and press Enter.

Screenshot from 2015-10-22 11_04_51

What this is doing is that it is installing a python package manager that will be used to install the YouTube terminal utility. Python is a programming language we can use to create utilities such as the one we are installing right now.

When you get to the screen like the one below press Enter.

Screenshot from 2015-10-22 11_05_11

2. Next you want to type:

sudo -H pip3 install mps-youtube

and press Enter

.Screenshot from 2015-10-22 11_06_59

This command fires up the python package manager and installs the YouTube terminal utility.

That’s it. The YouTube utility has been installed!

3. Now let’s run our YouTube utility. Every time you want to use this utility open the Terminal and type:

mpsyt

and press Enter.

Screenshot from 2015-10-29 13:06:09

4. Now let’s configure our YouTube player. Type:

set player vlc

and press Enter. This tells our utility to use the VLC program as our video player. Remember: we are not using a browser for YouTube!

Now type:

set search_music false

and press Enter. This will make it so everything you search will be a video not audio. Skip this step if you want to search and play music, and not only videos!Screenshot from 2015-10-29 13:10:10

Now type:

set show_video true

and press Enter. Typing this will make it so the video plays on the computer.

That’s it! We are ready to start using the utility.

To search and play videos:

Type a period or a forward slash (/) before the search criteria. For instance, if you want to look for videos of dancing cats, you would type:

.dancing cats

and press Enter. You will see a numbered list of matching videos.

Screenshot from 2015-10-29 13:10:37

To play a video just type its number on the list and press Enter. If you want to play more than one video just type their numbers separated by commas.

To download a video:

Type the letters dv followed by the video number. For instance, to download the third video on the list type:

dv 3

and press Enter. The video will be stored in the mps folder inside of your Downloads folder.

To make a play list:

Type:

add <the number of videos> <name of playlist>

For example, to create a play list named “mycats” containing the first, second, and fifth videos on the list:

add 1,2,5 mycats

If you need any help simply type:

help basics

If you have any problems or questions please come down to the help desk for further assistance.

This entry was posted in Applications. Bookmark the permalink.