Music and videos from YouTube can be downloaded by means of websites and utilities, such as Savefrom. However, while technically legal, downloading material from YouTube is a direct contravention of their terms of service.
The applicable terms of service specify that the materials are to be viewed only as streaming video and not to be downloaded. This does leave downloads per se in an ambiguous area legally. There are dozens of websites and utilities that will convert YouTube videos into audio files easily. Many involve a simple one-step process of copying the URL and pasting it into a blank form on the utility website.
Downloads remain in a legal gray area only if they are used for personal viewing or listening purposes. Using them for any commercial or profitable purposes without copyright permission is outright illegal.