If you’re an addicted user of the free, online video sharing website “YouTube” 😉 and use GNU/Linux as the operating system, also happen to be using the command-line interface a lot too, then you might love this small, yet an awesome tool called “yt” (stands for “whitey”).
It’s written in Python and is a “YouTube browser” that lets you search and play YouTube videos directly from the command-line!. It’s actually a front-end that uses both “youtube-dl” (YouTube video downloader) and “mplayer” as the video player.
It’s not a new tool and has been there for sometime now according to the release history. But I’m glad that I just found it! ;-).
Few main features …
*. One thing “yt” lacks is the proper documentation.
But then again, as you can see form the below screenshots, all of its features are controllable through keyboard shortcuts and it displays all of them on the main window. So it’s still a very intuitive application in my humble opinion.
*. Shows information of individual videos such as: The Title, small Description, Duration, Size, original Uploader and few other details that I don’t actually know of.
*. You can: search, sort (by: relevance, view count, publication date and ratings), view videos uploaded by a certain user, go to next/previous track lists etc using the keyboard shortcuts.
*. If you use a desktop environment and use a Terminal emulator, then when you resize the Terminal’s window, “yt” will also resize its content to fit into the new size as well.
That’s pretty much it at the moment.
Installation in Ubuntu Linux ….
1. As said, it mainly has two dependencies. So before you can start using it, first you’ll have to install those dependencies in Ubuntu (or in whatever the GNU/Linux distribution that you use).
You might have them installed already, but just in case, open your Terminal window and enter the below commands to install them.
sudo apt-get install mplayer youtube-dl
2. Since it’s written in Python, you need another small utility to install it. For that, please use the below command.
sudo apt-get install python-setuptools
3. Now, go to this “yt” download page and get it and extract its content to your “Home” folder.
4. Now open your Terminal window and “change directory” to that folder. If you don’t know how to do it, then use the below command (if you have a never version than the current one, then please rename the name accordingly).
5. Enter the below command to install it (finally! ;-)).
sudo python setup.py install
Now whenever you want to launch it, open your Terminal and enter the below command.
You can quit the application by pressing “q” or “Ctrl” + “c” keys.
If you want, you can search for a video upon launching the program (or you can use the built in search feature once it’s loaded as well). For instance, let’s say that I wanted to search for “ubuntu” and get videos for that term, then I’d use “yt” with the below format.
How to play a video?
Simple. Just press the playlist item’s number on your keyboard and it should start playing it in full screen (you can escape “full-screen” by pressing the “f” key).
For instance, to play the “3rd” item on the list, simply press “3” or to play the “5th”, press the number “5” etc. To stop playing a file, play the “q” key. As mentioned above, you can go up and down in a list (if the playlist items don’t fit into the Terminal window’s size) by using the “[” and “]” keys.
Getting rid of the extracted folder from your “Home” (no worries, it won’t remove the installed app!)
If you want to delete the extracted folder as keeping it in your pretty & well categorized “Home” folder (unlike mine ;-)) can be a bit of a distraction. For that, open your Terminal window and change your directly to that folder (as shown in step “4”) and enter the below command (otherwise, the file manager won’t be able to delete the folder).
sudo python setup.py clean
Now you can use “Nautilus” for deleting that folder.
That’s it. Enjoy!.
7 thoughts on “yt: YouTube Browser (Command-line) for Ubuntu Linux”
How tastefully minimalist! Thank YOU
You are welcome!.
if you trust pypy where anybody can upload his shit… you just can easier install and update it via pip:
so the hole process to instlal should be: sudo pip install whitey
how do you use youtube-dl with this interface 🙂
Actually, ‘yt’ only uses ‘youtude-dl’ for temporarily downloading files to disk, while playing them, and doesn’t save them to disk permanently if I’m not mistaken (it’s been a long time since I used it, so …)
hi! it seems that when I enter the name of a video, it says the “argument” isn’t recognized. Launching yt itself leads to youtube searching for a few seconds and then brings back to terminal.. any solution?