File size: 610 Bytes
f1a4c9d
 
f8a38ca
 
f1a4c9d
 
 
 
 
 
 
 
f8a38ca
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
# 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