It's usually only illegal if the content is copyrighted and you didn't have permission to share copies of it. It is entirely legal to download YouTube videos for personal use.