Youtube - downloading a playlist - youtube-dl

I found the best solution after many attempts at solving this problem.

Installation and usage;

For Windows users:

Script:

youtube-dl --ignore-errors --format bestaudio --extract-audio --audio-format mp3 --audio-quality 160K --output "%(title)s.%(ext)s" --yes-playlist https://www.youtube.com/playlist?list={your-youtube-playlist-id}
  • Download youtube-dl.exe file from the offical site.
  • Dowload ffmpeg from the offical site for convert WebM to MP3 (Recomended build version)
  • Exctract all zip files and move youtube-dl.exe, ffmpeg.exe and ffprobe.exe files to the folder that where you want the downloaded MP3 files.
  • Open cmd (Windows terminal) in same folder.
  • Replace the script {your-youtube-playlist-id} parameter with your YouTube playlist id.
  • Run the script.

For macOS/Linux users:

Script:

youtube-dl --ignore-errors --format bestaudio --extract-audio --audio-format mp3 --audio-quality 160K --output "%(title)s.%(ext)s" --yes-playlist 'https://www.youtube.com/playlist?list={your-youtube-playlist-id}'
  • Open terminal and if you don't have Homebrew, install it. (Linux users can skip this step.)
  • Run brew install youtube-dl ffmpeg and install youtube-dl and ffmpeg for convert WebM to MP3. (Installation may take longer to install other dependencies.) (For Linux users: install youtube-dl ffmpeg)
  • Open a terminal in the folder where you want to download the MP3 files.
  • Replace the script {your-youtube-playlist-id} parameter with your YouTube playlist id.
  • Run the script.

I have tried everything above, but none could solve my problem. I fixed it by updating the old version of youtube-dl to download playlist. To update it

sudo youtube-dl -U

or

youtube-dl -U

after you have successfully updated using the above command

youtube-dl -cit https://www.youtube.com/playlist?list=PLttJ4RON7sleuL8wDpxbKHbSJ7BH4vvCk

In a shell, & is a special character, advising the shell to start everything up to the & as a process in the background. To avoid this behavior, you can put the URL in quotes. See the youtube-dl FAQ for more information.

Also beware of -citk. With the exception of -i, these options make little sense. See the youtube-dl FAQ for more information. Even -f mp4 looks very strange.

So what you want is:

youtube-dl -i -f mp4 --yes-playlist 'https://www.youtube.com/watch?v=7Vy8970q0Xc&list=PLwJ2VKmefmxpUJEGB1ff6yUZ5Zd7Gegn2'

Alternatively, you can just use the playlist ID:

youtube-dl -i PLwJ2VKmefmxpUJEGB1ff6yUZ5Zd7Gegn2