The simplest youtube-dl GUI you've ever seen!
James
youtube-dl homepage: https://youtube-dl.org/ zenity: https://help.gnome.org/users/zenity/stable/
The code (requires zenity, xdg-users-dirs tools, and of course youtube-dl itself):
#! /usr/bin/bash
set -eo pipefail
url="$(zenity --entry --title 'youtube-dl' --text 'Paste URL here:')"
selection=$(zenity --list --radiolist --hide-header --title 'youtube-dl' \
--text 'Download video or only audio?' --column 'button' --column \
'type' '' 'Video & Audio' '' 'Audio Only')
if [[ $selection == 'Audio Only' ]]; then
opts='-x --audio-format best'
fi
destination=$(xdg-user-dir DOWNLOAD)
youtube-dl $opts "${url}" -o "${destination}/%(title)s.%(ext)s" \
| zenity --progress \
--title "youtube-dl" \
--text 'Downloading...' \
--pulsate \
--auto-close \
--auto-kill \
&& zenity --info \
--ellipsize \
--title 'youtube-dl' \
--text "Downloaded to ${destination}"
2021-05-05
5.05256878 LBC
None
131269162 Bytes