Browsing YouTube in the terminal

Kashif
3 min readMay 25, 2021
me checking out the latest videos on my subscriptions

A few days back I came across an interesting project on git known as ytfzf. To cut things short it scrapes youtube videos without using its API and lets you view videos with thumbnails and download them through youtube-dl.

Sounds interesting right. So I went ahead and gave this script a short.

The installation was pretty simple. It needs four things to work out of the box.

Youtube-dl, fzf, mpv and ueberzug

If you’re on arch, installation is pretty simple,

sudo pacman -S youtube-dl fzf mpv ueberzug

and for the main script, we’ll use AUR. I’m using the paru helper for AUR so it goes this way

paru -S ytfzf

After the installation, you can use ytfzf right away.

What makes ytfzf really cool is videos can be searched and played and downloaded all from the terminal without opening the browser.

All arguments ytfzf — help

To search you simply type in
ytfzf “search query” -t

here the search query is the video that you are looking for and -t argument lets you display the thumbnails of the video.

The search query generates a video list with thumbnails in the above command. Now to simply play the video press Enter and we’ll have our video playing on MPV player.

Trending videos show up

ytfzf -Tt

to see trending videos with thumbnails

You can use this script as a music player too.

Ytfzf -ml “search query”

the m arguments only plays audio from a video and the l argument takes you back to the search after audio playback is over.
Music opens up in the background in MPV

Subscriptions can be added too

you can add your preferred channels too by using the config file at

~/.config/ytfzf/subscriptions

You need to go to youtube, to the videos section of the channel and copy the URL there and paste it into the subscriptions file and save it.

“Ytfzf -St”

the -S will show the 10 results from subscriptions along with the t argument it also shows thumbnails.

-d for downloads

downloading videos is pretty simple you just need to add the -d argument to search and the video will get downloaded.

To conclude the ease with which ytfzf works is amazing, I personally have been using it for music and it works fabulously instead of going to youtube. It’s fast and does the job. This is my go-to for youtube now.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response