There are many sites where people often wish to download MP3s from YouTube however they are left with a compressed mess which not only sounds bad but it simply isn’t worth the hassle when there are services like Spotify. I came across a tool called `youtube-dl` which at first, looked like it didn’t do much. Upon further investigation, not only could you download videos from various sites (including YouTube), you could strip the audio content from a video which gives you an acceptable VBR MP3 file (rougly 230kbps to 300kbps).
Many sites are notorious for offering 128kbps audio however they compress the already compressed file even more which results in an unpleasant listening experience.
To use this script, you should have either Linux or MacOS however it is possible to get it working on Windows as well. I haven’t created a script for Windows however if you happen to have youtube-dl working on Windows, you can execute this command:
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 <url> Be sure to replace <url> with your YouTube or other media link.
The script can be downloaded from here: https://github.com/onlyabyte/mp3dl
What’s the point of this script?
Instead of typing/pasting out the same long command out, I wanted to make it simple and save time for the user.
Can I use it without the script?
Yes, you can use the command as is:
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 <url>
- Be sure to download and install youtube-dl from here http://rg3.github.io/youtube-dl/download.html
- Once it is installed and working, go ahead and download this shell script from here. Alternatively, you can also download it from the github page if you want to inspect the code https://github.com/onlyabyte/mp3dl
- Download the script from either of the locations (MEGA or GitHub)
- Navigate to where you downloaded the script and run:
chmod +x mp3dl.sh
- Copy the script to
/usr/binor run the command
cp mp3dl.sh /usr/bin
mp3dl.shand it will prompt you to paste your YouTube URL. Paste it and hit enter.
- By default, it will download the MP3 into your current directory. So if you want to download it into
~/Music/then just navigate into that directory.