Watch & Download YouTube Videos In Linux Terminal Using YTFZF
If you’re a terminal enthusiast who wants to watch YouTube videos without opening a browser or calling API, then ytfzf is the latest command-line utility of your interest.
ytfzf is simply a POSIX script that lets you search, play, and download YouTube videos without leaving the terminal.
It is available for all Unix-like operating systems including Linux and macOS. However, the thumbnail preview feature is currently unavailable on macOS.
How To Install YTFZF Video Downloader?
The easiest way to get ytfzf on any OS is first by cloning the repository and then installing with the Makefile.
$ git clone https://github.com/pystardust/ytfzf
$ cd ytfzf
$ sudo make install
If you use Arch Linux, then ytfzf is already available in the AUR repo, which you can install by running the command:
$ yay -S ytfzf-git
After the utility installation, you also need to install dependencies it make use of such as:
mpv
video playeryoutube-dl
for downloading videosfzf
for menu (optional)jq
to parse JSON dataueberzug
for thumbnails (optional)
$ sudo apt install jq mpv youtube-dl fzf
For Debian-based distros, you should install youtube-dl from its official repo as Debian repos contain its outdated version.
And if you want to search videos with thumbnails, you also need to install Ueberzug utility:
$ pip install ueberzug
Features Of YTFZF Video Downloader
Once you properly install ytfzf, you can start searching for YouTube videos by running ytfzf
or ytfzf <query>
command:
If you also want to see the thumbnail preview, you can use -t
flag as ytfzf -t <query>
.
As you can see, it lists the top result in the right panel and thumbnail preview of the current videos in the left panel.
You can select the video to play it using the default MPV video player. Key binding for MPV player is also available such as f
for full-screen, J
for subtitles, and L
for single-loop.
If you want to quit from the video selection prompt, you can either press ESC or CTRL + C.
Besides, it also lets you queue videos using fzf multi-select option. You can Press the tab to select a video and line it up in mpv.
Ytfzf is still under continuous development. If you want to contribute or know more about it like changing configuration, check out the official repository.