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,048 times
-1
orschiro
- 12,987
- 16
- 82
- 157
-
Dear @Ev1l0rd, I am open to solutions other than `youtube-dl`. – orschiro Mar 04 '16 at 21:05
-
What works, that works. There is no reason `youtube-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:34
-
Another interesting option to look at is [alltomp3-cli](https://github.com/AllToMP3/alltomp3-cli). It aims to provide `deb` packages for easier installation in the near future. – orschiro Mar 05 '16 at 13:16
-
To reopen reviewer: This question is not the same as and requires at least one additional step compared to the supposed duplicate link. See [my answer](/a/742111) for an example. – David Foerster May 01 '21 at 00:37
-
So, a combination of the current dupe and https://askubuntu.com/q/20507? Can someone edit the dupe list here? – muru May 01 '21 at 06:08
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
- 35,754
- 55
- 92
- 145
-
-
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,400
- 2
- 22
- 43
-
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