Skip to content

Instantly share code, notes, and snippets.

@fliphess
Created December 5, 2016 11:40
Show Gist options
  • Save fliphess/3ad032fdbc9bd0b2e992c0cb153e3a17 to your computer and use it in GitHub Desktop.
Save fliphess/3ad032fdbc9bd0b2e992c0cb153e3a17 to your computer and use it in GitHub Desktop.
Download youtube clips and save as mp3
#!/bin/bash
# Install youtube-dl first: `brew install youtube-dl`
URL="$1"
## Validate input
if [ "x$URL" == "x" ] ; then
echo "Usage: $0 <youtube url>"
exit 0;
fi
## Download file
cd ~/Music/downloads
youtube-dl "${URL}" --extract-audio --audio-quality 0 --embed-thumbnail --audio-format mp3 -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment