What are recommended solutions to download an entire YouTube playlist as a single .mp3
file? I open to solutions other than youtube-dl
.
Asked
Active
Viewed 5,591 times
2 Answers
6
You can download playlists with youtube-dl
in MP3 format as described in how to download playlist from youtube-dl?, e. g.:
youtube-dl -cix --audio-format mp3 -o '%(playlist_title)-%(playlist_id) - %(playlist_index) - %(title)-%(id).%(ext)' -- 'https://www.youtube.com/playlist?list=PLttJ4RON7sleuL8wDpxbKHbSJ7BH4vvCk'
You can then use FFmpeg to concatenate those files:
printf "file '%s'\n" *.mp3 | ffmpeg -f concat -i - -codec copy all.mp3
It's a little more difficult with Avconv since it doesn't support the concat
format:
avconv -i "concat:$(printf '%s|' *.mp3 | head -c -1)" -codec copy all.mp3

David Foerster
- 36,264
- 56
- 94
- 147
-
-
1I tried those commands while writing the answer and they work as expected – David Foerster Mar 04 '16 at 18:30
-
Is it worthwhile to add
--audio-quality xx
to the youtube-dl commandline? – andrew.46 Mar 04 '16 at 23:34 -
1
youtube-dl
downloads the best quality by default. It is up to you if you want to specify the quality – Mostafa Ahangarha Mar 05 '16 at 14:19
1
If you download each individual video as an .mp3
you can just run this command to combine them:
cat 1.mp3 2.mp3 3.mp3 4.mp3 [and so on] > combined.mp3

Daniel
- 3,446
-
Have you ever done this before and were you able to then play the
combined.mp3
without issue? – earthmeLon Mar 04 '16 at 17:21 -
1
youtube-dl
. – orschiro Mar 04 '16 at 21:05youtube-dl
isn't a good solution. The reason there aren't any other solutions is that they are unnecessary because a perfectly usable tool already exists. – Durandal Mar 04 '16 at 21:34deb
packages for easier installation in the near future. – orschiro Mar 05 '16 at 13:16