function download_audio() { format="$1" shift youtube-dl \ --extract-audio --audio-format "$format" --audio-quality 0 --no-call-home \ --restrict-filenames --ignore-errors --add-metadata "$@" } function rip() { : "${format:=opus}" if [ "$#" -ne 1 ]; then download_audio "$format" $(xclip -o -selection clipboard) else download_audio "$format" "$@" fi } function ripto() { mkdir $1 pushd $1 rip $2 popd }