- download & install youtube-dl (https://github.com/rg3/youtube-dl/blob/master/README.md#readme)
(for mac:
brew install libav
&brew install youtube-dl
) - add the following function to your shell env:
ytdl() {
youtube-dl -x --audio-format=mp3 --no-playlist -o "$1.%(ext)s" $2
}
- use it like so:
ytdl "Hello - World" http://link.to/youtube-vid
(playlist can be appended, it will be ignored)