youtube-dl is legal to use as long as you comply with copyright laws and the terms of service of the platforms you are downloading content from. It is primarily intended for personal and educational use.