Skip to content

Instantly share code, notes, and snippets.

@yoshi314
Created January 6, 2022 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoshi314/fa7233df33223394dc674e70b1dcf6c3 to your computer and use it in GitHub Desktop.
Save yoshi314/fa7233df33223394dc674e70b1dcf6c3 to your computer and use it in GitHub Desktop.
youtube-parallel-playlist-download
#!/bin/bash
# download youtube playlist in multithreaded fashion
YOUTUBE_DL=yt-dlp
YOUTUBE_DL_ARGS="-x --audio-format mp3 --add-metadata"
JOBS=10
tempfile=$(mktemp)
[ $# -gt 0 ] || exit 0
url=$1
echo "getting ids for the playlist"
$YOUTUBE_DL --get-id ${url} > $tempfile
parallel -j $JOBS -a $tempfile $YOUTUBE_DL $YOUTUBE_DL_ARGS
rm $tempfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment