You should try also Youtube-dl - amazing piece of kit :)
As I do not include Python in my system images I wrote a very reliable youtube download script that uses only sh, sed and an http client, where http client is fetch, ftp, curl, wget, or some similar program. Currently it is at 1205 characters, or 1205 bytes. No "developer API" needed.
youtube-dl is the best media download suite I've seen. It worked for any video hosting site I've ever pointed it at, and it even has options to use ffmpeg to recode the video or extract the audio track. In addition, NewPipe also does a similar thing (it's a free software Android app that has much more features than the official app -- such as playing in the background and as an overlaid tile).
The fact that it has a built-in switch for extracting the sound from a video to MP3 has made my library very happy.
Have you tried youtube-dl? I've found that it works great.