YouTube, Offline and without Commercials

command-terminal-graphic

Grabbing YouTube Videos in Bulk

You can leverage this script when there are videos you would like to watch without commercials. However, grabbing a video one at a time is not appropriate. This is where I leverage a script (and an alias) to make shorter work of target acquisition. This will require that you have already installed yt-dlp on your computer. As always, our tutorials are written from a Linux perspective. If you are using Windows or MacOS, there may be approximations to the information we share below.

Start by navigating to the directory where you want the videos to be saved.
cd [/path/to/dir]

Then create a text file into which you will add the URLs of the videos you want. Add a URL to each line. Once you have completed your list, press ctrl+s to save the file and then ctrl+x to close the file. Using && will move to the next part of the script once the previous part has been completed successfully.

nano list && yt-dlp -a list && rm list

You will see yt-dlp actively download the video files. Once that is complete the script will then remove the list text file.

It is that simple. However, you can read on to learn how to make this simpler if this is something that you make do with frequency.

Making Shorter Work

Alternatively, you can shorten this process by rolling this script into an alias. Start by opening or creating a .bash_aliases file in your home directory.

nano .bash_aliases

Then add the following line to the file:

alias ytvid='cd [/path/to/dir] && nano list && yt-dlp -a list && rm list'

Save the file by pressing ctrl+s and close it with ctrl+x. Next run source ~/.bashrc to refresh the aliases and you are ready to go.

The next time you want to download one or many videos simply start with opening the terminal and executing ytvid. Enjoy!