In a world where almost everything happens on the web, finding tools that don't depend on a browser is getting more and more difficult. Yes, well, I'm exaggerating a bit, but a lot of the time we spend in front of a computer is spent in a web browser. But if there is something that Linux users like, it is to complicate things to do everything from the terminal. Complicate or simplify, depending on how you look at it, and ytfzf is one of those tools that those who prefer low resource consuming applications and CLI-like tools will love.
ytfzf is a "POSIX Script that helps you find Youtube videos (without API) and opens/downloads them using mpv/youtube-dl", although they have to update the last part of their tagline as it now uses yt-dlp. Everything he does is done from the terminal, or almost everything, since to view the videos MPV strip. Its use is simple, and its interface is very interesting, at least if we are in X11 or using one of the compatible tools to show the thumbnails under Wayland.
Install and use ytfzf
ytfzf It is usually available in official repositories of Linux distributions, so its installation is as simple as going to a terminal and typing sudo apt install jq curl mpv fzf for Ubuntu based systems. It can also be searched in some software stores. Regarding dependencies, it is recommended to install yt-dlp and ueberzugpp, which will display the thumbnails as shown in the header screenshot.
Once installed, as with any CLI tool, you have to launch the script from the terminal. It can be done by typing ytfzf and a search, but that way we will see everything too simple. It is worth at least using the flag -t before the search. That "t" is for "thumbnails", that is, so that show thumbnails. By default, with ueberzugpp we will only see them if we are in X11. To view them under Wayland, you must have one of the compatible options installed, such as kitty, iterm2, sixel (these three require ueberzugpp), chafa, catimg, imv, mpv (although this hasn't worked for me) and swayimg for Wayland or hyprland.
flags and examples
There are two flags with the "t": the lower case and a search shows thumbnails by default; with -T we will indicate the thumbnail viewer to use, for example ytfzf -T kytty Linux will search for Linux videos showing thumbnails using kitty. The most common flags are:
- -d: will download instead of passing it to MPV for viewing. For this to work you need to have yt-dlp installed.
- -m: will only play audio on the terminal.
- -l (it's a lowercase L): it will return us to the list after finishing the playback.
- -L: will display the link of the selected videos.
- -a: will automatically select the first video in the list.
- -r: Will automatically select a random video from the list.
- -co: Search Oddysee instead of YouTube.
- -s: after playing a video, it will return us to a window to perform searches. With this we avoid having to launch ytzf again when finishing a video/audio.
For example, if we want to search for videos about Linux, that it plays the first one in the list and that at the end of an audio it plays the next one, we would write
ytfzf -lam Linux
The above is probably not the best possible example, since Linux is a very generic topic and can put anything at us. But everything changes when we want something more concrete. If we want to hear a famous song, I don't know, “Nothine Else Matters”, ytfzf -sam nothing else matters will play the first result, probably the Metallica song, only in audio and, when finished, it should return us to the menu to find another option.
Although it is true that this tool works quite well, it is also true that the searches are not as precise as those that we can do on the official YouTube website, which also uses the Google search engine. But the option exists, and it is worth it for many reasons.
More information, in project GitHub page.