Skip to main content


Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Importing/Exporting data - WMP/Winamp/iTunes/Songbird (Read 16166 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Importing/Exporting data - WMP/Winamp/iTunes/Songbird

There are couple of threads where users are asking about importing/exporting data between different media players and foobar, so here is what I found:

Winamp, iTunes, Songbird
The can communicate through iTunes Library XML format
iTunes and Songbird support this natively, and Winamp through this plugin: ML Import-Export

Exporting foobar library:
For this task Text Tools are needed

1. Make ALL library playlist, select items then from context menu select "Text Tools > Advanced" and add this:
  • Track Pattern:

    [font= "Lucida Console"]$tab()$tab()<key>$num(%list_index%,1)</key>$crlf()$tab()$tab()<dict>$crlf()$tab()$tab()$tab()<key>Track ID</key><integer>%list_index%</integer>$crlf()$if(%title%,$tab()$tab()$tab()<key>Name</key><string>$replace($ascii(%title%),'#','&#35;','&','&#38;',':','&#58;',';','&#59;')</string>$crlf())$if($meta(artist),$tab()$tab()$tab()<key>Artist</key><string>$replace($ascii(%artist%),'#','&#35;','&','&#38;',':','&#58;',';','&#59;')</string>$crlf())$if($meta(album artist),$tab()$tab()$tab()<key>Album Artist</key><string>$replace($ascii(%album artist%),'#','&#35;','&','&#38;',':','&#58;',';','&#59;')</string>$crlf())$if(%album%,$tab()$tab()$tab()<key>Album</key><string>$replace($ascii(%album%),'#','&#35;','&','&#38;',':','&#58;',';','&#59;')</string>$crlf())$if(%genre%,$tab()$tab()$tab()<key>Genre</key><string>$replace(%genre%,'#','&#35;','&','&#38;',':','&#58;',';','&#59;')</string>$crlf())$tab()$tab()$tab()<key>Kind</key><string>MPEG audio file</string>$crlf()$tab()$tab()$tab()<key>Size</key><integer>%filesize%</integer>$crlf()$tab()$tab()$tab()<key>Total Time</key><integer>$mul(%length_seconds%,1000)</integer>$crlf()$if(%track number%,$tab()$tab()$tab()<key>Track Number</key><integer>%track number%</integer>$crlf())$if(%date%,$tab()$tab()$tab()<key>Year</key><integer>%date%</integer>$crlf())$tab()$tab()$tab()<key>Date Modified</key><date>$date(%last_modified%)T$time(%last_modified%)Z</date>$crlf()$if(%added%,$tab()$tab()$tab()<key>Date Added</key><date>$date(%added%)T$time(%added%)Z</date>$crlf())$tab()$tab()$tab()<key>Bit Rate</key><integer>%bitrate%</integer>$crlf()$tab()$tab()$tab()<key>Sample Rate</key><integer>%samplerate%</integer>$crlf()$tab()$tab()$tab()<key>Track Type</key><string>File</string>$crlf()$if(%play_count%,$tab()$tab()$tab()<key>Play Count</key><integer>%play_count%</integer>$crlf())$if(%last_played%,$tab()$tab()$tab()<key>Play Date UTC</key><date>$date(%last_played%)T$time(%last_played%)Z</date>$crlf())$if(%rating%,$tab()$tab()$tab()<key>Rating</key><integer>$mul(%rating%,20)</integer>$crlf())$tab()$tab()$tab()<key>Location</key><string>file://localhost/$replace(%path%,' ','%20','\','/','#','&#35;','&','&#38;',';','&#59;')</string>$crlf()$tab()$tab()$tab()<key>File Folder Count</key><integer>-1</integer>$crlf()$tab()$tab()$tab()<key>Library Folder Count</key><integer>-1</integer>$crlf()$tab()$tab()</dict>[/font]

  • Group Header Pattern:

    [font= "Lucida Console"]<?xml version="1.0" encoding="UTF-8"?>$crlf()<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">$crlf()<plist version="1.0">$crlf()<dict>$crlf()$tab()<key>Major Version</key><integer>1</integer>$crlf()$tab()<key>Minor Version</key><integer>1</integer>$crlf()$tab()<key>Application Version</key><string>6.0.5</string>$crlf()$tab()<key>Tracks</key>$crlf()$tab()<dict>[/font]

  • Group Footer Pattern:

    [font= "Lucida Console"]$tab()</dict>$crlf()</dict>$crlf()</plist>[/font]

2. Copy the result to text editor and name the file with XML extension

For iTunes choose "File > Library > Import Playlist" and select created XML file. If you want to preserve playback statistics clear iTunes library first
For Winamp choose "Library > Import Database" and select created XML file. Same applies here for playback statistics, only that Played Last isn't imported
Songbird (Tools > Option > iTunes importer) expects Persistent ID through iTunes GUID Property which can't be guested so in this case exporting can be done by importing library with iTunes and than exporting: foobar -> iTunes -> Songbird

In all this cases character encodings should be considered and supported file types by players, although error is hardly to emerge but probably possible
I've tested this with iTunes 8, Winamp 5.55 and Songbird 1.1

Importing to foobar:
iTunes and Winamp (through ML Import-Export) can export to iTunes Library XML format, but Songbird does not support exporting of media at this time.

I know only one way how that can be done with foobar and that is with Masstager action: Input data (one line per track)
Exported media library (in iTunes XML format) have field "Location", which can be used as a sort field to match foobar playlist items sorted by %path%:

1. Make playlist that matches exported library content (if that is ALL media library than it is easier) and sort it by %path%
2. Open exported XML file with your favourite editor and strip all fields that aren't needed except "Location" and of course desired fields (f.e. Genre, Rating, Play Count etc) and then sort it by "Location" field
3. In Masstager select "Input data (one line per track)", add Scheme pattern and paste the appropriate data in "Input data" field

This may seem complicated explaining but trying would be hopefully easier

WMP database can be accessed through scripting languages, but that it off this topic

Exporting foobar library:
I have not much to say then transfering ratings (%rating WMP%) must be done in ID3v2.3 tags encoded in Latin 1 (ISO 8895-1) which foobar can't do because of encoding but Mp3tag can do that. Playback statistics are probably impossible to import in WMP without scripting

Importing to foobar:
This can be done with Media Info Exporter which is part of WMP 9 power toys but can't be installed on Vista. So here is workaround:
1. Download only the dll file from here and copy it somewhere
2. Open command prompt in the folder where mpexp.dll is and run this command: regsvr32 mpexp.dll
3. Now open WMP and select your library, right click > Send to > Media Info Exporter

It can create files in different formats with this informations:
Title, Artist, Album, Rating, Media Info, Genre, Length, Bit Rate, Type, Date Added, File Path

Most important, there is File Path field so the same method as described above can be used

Last but not least, you can do all this with only one tool (theoretically, I haven't tried it):
Use your iPod to sync data with your media player and then export it to official foobar playback statistics using musicmusic's foo_dop

[edit] Corrected problem with displaying '&#59;' f.e.,  on HA post as it should be


Importing/Exporting data - WMP/Winamp/iTunes/Songbird

Reply #1
In addition to the method for importing media library to foobar, using iTunes XML format, here is XSL transformation for easily managing data as spreadsheet f.e.:

Code: [Select]
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
    <xsl:template match="/">
            <xsl:apply-templates select="plist/dict/dict/dict"/>
    <xsl:template match="dict">
            <xsl:apply-templates select="key"/>
    <xsl:template match="key">
        <xsl:element name="{translate(text(), ' ', '_')}">
            <xsl:value-of select="following-sibling::node()[1]"/>
If option for importing XSLT isn't available in your editor, add this as a third line in original XML file:

Code: [Select]
<?xml-stylesheet type="text/xsl" href="transformation.xsl"?>

Importing/Exporting data - WMP/Winamp/iTunes/Songbird

Reply #2
Thanks for this very helpful info but there's a problem on this side:
I can't paste the track pattern info.  There's a quick flash of it pasting but it then goes away.
Text tools is up-to-date (1.0.3)
Any ideas?

EDIT:  Ok well I guess I just needed to make the window a lot bigger.

Importing/Exporting data - WMP/Winamp/iTunes/Songbird

Reply #3
Hi guys!

I have a difficult situation for migrating rating:
Replacing the hard drive on a laptop has led to the complete transfer of data. The exception was the system "C" drive.

It is logical that the data stored in the rated WMP (Windows 7) is not preserved in the songs. I checked the tag "rating WMP", alas, there is my "stars" did not have :-(
Apparently the entire rating was stored in an internal database.
File paths are not changed, can anyone knows how and from where moved "knowledge base" WMP for new Windows? All data were, however, boot from your old hard drive I can not.

SimplePortal 1.0.0 RC1 © 2008-2021