Linux Tutorial: How to browse & watch YouTube videos entirely through Terminal

Note: You must have FFmpeg and avconv already installed.
Step 1: Install MPV. If you’re on any non-Ubuntu based distro, you can
install it easily as you would any other package. If you are on an
Ubuntu-based distro like, say, Linux Mint for example, do this in
sudo apt-add-repository ppa:mc3man/mpv-tests
sudo apt-get update
sudo apt-get install mpv
sudo apt-get upgrade
This will give you the latest version of MPV which comes with the on-screen controller UI.
Step 2: Install mps-youtue. With python-pip already installed, enter:
sudo pip install mps-youtube
Step 3: Open mps-youtube in terminal by typing “mpsyt.” (without quotations & punctuation)
Step 4: Once in the mps-youtube interface, type “set player mpv” and then
“set show_video true.” Now read up on the available commands with the
“help” dialogue and now you’re set to go!


and here was me hoping for mplayer -vo caca video.ogv


mpv seems to be a versions of mplayer/mplayer2, is there any notable differences?

+1 for MPV

The reason I moved to MPV is because it allows for HTTPS streaming.

There is also youtube-viewer which has basically all the youtube features, like subscriptions, liking, comments, playlists, lives,... and all!
it's called youtube-viewer and the installation process and your "tutorial" largely depends on what distro/package manager people are on...

Sorry but this is needlessly complicated, there is a much simpler way to watch YouTube videos without a browser and even via terminal.

VLC has built-in support for playing YouTube videos.


Media -> Open Network Stream -> Paste the YouTube URL


Ctrl+N -> Ctrl+V

MPV + YouTube-DL
Install mpv (command depends on distro)
Install youtube-dl (command depends on distro)


1 Like

That is another method, but the method listed in the original post allows you to search for videos and other features like seeing information on videos and reading comments all without the use of a browser. This method requires a browser to copy/paste the URLs from.

If you like this then you may also like livestreamer as it allows you to watch live streams through any media player via the command line :)

1 Like

youtube-dl is part of mpv now, iirc.

regardless of if it is or isnt, you can just mpv 'url' and play videos.
oh, and are you the same rottencorpse from jupiter broadcasting?

They are still separate projects but you are correct you no longer have to do the --ytdl option to get it to play youtube videos, that is good to know. Thanks for the info.

Yes, that is me. Do you watch Linux Action Show and/or Linux Unplugged?

Oh fair enough, hadn't had a look into it too far, just noticed on a new install that streams worked even though i forgot to install ytdl.

Both, I watch most of the jupiter content.
Though I'm a month or so behind atm, been busy with uni work.

That is interesting, it is an optional dependency. Maybe your distro includes it during install, that would be cool.

Very nice. I am never on LAS but I get mentioned a lot for production stuff. I am on LUP quite a bit though.

Understandable...I work on the shows and sometimes I get behind. :)

I run arch, but i had been auto-pilot mode yaourt'ing so it's possible I just hit yes to something and went right on by.

haha can't blame you, there's a lot of long quality content to go through.

Anything stand out as really worth watching the last month or so if I get a spare hour? I mean... it's all worth watching I'm sure haha.

Outstanding SCALE 13x | LAS 354

and if you havent seen it this one is totally worth it, the outtakes portion is awesome. -

1 Like