Skip to content

Instantly share code, notes, and snippets.

@stesh
Created January 29, 2014 22:37
Show Gist options
  • Save stesh/8698674 to your computer and use it in GitHub Desktop.
Save stesh/8698674 to your computer and use it in GitHub Desktop.
youtube2mp3
#!/bin/bash
[ -z "$1" -o -z "$2" ] && (
cat <<EOF >&2
Usage: $0 <YouTube URL> <filename>
EOF
exit 1
)
URL="$1"
OUTFILE="$2"
TMPFILE="$OUTFILE.$$.tmp.flv"
youtube-dl -o "$TMPFILE" "$URL"
ffmpeg -i $TMPFILE -ac 2 -ab 196608 -vn -y $OUTFILE
rm $TMPFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment