It has become apparent, to me, that Android is clearly the superior platform on which to listen to your own local music. And, maybe I kinda knew this already but it’s all coming back to me again as I will probably hop onto the Pixel 10. I go back and forth between Apple and Android at least every two upgrades, but sometimes every upgrade. Particularly with how the new Apple Music app handles your library–e.g., like a freaking walled garden–there’s just no substitute for having all of your playlists saved off in xspf or m3u files. I even exported one of my playlists from Plex via API…that was quite a journey to get that cleaned up, but at least now I have that playlist externally defined. No such hooks with Apple, of course.
Particularly when you pair your library and its playlists with a player like Poweramp. I tried a couple of OSS solutions, but they just didn’t have the playlist management (namely import/export) that Poweramp does. Now, that being said, maybe I’ll tweak one of those OSS solutions to handle such things
To get my playlist out of Plex ended up being a simple curl command. I got the API key for Plex for my managed user account via DevTools, along with the playlist id, and then ran this in a BASH prompt:
curl -s "http://<myip>:32400/playlists/<playlist_id>/items?X-Plex-Token=<api-token>" | xmllint --xpath '//Part/@file' - | sed -E 's/ file="([^"]*)"/\1\n/g' | sed '/^$/d' >> <playlist-name>.m3u
From there, I did have to massage the resultant m3u a bit to contain the correct path information for Android. I have also been sanitizing file names in my library to get rid of special characters that are perfectly usable in Windows (and even Linux), but Android freaks out over–namely ‘!’ and ‘?’, which I simply replaced with ‘_’.