YOUTUBE-DL SCRIPT
This script works around "youtube-dl", simply save it as a .command file an run it. It allows to download automatically all the videos saved in a youtube playlist, so that you can keep
adding videos to your personal playlist while browsing and then download/sync everything at once by a simple click.
p="/Users/aaa/Documents/Media/Playlist_YouTube"
u="https://www.youtube.com/playlist?list="
a="YTDL_index"
f="m4a"
echo --- Download from YouTube
cd $p
youtube-dl -c --geo-bypass --embed-thumbnail --yes-playlist --extract-audio --audio-format $f --audio-quality 0 --download-archive $a --output "%(title)s.%(ext)s" $u
count=$(ls -1 | grep '\.m4a$' | wc -l)
if [ $count != 0 ]
then
open .
exit
fi
read -rn1 -p "-- press 'o' to open destination folder or any other key to exit: " ans
if [[ $ans = o ]] ; then
open .
fi
exit