Youtube to MP3 is an open-source tool which allows you to download your Apple Music playlist as MP3 Files with 95% accuracy .
In order to use the code all you need is to turn your playlist to an XML file by doing the following:
On iTunes/Apple Music go to File -> Library -> Export playlist... and export it as XML to your project's directory last thing you got to do is to replace the file inside the call to mainfunc to your playlists file name and run it!
All extra requirements beside the imports at the top are Youtube-DL requirements, you might have to install FFmpeg.