Generally, it's only illegal if the content is copyrighted and you didn't have permission to make copies of it. If you're downloading a YouTube video for personal use, it doesn't break anything.