I may or may not have become addicted to a particular video on YouTube, and I wanted to download the MP3 for offline use.
(Whether it’s allowed or not is up for debate, knowing copyright laws it probably depends per country.)
Luckily, I remember I featured a YouTube downloader once in cron.weekly issue #23 that I could use for this.
So, a couple of simple steps on Mac to download the MP3 from any YouTube video. All further commands assume the Brew package manager is installed on your Mac.
$ brew install ffmpeg youtube-dl
To download and convert to MP3:
$ youtube-dl --extract-audio --audio-format mp3 --prefer-ffmpeg https://www.youtube.com/watch?v=3UOtF4J9wpo [youtube] 3UOtF4J9wpo: Downloading webpage [youtube] 3UOtF4J9wpo: Downloading video info webpage [youtube] 3UOtF4J9wpo: Extracting video information [youtube] 3UOtF4J9wpo: Downloading MPD manifest [download] 100% of 58.05MiB [ffmpeg] Destination: 3UOtF4J9wpo.mp3 Deleting original file 3UOtF4J9wpo.webm
And bingo, all that remains is the MP3!