Playlistsĭownload a YouTube playlist with the videos being 1080p and the best audio. Get the best audio into mp3 file: yt-dlp -f 'ba' -x -audio-format mp3 -o '%(id)s.mp3'Īll the options for format selection and filtering can be found here, There are a lot.
Save this file as video_id.extension (1La4QzGeaaQ.mp4): yt-dlp -f "best" -o '%(id)s.%(ext)s'ĭownload and merge the best video stream with the best audio stream: yt-dlp -f 'bv*+ba' -o '%(id)s.%(ext)s'ĭownload 1080p video and merge with best audio stream: yt-dlp -f 'bv*+ba' -o '%(id)s.%(ext)s'ĭownload 1080p video that is mp4 format and merge with best m4a audio format: yt-dlp -f 'bv+ba' -merge-output-format mp4 -o '%(id)s.mp4'Įmbed video thumbnail into video file use -embed-thumbnail: yt-dlp -f 'bv+ba' -embed-thumbnail -merge-output-format mp4 -o '%(id)s.mp4'Įmbed subtitles to video file (if they exist) -embed-subs : yt-dlp -f 'bv+ba' -embed-subs -merge-output-format mp4 -o '%(id)s.mp4'Įmbed metadata about the video -embed-metadata : yt-dlp -f 'bv+ba' -embed-metadata -merge-output-format mp4 -o '%(id)s.mp4'
Print JSON information for the video and audio streams: yt-dlp -dump-json Single video or audio downloadsĭownload the best format (video + audio) that is equal to or greater than 720p width. Print out the available formats and information with: yt-dlp -list-formats
If you ever need to update yt-dlp use: yt-dlp -U Installing yt-dlp can simply be done with: sudo wget -O /usr/local/bin/yt-dlpįollowed by: sudo chmod a+rx /usr/local/bin/yt-dlp Yt-dlp is a fork from the now troubled youtube-dl, the best part about yt-dlp aside from being actively maintained is that it follows similar commands to youtube-dl. In order to start downloading music, simply run in the terminal: youtube-mp3. If you have any issues, feel free to comment about it.~/ will be within your users home directory. Feel free to change the path however you wish.output "~/Music/%(playlist_title)s/%(playlist_index)s - %(title)s.%(ext)s" \
If nano does not work for you, you can install it by running: sudo apt-get install nano -y. Feel free to use whatever editor you want, however. We need to create a bash script that will store all the information we need to quickly and easily download music from YouTube.Īdding it in /usr/local/bin will allow you to access it without having to specify a path. On Ubuntu/Linux Mint based systems, open the terminal and run: sudo apt-get install ffmpeg -y 3. Place it somewhere familiar (Recommending /usr/local/bin/youtube-dl) 2. If you open up a text editor, you can prepare all your URL in a similar fashion: You can also add multiple URLs and playlists, separated only by a space: Keep in mind that it must be an URL to the playlist itself, and NOT a video in a playlist!.Select 'Open PowerShell Window here', or the 'Command Prompt' equivalent. Hold left-shift and right mouse click in the folder (Not directly on an item). In Explorer, navigate to the folder with the youtube-mp3.bat script. In order to start downloading music, you need to open up a command prompt or Windows PowerShell. If it cannot find ffmpeg, then you most likely did not correctly add C:\ffmpeg\bin\ to PATH environment.If you wish to change the formatting of the output files, you can learn more about it here.Remember to add your own windows username in YOUR-USERNAME-HERE.output "Music/YouTube/%%(playlist_title)s/%%(playlist_index)s - %%(title)s.%%(ext)s" ^ Put it in the same folder as youtube-dl.exe (from step 1). We need to create bat script that will store all the information we need to quickly and easily download music from YouTube.Ĭreate a new file and name it 'youtube-mp3.bat'. The contents of the folders will now be accessible directly without having to specify the path, the next time you open powershell/cmd. button.ĭouble-click the Path variable, in the top section. Search for Environment and choose Edit the system environment variables option. Add the C:/ffmpeg/bin/ and C:/youtube-dl/ folder to PATH Rename the unzipped folder to "ffmpeg" and place it somewhere familiar (Recommending C:/ffmpeg/). You can get it here from FFMPEGs web-site. Place it somewhere familiar (Recommending C:/youtube-dl/youtube-dl.exe) 2. You can get it here from their official web-site. This will also allow you to download individual MP3s. Youtube-dl will allow you to download entire youtube playlists and store them as MP3s. Downloading Music Playlists from YouTube Disclaimer