Simple YouTube download script

Packages zenity, xsel, xterm and youtube-dl or yt-dlp must be installed.

Copy video address and choose ”Yes” for downloading the video. Video goes to the same directory, where the script is.

The script:

#!/bin/bash
video=$(xsel --clipboard)
inputStr=$(zenity --entry --title="Youtube lataaja" --text="Laita videon osoite allaolevaan laatikkoon:")
zenity --info --text="Laittamasi osoite = $inputStr"
xterm -e youtube-dl $video && zenity --info --text "Video ladattu!" && xdg-open $PWD
exit 0

Edit 6.11.2021: YouTube has made some changes, so if downloading videos using youtube-dl, the speed is slow. Fortunately there is a new program, yt-dlp, which works fine.

The script for yt-dlp

#!/bin/bash
video=$(xsel --clipboard)
inputStr=$(zenity --entry --title="Youtube lataaja" --text="Laita videon osoite allaolevaan laatikkoon:")
zenity --info --text="Laittamasi osoite = $inputStr"
xterm -e yt-dlp $video && zenity --info --text "Video ladattu!" && xdg-open $PWD
exit 0

If yt-dlp is not foud from your package management, you can find the package from pkgs.org

Video-lataaja.tar

To disable Webm video download in youtube-dl

To disable Webm video download in yt-dlp

For Mint 19 and Ubuntu Mate 18.04 has no yt-dkp package, but it can be converted using Alien from openSUSE Leap 15.2 package.

toimiva-yt-dlp.tar.gz