Created
August 13, 2012 20:15
-
-
Save thecarlhall/3343807 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get install ffmpeg youtube-dl | |
$ sudo install youtube2mp3 /usr/local/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ youtube2mp3 http://www.youtube.com/watch?v=zYXjLbMZFmo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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