Or more precise, how to do so without accessing 3rd-party websites such as YouTube-MP3.org.
The method I’ll be walking through in this post is enabled by the free and brilliant youtube-dl command-line program. For the non-nerds, they have a Windows executable which should make it easy enough to figure out (haven’t tried personally).
While setting it up for my non-nerdy SO, I realised how intimidating a command-line program was to the general population. So decided to share a quick tutorial on how to make this process as simple and straightforward as possible on the macOS.
Install Homebrew. Paste the following into the Terminal and press enter.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install youtube-dl. Paste the following into the Terminal and press enter.
brew install youtube-dl
Open your text editor. Paste the following into the text editor and save it as youtube-dl.conf.
--x --extract-audio --audio-format mp3 -o ~/Downloads/%(title)s.%(ext)s
In the Finder window, press ‘CMD + SHIFT + G’ and paste the following to go to the folder.
Move the youtube-dl.conf file to this folder.
Next time you want to download a YouTube video as MP3, just launch the terminal and type the following;
Of course, replace the above YouTube URL above with the one you actually want to download. The program will then download and save the selected YouTube video as a MP3 file in your Downloads folder.
If you just want to download the video without converting it to MP3, you can use the following command to ignore the default configuration file.
youtube-dl --ignore-config https://www.youtube.com/watch?v=dQw4w9WgXcQ
The file will be saved in your home folder as a MP4 file.
18 September 2017