Search YouTube Videos from the Command Line with Videotop

If you’re a true command-line junkie, you know you can write programs, check your email, even play games without the need for graphics. But you can also surf YouTube videos with Videotop.

Videotop lets you surf YouTube videos from the command line using an interface similar to the popular text editor Vim. Like Vim, it uses the concept of modes. You switch from search mode to browse mode and back again.

Videotop Screenshot

Installing it is easy if you have knowledge of the command line and Python. If you’re interested in something like this, you probably are. There are a few dependencies you’ll need to have installed. The first is Urwid, a front-end to Curses, a library that’s used extensively for text-based programs like Irssi and Vim to implement the interface. The other one is Gdata, Google’s collection of library interfaces for Python, which includes YouTube. And to download the YouTube videos, you’ll need Youtube-dl. It can be a little tricky to get these installed. There’s a reason geeks call this “dependency hell.”

In search mode, you actually search for videos, as the name says. The search command is almost straightforward. You just enter “:s”. To see all the videos you’ve downloaded so far, just enter “:v”. You can also enter a colon followed by a number to jump straight to the video you want.

In browse mode, you can navigate the list of videos, clear the list if you don’t want shoulder surfers to see what you’re searching for on YouTube, download the videos, and play the videos in Mplayer if you have the advanced player installed on your system. YouTube might seem something that’s designed for the graphical world, but this looks like a fun way to do something a little different. And sometimes you really do want a copy of the video on your hard drive.

We covered other command-line based apps you can use, and even a way to use Twitter from the command line. If you liked this, you should check out our post on Telehack, a recreation of the Internet as it existed in the late ’80s and early ’90s.