Skip to content

Instantly share code, notes, and snippets.

@joelhoelting
Last active February 23, 2022 10:30
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 joelhoelting/39002b5046510505098820e36c1dcaf1 to your computer and use it in GitHub Desktop.
Save joelhoelting/39002b5046510505098820e36c1dcaf1 to your computer and use it in GitHub Desktop.
Youtube to mp3 script for youtube-dlp
#!/bin/bash
function convert_link_to_mp3 {
echo "$1"
if [[ -n $1 ]]; then
youtube_link=$1
else
read -pr "Youtube link: " youtube_link
fi
echo "Attempting to download $youtube_link"
yt-dlp -f 'ba' -x --audio-format mp3 "$youtube_link" -P /Users/joelhoelting/Music/youtube2mp3 -o "%(title)s.%(ext)s"
}
convert_link_to_mp3 "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment