Ubuntu: How to download an entire YouTube playlist as a single mp3 file? [duplicate]



Question:

This question already has an answer here:

What are recommended solutions to download an entire YouTube playlist as a single .mp3 file? I open to solutions other than youtube-dl.


Solution:1

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  


Solution:2

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  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »