Export to iTunes library.xml

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Benn
Posts: 300
Joined: Sat Jul 12, 2008 11:59 am
Location: Cornwall, United Kingdom

Re: Export to iTunes library.xml

Post by Benn » Fri Sep 26, 2008 7:38 am

Simply copy and paste the large code into notepad, save as "Export to iTunes library-xml.vbs" (making sure you select save as all file types) to your Mediamonkey\Scripts\Auto folder; then, copy and paste

Code: Select all

[ExportITunes]
FileName=Auto\Export to iTunes library-xml.vbs
ProcName=Export
Order=5
DisplayName=Tracks and Playlists (&iTunes library.xml)
Description=Exports all tracks and playlists to an iTunes library.xml file
Language=VBScript
ScriptType=1


and add it to your Mediamonkey\Scripts\scripts.ini files (openable in notepad). Then restart MM and the script should be there.

who cares

Re: Export to iTunes library.xml

Post by who cares » Wed Oct 22, 2008 1:15 pm

If you have more than 32767 songs you need to change 'CInt' on line 108 to 'Int'

infinityronin
Posts: 8
Joined: Tue Nov 04, 2008 2:12 am

Re: Export to iTunes library.xml

Post by infinityronin » Wed Jan 21, 2009 10:57 pm

Really interested in this script, if I can get it working I can finally drop itunes and get back to MM. Created the .vbs file, and then added the code above into the scripts.ini file, restarted MM, but I don't see it. Even tried uninstalling and reinstalling MM with the latest version, and adding the the code above back into the .ini file, still can't see it (yes the .vbs file is there). Any suggestions? Not computer illiterate, but not a coder either.

DC
Posts: 89
Joined: Sat Jul 24, 2004 1:01 pm

Re: Export to iTunes library.xml

Post by DC » Fri Jan 23, 2009 6:52 pm

who cares wrote:If you have more than 32767 songs you need to change 'CInt' on line 108 to 'Int'
Thanks for the hint. I have changed the code on the first posting page.

DC
Posts: 89
Joined: Sat Jul 24, 2004 1:01 pm

Re: Export to iTunes library.xml

Post by DC » Fri Jan 23, 2009 6:57 pm

infinityronin wrote:Really interested in this script, if I can get it working I can finally drop itunes and get back to MM. Created the .vbs file, and then added the code above into the scripts.ini file, restarted MM, but I don't see it. Even tried uninstalling and reinstalling MM with the latest version, and adding the the code above back into the .ini file, still can't see it (yes the .vbs file is there). Any suggestions? Not computer illiterate, but not a coder either.
Just out of curiosity, how are you going to use the exported iTunes xml?

Regarding your problem. There are two ways how the xml gets exported: by timer or manually by menu. What exactly aren't you seeing? Is the menuitem there? (look into File | Create Reports |Tracks and Playlists (iTunes Library.xml)

infinityronin
Posts: 8
Joined: Tue Nov 04, 2008 2:12 am

Re: Export to iTunes library.xml

Post by infinityronin » Fri Jan 23, 2009 11:33 pm

okay, I am very dumb. I was looking for the script under Tools | Scripts, I just assumed thats where it would be, didn't even think of looking for it under under Create Reports.
DC wrote: Just out of curiosity, how are you going to use the exported iTunes xml?
I'm a dj, and I use a program called Serato Scratch Live. The program uses "crates" to organize the music, which are similar to playlists basically. Scratch Live can read the itunes library xml file, and use the information to organize your crates so that they match the playlist structure in itunes. I have been using MM since the early version of 2.0. When I got Scratch live, I imported all my dj music into Itunes, but unfortunately some of my tags (namely comments which I use a lot when I dj) can't be read by itunes, because MM and Itunes don't follow the ID3 tag compliances in the same way. So I switched to itunes for just my dj music. But. Itunes sucks. It just sucks. But the only other option was to import all my playlists from MM to Scratch live everytime I playout. Since I am adding at least 40 songs a week, it's just easier if I use itunes.

I just tried the script, and all my playlists show up in Scratch Live, so that's really cool. There are a few things that I want to see if I can change.

