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 6,427 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,890
- 56
- 97
- 151
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,626
- 3
- 24
- 46