iTunes Library XML to M3U
#1
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
Reply
#2
This sounds like something I've been looking for for a long time! I would be so grateful if you could share this!
Reply
#3
can you maybe upload it to somewhere or sent via email?
Reply
#4
Hi everybody, please try this version: https://www.dropbox.com/s/visdiexgkvl2kw...U.zip?dl=0

Let me know how this works out.
Reply
#5
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!
Reply
#6
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?
Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 16 GB DDR3 | 128 GB SSD, 82 TB (9 x 6 TB, 7 x 4 TB)
HTPC 1: Raspberry Pi 2 | HTPC 2: Raspberry Pi 2 | HTPC 3: Raspberry Pi
Reply
#7
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.
Reply
#8
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?
Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 16 GB DDR3 | 128 GB SSD, 82 TB (9 x 6 TB, 7 x 4 TB)
HTPC 1: Raspberry Pi 2 | HTPC 2: Raspberry Pi 2 | HTPC 3: Raspberry Pi
Reply
#9
(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=...id=2347019
Reply
#10
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!
Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 16 GB DDR3 | 128 GB SSD, 82 TB (9 x 6 TB, 7 x 4 TB)
HTPC 1: Raspberry Pi 2 | HTPC 2: Raspberry Pi 2 | HTPC 3: Raspberry Pi
Reply
#11
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
Reply
#12
(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.
Reply
#13
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!
Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 16 GB DDR3 | 128 GB SSD, 82 TB (9 x 6 TB, 7 x 4 TB)
HTPC 1: Raspberry Pi 2 | HTPC 2: Raspberry Pi 2 | HTPC 3: Raspberry Pi
Reply
#14
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.
Reply
#15
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?
Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 16 GB DDR3 | 128 GB SSD, 82 TB (9 x 6 TB, 7 x 4 TB)
HTPC 1: Raspberry Pi 2 | HTPC 2: Raspberry Pi 2 | HTPC 3: Raspberry Pi
Reply

Logout Mark Read Team Forum Stats Members Help
iTunes Library XML to M3U0