Download YouTube videos in qutebrowser – YouTube

I’ve been using qutebrowser since 2017 on and off. But never adopted it fully. I guess part of it is because I’ve been using Firefox since 2003-4. And it is very hard to move on to any other browsers no matter what bad FF is. Anyhow, after not using qutebrowser for over a year, I guess, I came back to it recently again. I was playing around and then thought it would be a cool idea to integrate youtube-dl to it. So I documented what I did in a YouTube video. In this video, I explained how to download YouTube videos with a single keystroke in qutebrowser.

The video is only 9 minutes long and I explained whatever needed.

https://www.youtube.com/watch?v=Cjft7F8qsao

But for those who want TL;DR version, here it’s.

First of all, you need to have youtube-dl installed. If you don’t have don’t worry, install it with pip like this:

$ pip install --user youtube-dl

First of all, clone mydotfiles GitHub repository,

$ git clone https://github.com/kasramp/mydotfiles.git

Then go to .config/qutebrowser directory and copy config.py to your qutebrowser config directory.

NOTE: Before proceeding further, make a backup of your current configurations. Otherwise, you will lose them.

$ cp config.py ~/.config/qutebrowser

The next step is to copy the youtube_downloader.sh and youtube_mp3_downloader.sh bash scripts. They are located under the .local/share/qutebrowser/userscripts/ directory of mydotfiles repo. Copy them to your local directory.

$ cp mydotfiles/.local/share/qutebrowser/userscripts/* ~/.local/share/qutebrowser/userscripts/

At the end then make them executable,

$ chmod a+x ~/.local/share/qutebrowser/userscripts/*.sh

Keybindings

  • xv downloads a YouTube video in command mode
  • Xv downloads a YouTube video in hints mode
  • xa gets a mp3 version of the video in command mode
  • Xa gets a mp3 version of the video in hints mode

Shortcuts

The qutebrowser shortcuts may be very daunting at first. But don’t worry once you get started you will get used to them very easily. They are not much different than Vim 🙂

Anyhow, this cheat sheet may come handy.

Inline/featured images credits