1) It doesn't follow my playlist structure (I have autoplaylists nested under other playlists)
2) I need to find a way to take out the timer updates so that it just updates manually (or when I close the program would be even better).
3) I just want the playlists in the xml file, I don't need all my tracks, just the ones in the playlists.

Do you think its possible to do those things with the script you made?

Anyways thanks for writing the script and getting back to me. If I can fine tune this, then I will never have to open up Itunes again!

mistresso
Posts: 67
Joined: Sun Feb 24, 2008 11:15 am
Location: New Haven
Contact:

Re: Export to iTunes library.xml

Post by mistresso » Sat Jan 24, 2009 10:24 pm

As the poster above notes, there are a number of MP3 apps out there that ONLY read/import from ITunes libraries - and not the file system. DJ programs are a prime example. They really only use the ITunes db to get the file locations anyway - and read the MP3 tags on their own, so leaving off album art and ratings, etc., generally isn't a concern. Neither are playlists MOST of the time.

I second that we need a quick way to turn off the timer functionality - no reason to run this script except on-demand in most cases!

As for playlists, couldn't they be output as M3U files by MM and then imported into Serrato separately? M3U is at least a very commonplace standard among DJ's, as far as I know.

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Export to iTunes library.xml

Post by nynaevelan » Sat Jan 24, 2009 10:44 pm

Hi:

I am testing using other programs to sync my Zen portable player and I thought I would give this a try since it would be able to save my playlists and playcounts. I ran it and moved the xml file from the mediamonkey folder to the itunes music folder but when open iTunes I do not see my playlists or playcounts. What do I need to do in order for iTunes to see my playcounts and playlists? Please keep in mind that other than downloading a few albums I have never used iTunes.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

nohitter151
Posts: 23640
Joined: Wed Aug 09, 2006 10:20 am
Location: NJ, USA
Contact:

Re: Export to iTunes library.xml

Post by nohitter151 » Sat Jan 24, 2009 10:53 pm

nynaevelan wrote:Hi:

I am testing using other programs to sync my Zen portable player and I thought I would give this a try since it would be able to save my playlists and playcounts. I ran it and moved the xml file from the mediamonkey folder to the itunes music folder but when open iTunes I do not see my playlists or playcounts. What do I need to do in order for iTunes to see my playcounts and playlists? Please keep in mind that other than downloading a few albums I have never used iTunes.

Nyn
Nyn, did you read this?
DC wrote:Please note: this script is not intended to export MM data to iTunes. I doubt that will work because some data (like iTunes internal persistent IDs or album ratings) is not available in MM. Also missing at this point: volume rating (gain, leveling, etc), album art and support for any non-mp3 typed files. The sole purpose of this script is to make MM data available in a format which can be read by other programs, which includes the iTunes plugin in SqueezeCenter.
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?

Please no PMs in reply to a post. Just reply in the thread.

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Export to iTunes library.xml

Post by nynaevelan » Sat Jan 24, 2009 11:08 pm

NH:

Nope, guess I skipped over that one. Thanks I will just have to accept whatever I find will not have any playcounts. Now off to search to see if it will import the playcounts from the player. Thanks.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

infinityronin
Posts: 8
Joined: Tue Nov 04, 2008 2:12 am

Re: Export to iTunes library.xml

Post by infinityronin » Sun Jan 25, 2009 1:44 am

[quote="infinityronin"
1) It doesn't follow my playlist structure (I have autoplaylists nested under other playlists)
2) I need to find a way to take out the timer updates so that it just updates manually (or when I close the program would be even better).
3) I just want the playlists in the xml file, I don't need all my tracks, just the ones in the playlists.
[/quote]

Tried 2 and 3. Mind you I know nothing about scripting, just read the comments in the script itself. Number two was easy, there is a piece of script at the bottom that does the auto-time. Tried 3 by deleting the songs portion of the script, and kept the playlist, and the script ran, but when I imported the xml file into serrato, there was no information in the playlist. So. I tried to figure how to modify the script, but I would need to invest some serious time to figure it out, and I unfortunately don't have that time.

