Run yourube-dl in parallel

You can use youtube-dl to download individual videos, or you can ask it to download an entire playlist. When it’s downloading a playlist, it downloads the individual videos one-by-one, which isn’t particularly fast.

Here’s a shell snippet that downloads playlist videos in parallel, which is faster:

1youtube-dl --get-id "$PLAYLIST_URL" \
2  | xargs -I '{}' -P 5 youtube-dl 'https://youtube.com/watch?v={}'

The first command (--get-id) gets a list of video IDs in the playlist, one per line. Those IDs get piped to xargs, which calls individual instances of youtube-dl to download each video. Because I’m passing -P 5 to xargs, it runs up to 5 parallel instances of youtube-dl at a time.

Original article https://alexwlchan.net/2020/07/how-to-do-parallel-downloads-with-youtube-dl/