roboone_auto_dataset / modules /download_from_youtube.sh
nyxrobotics's picture
Download videos without audio
f8a38ca
raw
history blame contribute delete
610 Bytes
#!/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