@mistresso
Yes I could use m3u files, but I would have to cotinually import my m3u playlists so that I have my newest songs in my Serrato library. Importing resets the way I have Serrato display the mp3s, so its a lot of work to do every week. With having serrato read the Itunes library, the new songs are updates, but my settings in Serato stay the same, so its much more efficient. Though using itunes compared to MM is more inefficient. :(

DC
Posts: 89
Joined: Sat Jul 24, 2004 1:01 pm

Re: Export to iTunes library.xml

Post by DC » Sun Jan 25, 2009 5:54 pm

infinityronin, thanks for using this script. Recently somebody asked my why I would not use iTunes - and I could not even give a good reason. I had tried iTunes before I bought MM years ago and forgot what I did not lilke about it. Surely I cannot stand any phone-home attitude (the iTMS did have that at some time) or lock-in technology (any DRM, WMV or AAC). Well, at least the DRM should be history soon.
infinityronin wrote:1) It doesn't follow my playlist structure (I have autoplaylists nested under other playlists)
The iTunes library xml file format gives the impression that this is possible. It certainly is possible to get the playlist hierarchy from MM. If I had an original iTunes library xml with nested playlists as a template it would probably take maybe 2 hours to get this into the script. However, I am not really motivated to do it. I dislike visual basic (this is my first vb script) and I have no need for this extension.
infinityronin wrote:2) I need to find a way to take out the timer updates so that it just updates manually (or when I close the program would be even better).
As you found out already this is easy to do. I have added an option "ENABLE_TIMER" to the script (see original script posting). This can be set to "false" to prevent automatic exports. Your solution should be ok, too, so you can just keep it.
infinityronin wrote:3) I just want the playlists in the xml file, I don't need all my tracks, just the ones in the playlists.
Well, the trouble here is that the playlists contain song ids only, not the complete song data. To make this work we would have to do this:
1. get song ids from all playlists
2. export only those songs, ignoring all others
3. export playlists (unchanged)

Again, I am no vb aficionado so don't hold your breath. Should be easy to do though, maybe later...

infinityronin
Posts: 8
Joined: Tue Nov 04, 2008 2:12 am

Re: Export to iTunes library.xml

Post by infinityronin » Sun Jan 25, 2009 7:03 pm

Thank you for making the script in the first place! And yeah I don't really expect anyone to do anything to the script for me, but it never hurts to put it out there either. I am hoping that somebody who has a similar desire fo use itunes library xml file will see this, know scripting, and be board at the same time :D .

Here are some reasons why I don't use Itunes, which I responded to in another forum:

1. No effective way to have Itunes re-read your tags. If I make changes outside of Itunes, I have to delete the song and then read add it. Rereading the folder without deleting it doesn't seem to update the file. Supposedly you can just select the songs and click "get info" but this doesn't always work for me. Additionally if you move or change the filename, then itunes won't be able to add the file.

2. Ratings are in a separate database. That. Sucks. And it makes it impossible for any other program to even try and integrate their ratings with Itunes. What a great idea.

3. Dude. Enough with the automatic album art and gapless playback crap. Seriously. No matter what I do to turn it off, it keeps happening. Everytime I open Itunes, turn off gapless playback. I know I could just let it run, but when you're adding 40 songs a week, that's a pain.

4. System Resources. My current player (Mediamonkey) does more and uses less resources to do it. I always admired MAC, because it seemed to really effectively use system resources, way better than windows anyway. And maybe itunes does on mac, but not on windows.

Its good to know that it should be possible to retain the playlist hierarchy, and add just the playlists. The Itunes library .xml does retain the heirarchy, and it will show up in my dj program. Thanks for pointing out what I need to do. If I ever get enough time to learn vb, then I will definitely do it and post the results here.

mistresso
Posts: 67
Joined: Sun Feb 24, 2008 11:15 am
Location: New Haven
Contact:

Re: Export to iTunes library.xml

Post by mistresso » Sun Jan 25, 2009 10:31 pm

Infinityronin, what sort of playlists are you using - static ones or dynamic?

infinityronin
Posts: 8
Joined: Tue Nov 04, 2008 2:12 am

Re: Export to iTunes library.xml

Post by infinityronin » Sun Jan 25, 2009 11:01 pm

In MM I use Autoplaylists, and in Itunes I use Smartplaylists both dynamic.

Post Reply