Skip to content

Instantly share code, notes, and snippets.

@thecarlhall
Created August 13, 2012 20:15
Show Gist options
  • Save thecarlhall/3343807 to your computer and use it in GitHub Desktop.
Save thecarlhall/3343807 to your computer and use it in GitHub Desktop.
$ sudo apt-get install ffmpeg youtube-dl
$ sudo install youtube2mp3 /usr/local/bin/
$ youtube2mp3 http://www.youtube.com/watch?v=zYXjLbMZFmo
#!/bin/bash
title=$(youtube-dl --get-title "$1")
x=".${title}.flv"
echo -e "Downloading $1 to $x\n"
[[ -f "$x" || $(youtube-dl --output="$x" --format=18 "$1") ]];
ffmpeg -i "$x" -f wav - | lame -h - "${title}.mp3"
rm "$x"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment