Download YouTube Music In One Command For FREE! No Websites Required

Опубликовано: 17 Ноябрь 2024
на канале: Michael Kakam
933
30

Hope you enjoyed the video!
Don't forget to like/dislike and subscribe!
Leave comments if you have any questions and want clarification.

Link to video on how to download multiple songs at once:    • Download YouTube Music Playlist for F...  

There are some cuts in the video during downloading songs. This is because it sometimes longer for the song to download due to my internet and I wanted to save you some watch time. The method does actually work as shown at the start.

Timestamps:
------------------------
0:00 Intro - what we are making
2:18 Downloading and installing Python and pip
4:28 Downloading and installing yt_dlp (python module for downloading youtube videos)
5:19 Downloading and 'installing' ffmpeg
6:51 Downloading video from youtube using what we installed
8:14 Shortening the command
11:23 Testing new shiny command
11:43 Outro

Commands/Scripts/Explanations/Links:
------------------------------------------------------------------
Downloading python at 2:18 - https://www.python.org/downloads/ → https://www.python.org/ftp/python/3.1...
Testing python got installed at 3:34 - [ python --version ] - quite self explanatory: asks python to tell us its version
Testing pip got installed at 3:59 - [ python -m pip ] - invokes pip's default behaviour on call, which is usually the same to a command's 'help'.
Installing yt_dlp at 4:38 - [ python -m pip install yt_dlp ] - using python's pip, install the 'yt_dlp' module
Testing yt_dlp got installed at 4:55 - [ python -m yt_dlp --version ] - quite self explanatory: asks yt_dlp, through python, what its version is
Downloading ffmpeg at 5:19 - http://ffmpeg.org/download.html#build... → https://www.gyan.dev/ffmpeg/builds/ → https://www.gyan.dev/ffmpeg/builds/ff...
Testing out ffmpeg got 'installed' at 6:39 - [ ffmpeg ] - gives information about ffmpeg
Downloading the audio of a video at 6:55 - [ python -m yt_dlp -x --audio-quality 0 -o "LOCATION OF FOLDER YOU WANT TO DOWNLOAD MUSIC TO\%(title)s.mp3" URL_OF_YOUTUBE_VIDEO ] - There are multiple parts to this command:
'python -m yt_dlp' - use yt_dlp in python with settings...
'-x' - extract only the audio from the specified video
'--audio-quality 0' - choose the highest quality audio file from the specified youtube video
'-o' - output the audio file to the folder I specify after this setting
'%(title)s.mp3' - give the audio file that's getting download the exact same name as it has on youtube; prefer its format to be mp3, however because of earlier settings, prefer it to be of higher quality.
What to put inside the 'aliases.cmd' file at 8:52 :
[
@echo off
doskey yt_mp3=python -m yt_dlp -x --audio-quality 0 -o "LOCATION OF FOLDER YOU WANT TO DOWNLOAD MUSIC TO\%%(title)s.mp3" $*
]
Inside of cmd files, the percentage sign (%) is a special character, so we need to escape/protect it with another percentage sign. Hence we need TWO of them in front of '(title)s.mp3'; the '$*' means that the alias 'yt_mp3' is expecting another argument to come after it (in our case, the youtube video URL).
Editing the command prompt shortcut at 10:09 : add the following after what is already there in the 'Target:' box: [ /k "C:\Users\YOUR USERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools\aliases.cmd" ] (note that this might need be different for you, so I advise you copy paste the path as I do in the video) - what this does is to say that any time cmd gets opened up through that shortcut, on opening it, call the 'aliases.cmd' file. The effect this has is that any time you open cmd through the start menu, 'yt_mp3' basically becomes a command.

Finally, to download the audio of a video from youtube at 11:23 - [ yt_mp3 YOUTUBE_VIDEO_URL ]

For all of the commands above, we could have also used 'youtube_dl' in palce of 'yt_dlp', however I found that the latter has faster download speeds.
Also, in any path we specify, we can exchange backslashes (\) with forward slashes (/). It rarely matters in this context.