Kodi Community Forum
iTunes Library XML to M3U - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
--- Thread: iTunes Library XML to M3U (/showthread.php?tid=262235)

Pages: 1 2


iTunes Library XML to M3U - Bram82 - 2016-02-29

I couple of weeks ago I was faced with a problem. I wanted my iTunes playlist available in Kodi, running on my Intel NUC. Because I couldn't find software or a plug-in to do this, I wrote a utility myself. What this basically does is take the iTunes Library XML and processes it into one or more M3U playlists. One M3U is created for each playlist in the library. Smart playlists are also included. I store the M3U files on my NAS, along with the rest of my iTunes Library and thus media files.

The utility runs from the command line. It can also make replacements (using command line arguments), for example to rewrite folders. I'm running this script once a day using the Windows task scheduler.

The software is written in .NET. I'd be more than happy to share. But the question is: how? Blush


RE: iTunes Library XML to M3U - wickemu - 2016-03-15

This sounds like something I've been looking for for a long time! I would be so grateful if you could share this!


RE: iTunes Library XML to M3U - Limcard - 2016-03-17

can you maybe upload it to somewhere or sent via email?


RE: iTunes Library XML to M3U - Bram82 - 2016-05-27

Hi everybody, please try this version: https://www.dropbox.com/s/visdiexgkvl2kwx/iTunesXMLtoM3U.zip?dl=0

Let me know how this works out.


RE: iTunes Library XML to M3U - Fail$tyle420 - 2016-05-27

I personally don't use itunes, but I've seen quite a few posts asking how to get their playlists into kodi 'easily.' Great utility from the sounds of it! You should do a full edit on your first post and rename it with RELEASE prefix!


RE: iTunes Library XML to M3U - steve1977 - 2016-05-28

This is fantastic. I am one of the guys who have been looking for a simple way tio get my itunes playlists into Kodi.

I will give it a try shortly.

Will this work when using mysql for my music library? Assume I still need to copy the M3U files to the various Kodi clients?


RE: iTunes Library XML to M3U - Bram82 - 2016-05-28

Yup, it will work. I'm using the same setup. Just make sure that you point the Kodi Music Library to the Playlists folder where you let this util output it's playlist files.


RE: iTunes Library XML to M3U - steve1977 - 2016-05-28

Great, thanks! So, Kodi actually scans M3U files into the mySQL music library in the same way it does MP3s? So, all Kodi clients have access to the playlists?


RE: iTunes Library XML to M3U - Bram82 - 2016-05-28

(2016-05-27, 23:34)Fail$tyle420 Wrote: I personally don't use itunes, but I've seen quite a few posts asking how to get their playlists into kodi 'easily.' Great utility from the sounds of it! You should do a full edit on your first post and rename it with RELEASE prefix!

It is done. http://forum.kodi.tv/showthread.php?tid=277308&pid=2347019


RE: iTunes Library XML to M3U - steve1977 - 2016-05-29

Thanks Bram. I tried the tool and it is really great. It created the playlists and being very easy to configure. Two questions:

1) It also creates a playlist with the full library. Why?

2) How do you import the playlist into the library? I just put them into the music folder (where all my MP3s are), but this did not do the trick


Thanks again!


RE: iTunes Library XML to M3U - Bram82 - 2016-05-31

Hi Steve,

1) Because internally iTunes also uses a master list that's got every single track in it. It processes this one just like the others, but it is inherently the largest.

2) For me personally, I created a folder "Playlist" in which I dump the output. This folder is then added to Kodi as a Playlists folder and voila.

Have fun!
Bram


RE: iTunes Library XML to M3U - Bram82 - 2016-05-31

(2016-05-28, 19:01)steve1977 Wrote: Great, thanks! So, Kodi actually scans M3U files into the mySQL music library in the same way it does MP3s? So, all Kodi clients have access to the playlists?

Yes and no. Kodi scans for the M3U files. If it adds them to the index, I do not know. Maybe someone else on this forum? Either way, make sure all clients can access your playlists folder and make sure that folder is added to your Kodi setup.


RE: iTunes Library XML to M3U - steve1977 - 2016-06-03

Got it, thanks! So, you are actually not using mysql? This may be the difference and why it does not work for me. I think I can solve for this though by manually copying to all clients or something like this.

What I don't know how to solve yet is that the playlist export gives me a path like "F"\mymusic\...". Itunes is installed on my server (and so are my music file), so that's why it works for itunes. However, Kodi is based on OE installations and the playlist is not working as it would need to be "smb://my-server-IP/F/mymusic/...".

Any idea for a work-around? I remember there is some path option for Kodi, which may address this? Thanks in advance!


RE: iTunes Library XML to M3U - Bram82 - 2016-06-03

Hi Steve,

MySQL is never touched by the util. In my setup (I use Kodi on two machines, backed by MySQL), the playlists reside on a network share. This share is then added to the music library on both Kodis. Playlists are (AFAIK) not stored in MySQL by Kodi, so you will always need to do it this way.

Try using the replacement attributes. I use it like this:

iTunesXMLtoM3U.exe /l "\\NAS1\iTunes\iTunes Library.xml" /o "\\NAS1\iTunes\Playlists\" /f "file:||localhost||NAS1|iTunes" /r ".." /c /s

--> this rewrites the path file://localhost/NAS1/iTunes to ".." and stores the created playlists in \\NAS1\iTunes\Playlists\
Mind that in the /f attribute, you need to use pipes instead of forward slashes.


RE: iTunes Library XML to M3U - steve1977 - 2016-06-03

Thanks for your quick reply. Let me give it a try with the attributes you have been using. This is a great pointer in the right direction.

Are you using any symlinks for the Kodi user folder? When copying the playlist files to the same folder where my music resides, they don't show up. I have to add them in the following folder to make them show up: "C:\Users\user\AppData\Roaming\Kodi\userdata\playlists\music". This is the Windows example, but same story when trying on OE.

And two more unrelated questions - the first song of the playlist is called "#EXTM3U", which may be a bug? Also, the songs are shown by file name and not based on the MP3 tags. Assume that's a Kodi issue though?