{ datagubbe }

datagubbe.se » tube - youtube cli

tube - Youtube CLI

tube is a Python script for extracting video metadata (I.E. the actual video stream URL) from an arbitrary Youtube (youtube.com, youtu.be) URL and then launch a player of choice (such as MPV or VLC) to watch the video.

In tube version 1.0.15, a rudimentary and experimental function for searching Youtube was added.

Together with tubeshell, a small bash script providing a readline-style shell for tube, it is an easy way of watching videos and handling tube's built-in history function, which stores previously watched videos.

tube does not handle Google accounts or API tokens, and it doesn't download the video stream - it simply facilitates viewing it. It is intended as a way of enjoying publicly available videos without the distraction of algorithmic content suggestions and autoplaying of suggested videos. A suitably pruned tube history will instead serve as a searchable library of interesting videos worth returning to and re-watching.

tube has been developed on and for Linux, but will probably work on other Unix-like systems as well. tube and tubeshell are both released under the MIT license. tube requires Python 3.5 to work and is linted with these settings. tubeshell is linted with shellcheck.

I surprised myself greatly with this little piece of software: since I wrote it, I have been using it (almost) every day, adding features and polishing the existing ones to my suit my personal preference. Perhaps someone else will find it useful, too.


The latest release is v1.0.20 (2020-10-23)


Screenshot of tubeshell running inside xterm, showing a tube search for Keferens Desert Dream
Example tubeshell session, showing the search function.