![sonos playlist export sonos playlist export](https://www.multiroom.fr/wp-content/uploads/2021/03/phonos-plus-soundiiz.jpg)
![sonos playlist export sonos playlist export](http://c2.accu.fm/tiles/default/3551.jpg)
Path_relative = 'Media/' + itunes_library pls playlist on Sonos, needs the following key steps: left = len(itunes_library) In Python 3, converting a path from iTunes XML format into something suitable for a. pls file also needs the XML reserved characters (& ' ") in their escaped form, i.e & is &. pls playlist, which is an XML format, needs to have unicode characters encoded in an XML format, i.e. Sonos needs any unicode text to be normalised into NFC form - I'd never heard of this before, but essentially means that any accented characters have to be represented by a single character, not as a normal character with a separate accent.With thanks to for the suggestions above, I do now have unicode playlists fully working with Sonos.Ī couple of critical points that should save someone else a lot of time:
#Sonos playlist export code#
Where generated_playlist is the result of extracting and filtering data from itunes_library, having run () on any iTunes XML data.Īny thoughts or tips on where to look would be very much appreciated! I'm hoping that to someone who understands Unicode better the answer will be really really obvious! Thanks!Ĭurrent version of the code available here: Itunes_library = plistlib.load(itunes_handle)įor export I've tried dozens of different options, but generally something like the below (sometimes with encoding='utf-8' and various other options): with open(dest_path, 'w') as playlist_file: I read in the data from iTunes' XML file using: with open(settings, 'rb') as itunes_handle: Within Python itself I'm not doing anything particularly clever. The fact that some unicode characters work now, and others don't, makes me think it's got to be something obvious! I'm guessing the difference is that accents modify the previous character, rather than being a character in itself, but tried removing the previous letter and that didn't work! I've never really worked with unicode / UTF-8 before, but having read various guides and how-to's I feel like I'm getting close but probably just missing something simple. ) are fine, whilst ö ( ö), å ( å) and á ( á) are not.́ Using this format doesn't make a difference to what works or does not work - ÷ ( ÷) and
![sonos playlist export sonos playlist export](https://www.multiroom.fr/wp-content/uploads/2021/03/phonos-plus-playlists.jpg)
I've tried both using these as their original unicode characters, but also as their encoded XML identifier e.g. However, just as I was starting to tidy up and finish off the code, I found some other characters that weren't being handled correctly: ö, å, á and a couple of others.
![sonos playlist export sonos playlist export](https://static.wixstatic.com/media/21260c_1aef98e3971b45c3b905f36335bff95f~mv2.jpg)
The character ÷ was interpreted by Sonos as à Sonos does not appear to support UTF-8 encoding in. The only problem is playlists, which I'm generating via a bit of Python3 code.
#Sonos playlist export mac#
I'm moving from iTunes on Mac to a folder structure on Linux (Ubuntu), and the file paths all contain the original Unicode names and these are displayed and play fine from Sonos in the Artist / Album view. All was going fine until I came across some unicode text in track, album and artist names. I'm working to export a small subset of music from my iTunes library to an external drive, for use with a Sonos speaker (via Media Library on Sonos).