The post Youtube-dl: download audio-only files from YouTube on Mac appeared first on ma.ttias.be.
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 3UOtF4J9wpo: Downloading webpage 3UOtF4J9wpo: Downloading video info webpage 3UOtF4J9wpo: Extracting video information 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!
The post youtube-dl: download audio-only files from YouTube on Mac appeared first on ma.ttias.be.
This post first appeared on Ma.ttias.be ~ The Web, Open Source, PHP, Security,, please read the originial post: here