Skip to content

Instantly share code, notes, and snippets.

@zekroTJA
Created March 12, 2021 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zekroTJA/aa0a38d2550e9850fde2786107385ba7 to your computer and use it in GitHub Desktop.
Save zekroTJA/aa0a38d2550e9850fde2786107385ba7 to your computer and use it in GitHub Desktop.
Small bash script to download a whole YouTube playlist via youtube-dl and convert it to a desired format using ffmpeg.
FORMAT="ogg"
[ -z $2 ] || FORMAT=$2
youtube-dl -citx $1
mkdir out
for F in *; do
case "$F" in
(*.bash | *.sh) continue;;
*)
FNAME="${F%.*}"
ffmpeg -i "$F" "out/$FNAME.$FORMAT"
;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment