Luckily, we have an even safer method when it comes to downloading Youtube video or music, which is guaranteed not to infringe on any laws or terms. In recent years, the company has implemented a feature that allows users to save content directly from the website or mobile app. It can then be accessed again any time you load up the app, even if you're completely offline.
In the U.S. this feature is locked behind the paid YouTube premium subscription, but it is available for free in some other regions. Once the feature is enabled, you can find a Download button under Videos, next to where you'd usually find sharing and commenting features. The compiled list of songs and videos can then be found and viewed in the Library section of the app.
The only drawback is that an audio file or other asset downloaded with this method can't be moved, copied or modified by the user in any way. They are still considered locked to the YouTube service and can only be accessed through the app. If any saved video is deleted from the YouTube server, it's also likely to be wiped from your device the next time you get online. This is considered a necessary function so that no copyright violations can be allowed to occur.
To sum it up: A program like YouTube-DLG allows the user the greatest degree of flexibility when it comes to letting you download YouTube audio or video online. However, using it at all quickly falls into a legally murky area.
Downloading directly via the YouTube app is the most worry-free method to save the content on your device. However, you will have no say in where those songs and videos can go, or even how long you will be able to access them.