# Options | |
readonly PLAYLIST_URL=https://youtube.com/playlist?list=PLwlIgd6_8FLJqgvIgtUye8Jz2jSKLrCAI | |
readonly NO_AUDIO=true | |
# ----- Start script ----- | |
# get playlist name | |
PLAYLIST_NAME=$(yt-dlp --no-warnings --dump-single-json --playlist-end 1 $PLAYLIST_URL | jq -r '.title') | |
echo "Playlist Name:" $PLAYLIST_NAME | |
# get script dir | |
SCRIPT_DIR=$(cd $(dirname $0); pwd) | |
mkdir -p $SCRIPT_DIR/../download/youtube/$PLAYLIST_NAME | |
cd $SCRIPT_DIR/../download/youtube/$PLAYLIST_NAME | |
if "${NO_AUDIO}"; then | |
yt-dlp -f "bv" $PLAYLIST_URL | |
else | |
yt-dlp -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]" $PLAYLIST_URL | |
fi | |