Skip to content

Instantly share code, notes, and snippets.

@chrisbward
Created October 22, 2020 09:02
Show Gist options
  • Save chrisbward/f39215b1fc07c4c7ffdf66c550ed8459 to your computer and use it in GitHub Desktop.
Save chrisbward/f39215b1fc07c4c7ffdf66c550ed8459 to your computer and use it in GitHub Desktop.
youtube-dl music
#!/bin/bash
# you will need to have youtube-dl (pip) and dialog (apt-get) installed
exec 3>&1;
result=$(dialog --title 'youtube-dl music downloader' --inputbox 'enter youtube url' 0 0 2>&1 1>&3);
exitcode=$?;
exec 3>&-;
# echo $result $exitcode;
youtube-dl -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 $result
@chrisbward
Copy link
Author

needs;

  • checks to see if binaries are on system
  • supress youtube-dl output
  • pipe progress to pv
  • exit cleanly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment