Use this knowledge at your own risk.
youtube-dl will allow you to download entire youtube playlists and store them as MP3s. This will also allow you to download individual MP3s.
You can get it here from their official web-site. Place it somewhere familiar (Recommending C:/youtube-dl/youtube-dl.exe)
You can get it here from FFMPEGs web-site.
Rename the unzipped folder to "ffmpeg" and place it somewhere familiar (Recommending C:/ffmpeg/).
Search for Environment
and choose Edit the system environment variables
option.
Press the Environment Variables...
button.
Double-click the Path variable, in the top section.
Select New
and add C:/ffmpeg/bin/
.
Do the same for C:/youtube-dl/
.
The contents of the folders will now be accessible directly without having to specify the path, the next time you open powershell/cmd.
We need to create bat script that will store all the information we need to quickly and easily download music from YouTube. Create a new file and name it 'youtube-mp3.bat'. Put it in the same folder as youtube-dl.exe (from step 1).
for %%a in (%*) do (
.\youtube-dl.exe ^
--extract-audio ^
--audio-format mp3 ^
--output "Music/YouTube/%%(playlist_title)s/%%(playlist_index)s - %%(title)s.%%(ext)s" ^
%%a
)
- Remember to add your own windows username in YOUR-USERNAME-HERE.
- If you wish to change the formatting of the output files, you can learn more about it here.
- If it cannot find ffmpeg, then you most likely did not correctly add C:\ffmpeg\bin\ to PATH environment. Search for a solution.
In order to start downloading music, you need to open up a command prompt or Windows PowerShell. In Explorer, navigate to the folder with the youtube-mp3.bat script. Hold left-shift and right mouse click in the folder (Not directly on an item). Select 'Open PowerShell Window here', or the 'Command Prompt' equivalent.
To download youtube music, run:
.\youtube-mp3.bat [URL-TO-YOUTUBE-PLAYLIST]
- Keep in mind that it must be an URL to the playlist itself, and NOT a video in a playlist!
For example:
.\youtube-mp3.bat https://www.youtube.com/playlist?list=PLYPeGyDTfTSuyzSADAeZiuR28F1PkXERE
You can also add multiple URLs and playlists, separated only by a space:
.\youtube-mp3.bat [URL1] [URL2] [URL3]
For example:
.\youtube-mp3.bat https://www.youtube.com/playlist?list=PLYPeGyDTfTSuyzSADAeZiuR28F1PkXERE https://www.youtube.com/watch?v=qRC4Vk6kisY https://www.youtube.com/playlist?list=PLthjj8uzMeTVDDlXYmxOqN5Uvfj2OXpmg
If you open up a text editor, you can prepare all your URL in a similar fashion:
.\youtube-mp3.bat ^
[URL1] ^
[URL2] ^
[URL3]
You can get it here from their official web-site. Place it somewhere familiar (Recommending /usr/local/bin/youtube-dl)
On Ubuntu/Linux Mint based systems, open the terminal and run: sudo apt-get install ffmpeg -y
We need to create a bash script that will store all the information we need to quickly and easily download music from YouTube.
sudo touch /usr/local/bin/youtube-mp3
Adding it in /usr/local/bin will allow you to access it without having to specify a path.
In this example we will be using nano. Feel free to use whatever editor you want, however.
sudo nano youtube-mp3
If nano does not work for you, you can install it by running: sudo apt-get install nano -y
.
#!/bin/bash
for i in "$@";
do
youtube-dl --extract-audio \
--audio-format mp3 \
--output "~/Music/%(playlist_title)s/%(playlist_index)s - %(title)s.%(ext)s" \
"$i"
done
- Feel free to change the path however you wish. ~/ will be within your users home directory.
- If you wish to change the formatting of the output files, you can learn more about it here.
- If you have any issues, feel free to comment about it.
In order to start downloading music, simply run in the terminal: youtube-mp3 <link to youtube-video or playlist>
.
To download youtube music, run:
youtube-mp3 [URL-TO-YOUTUBE-PLAYLIST]
- Keep in mind that it must be an URL to the playlist itself, and NOT a video in a playlist!
For example:
youtube-mp3 https://www.youtube.com/playlist?list=PLYPeGyDTfTSuyzSADAeZiuR28F1PkXERE
You can also add multiple URLs and playlists, separated only by a space:
youtube-mp3 [URL1] [URL2] [URL3]
For example:
youtube-mp3 https://www.youtube.com/playlist?list=PLYPeGyDTfTSuyzSADAeZiuR28F1PkXERE https://www.youtube.com/watch?v=qRC4Vk6kisY https://www.youtube.com/playlist?list=PLthjj8uzMeTVDDlXYmxOqN5Uvfj2OXpmg
If you open up a text editor, you can prepare all your URL in a similar fashion:
youtube-mp3 /
[URL1] /
[URL2] /
[URL3]
Worth mentioning that if you add the /youtube-dl/ folder to path environment (similar to ffmpeg folder), you can run youtube-mp3.bat from anywhere. (But you might have to remove the ./ infront inside the script.