Giter Site home page Giter Site logo

fvdpol / mm-exportituneslibraryxml Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 2.0 296 KB

MediaMonkey script to export to "iTunes Library.xml"

License: GNU General Public License v3.0

Visual Basic 99.58% Batchfile 0.42%
mediamonkey mediamonkey-addon traktor serato seratodj traktor-pro rekordbox mixxx dj itunes-library

mm-exportituneslibraryxml's People

Contributors

fernandolcardoso avatar fvdpol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mm-exportituneslibraryxml's Issues

Ü encoded as Ü but should be embedded in file as-is

Generated XML (fragment):

        <key>95</key>
  <dict>
     <key>Track ID</key><integer>95</integer>
     <key>Name</key><string>Jack &#220; - Take &#220; There Tchami Remix[YoutubeConverter.me]</string>
     <key>Artist</key><string>Jack &#220;</string>
     <key>Kind</key><string>MPEG audio file</string>
     <key>Size</key><integer>11000744</integer>
     <key>Genre</key><string>Bass House</string>
     <key>Total Time</key><integer>274285</integer>
     <key>Date Modified</key><date>2018-08-03T14:03:35</date>
     <key>Date Added</key><date>2018-08-03T13:49:15</date>
     <key>Bit Rate</key><integer>320</integer>
     <key>Sample Rate</key><integer>44100</integer>
     <key>Track Type</key><string>File</string>
     <key>File Folder Count</key><integer>-1</integer>
     <key>Library Folder Count</key><integer>-1</integer>
     <key>BPM</key><string>127</string>
     <key>Location</key><string>file://localhost/I:/MediaMonkey%20Library/Bass%20House/Jack%20%DC%20-%20Take%20%DC%20There%20Tchami%20Remix%5BYoutubeConverter.me%5D.mp3</string>
  </dict>

Validated using iTunes on MacOS; and found that XML is generated with Ü instead of Ü
Note: same probably applies for other characters as well.

Location paths error

The export all went well, I have a library of about 25000 tracks, mostly .mp3 on a NAS device.

The drive letter got replaced with a '?' (question mark) character everywhere. The import did not find anything (or almost), expected. But then simply ran a full search & replace, all the /?:/ with /U:/ strings. And BOOM that did the trick, haha ;-)

Here's a couple sample file URLs:

file://localhost/?:/ext/mp3/Humour/Francophone%20divers/Kekette%20-%20jimbif%20et%20dj.mp3
file://localhost/?:/ext/mp3/Humour/Francophone%20divers/Daniel%20Lemire%20-%20Coke%20Aux%20Cerises.mp3
file://localhost/?:/ext/mp3/Humour/Francophone%20divers/La%20Jungle%20-%20Passe%20Partout%20Orgie.mp3

I'm a dev so I'm glad I was able to fix this so quickly (for me). But I don't have time to look the code and fix and all. But many thanks to all here, seems like most of my previous metadata from MediaMonkey was able to export+import successfully!

Key to Work on Serato

Hello Developer, Forgive my English, I hope to contribute somehow with your project.

I ran several tests in the script and identified the problem with Serato, just enter the Persistent ID </ key>

In the link below, there is a brief description of how to generate the code in this key, I tried to do but did not have time to finish due to my limited knowledge in this language.

https://stackoverflow.com/questions/13795842/linking-itunes-itc2-files-and-ituneslibrary-xml

I believe that with your knowledge, you can generate these keys and solve the problem with Serato.

hug

Script generates invalid play date data for an unplayed track

Reported on Media Monkey forum by Teknojnky on Mon Oct 22, 2018 4:53 am

link: http://www.mediamonkey.com/forum/viewtopic.php?f=2&t=31680&sid=4c4111f5c9aba2c4fc277304e5064733&start=105#p450930

this script generates invalid play date data for an unplayed track.

here is a real itunes xml output, there is no key for play date.

		<key>7035</key>
		<dict>
			<key>Track ID</key><integer>7035</integer>
			<key>Size</key><integer>2748416</integer>
			<key>Total Time</key><integer>168803</integer>
			<key>Track Number</key><integer>13</integer>
			<key>Track Count</key><integer>17</integer>
			<key>Year</key><integer>1990</integer>
			<key>BPM</key><integer>134</integer>
			<key>Date Modified</key><date>2009-01-14T09:44:52Z</date>
			<key>Date Added</key><date>2018-10-22T02:16:03Z</date>
			<key>Bit Rate</key><integer>128</integer>
			<key>Sample Rate</key><integer>44100</integer>
			<key>Artwork Count</key><integer>1</integer>
			<key>Persistent ID</key><string>DD6E628FAB056EA5</string>
			<key>Track Type</key><string>File</string>
			<key>File Folder Count</key><integer>-1</integer>
			<key>Library Folder Count</key><integer>-1</integer>
			<key>Name</key><string>21st Century (Digital Boy)</string>
			<key>Artist</key><string>Bad Religion</string>
			<key>Album Artist</key><string>Bad Religion</string>
			<key>Album</key><string>Against the Grain</string>
			<key>Genre</key><string>Punk</string>
			<key>Kind</key><string>MPEG audio file</string>
			<key>Sort Artist</key><string>Bad Religion</string>
			<key>Location</key><string>file://localhost//sauron/media/audio/MP3/B/Bad%20Religion/1990%20-%20Against%20the%20Grain%20%5BMP3%5D/13%20-%20Bad%20Religion%20-%2021st%20Century%20(Digital%20Boy).mp3</string>
		</dict>

here is the script generated from mediamonkey for the same unplayed track (added dates will be different), with an invalid play date that is obviously in the past.

I confirmed in mediamonkey that there is no play date, and no play counts.

        <key>39283</key>
        <dict>   
            <key>Track ID</key><integer>39283</integer>
            <key>Name</key><string>21st Century (Digital Boy)</string>
            <key>Artist</key><string>Bad Religion</string>
            <key>Album Artist</key><string>Bad Religion</string>
            <key>Album</key><string>Against the Grain</string>
            <key>Kind</key><string>MPEG audio file</string>
            <key>Size</key><integer>2748416</integer>
            <key>Genre</key><string>Punk</string>
            <key>Total Time</key><integer>168803</integer>
            <key>Track Number</key><integer>13</integer>
            <key>Rating</key><integer>50</integer>
            <key>Year</key><integer>1990</integer>
            <key>Date Modified</key><date>2009-01-14T03:44:52</date>
            <key>Date Added</key><date>2007-12-28T16:51:22</date>
 *           <key>Play Date UTC</key><date>1899-12-30T00:00:00</date>
            <key>Bit Rate</key><integer>128</integer>
            <key>Sample Rate</key><integer>44100</integer>
            <key>Track Type</key><string>File</string>
            <key>File Folder Count</key><integer>-1</integer>
            <key>Library Folder Count</key><integer>-1</integer>
            <key>BPM</key><string>134</string>
            <key>Location</key><string>file://localhost//sauron/media/audio/MP3/B/Bad%20Religion/1990%20-%20Against%20the%20Grain%20%5BMP3%5D/13%20-%20Bad%20Religion%20-%2021st%20Century%20(Digital%20Boy).mp3</string>
        </dict>

I raise this issue, due to the import to plex, it imports this invalid play date of the past, into the FUTURE in plex's database.

So there is actually 2 problems, 1 with the export script, and 1 with the plex import.

https://forums.plex.tv/t/plex-music-rec ... /319231/15

Feature request: mapping/rewrite rules for file location

Reported on Media Monkey forum by Teknojnky on Mon Oct 22, 2018 4:53 am

link: http://www.mediamonkey.com/forum/viewtopic.php?f=2&t=31680&sid=4c4111f5c9aba2c4fc277304e5064733&start=105#p450930

Ok for the feature request, I would like to suggest an option to modify the path (or more specifically, the drive) of the exported files.

for example, mediamonkey and itunes runs on windows, and the music files are on a network server.

the paths in both are \sauron\media\audio\ and so on

<key>Location</key><string>file://localhost//sauron/media/audio/MP3/B/Bad%20Religion/1990%20-%20Against%20the%20Grain%20%5BMP3%5D/13%20-%20Bad%20Religion%20-%2021st%20Century%20(Digital%20Boy).mp3</string>

plex however runs on that network server itself, so the path is local

<key>Location</key><string>file://localhost/data/media/audio/MP3/B/Bad%20Religion/1990%20-%20Against%20the%20Grain%20%5BMP3%5D/13%20-%20Bad%20Religion%20-%2021st%20Century%20(Digital%20Boy).mp3</string>

while it's not difficult to do a find/replace, its an additional step I have to stop and do any time I want to update the xml for plex.

I have to replace the //sauron with /data

I would think this could be easy to do, since MM stores the drive and path separately.

I could probably go in the script and hardcode it, but I figure this might be useful for other users who have network stored music, which makes the path different from what itunes/mediamonkey see.

Feature request: ability to NOT export the playlists

Feature request by MediaMonkey forum member "Biggus_Dickus"
http://www.mediamonkey.com/forum/memberlist.php?mode=viewprofile&u=96106:

is there a way to let script export songs only (without playlist export)?

The reason is, I use a combination of Mediamonkey and Musicbee. Mediamonkey Gold for syncing my Android and MediaMonkey-Android-Pro for playback from my phone. But I prefer Musicbee for tagging and when I playback from my laptop, cause in my opinion, it has a better audio engine and is more configurable. MediaMonkey is great, while syncing back ratings and playcount/playdate. And MMA is great too, supporting multiple artists, genres. Musicbee isn't supported by android players. But Musicbee easily imports ratings made in Monkey, but not playcount/playdate. With importing iTunes.xml I can import playcount/playdate. But it imports playlist too, which already exists in Musicbee and are organized in folders. So I've everytime to delete the imported. It wouldn't be difficult, having only a few, but I've nearly 60 or so.

(ref: http://www.mediamonkey.com/forum/viewtopic.php?p=450860#p450860)

Invalid characters in XML: &#55357;

example xml fragment:

<key>1388</key>
<dict>
   <key>Track ID</key><integer>1388</integer>
   <key>Name</key><string>Goblin &#55357;&#56846;</string>
   <key>Artist</key><string>G Jones</string>
   <key>Album</key><string>internet</string>
   <key>Kind</key><string>MPEG audio file</string>
   <key>Size</key><integer>6665570</integer>
   <key>Total Time</key><integer>123062</integer>
   <key>Year</key><integer>2015</integer>
   <key>Date Modified</key><date>2018-07-24T17:24:17</date>
   <key>Date Added</key><date>2018-08-03T14:32:46</date>
   <key>Bit Rate</key><integer>320</integer>
   <key>Sample Rate</key><integer>44100</integer>
   <key>Track Type</key><string>File</string>
   <key>File Folder Count</key><integer>-1</integer>
   <key>Library Folder Count</key><integer>-1</integer>
   <key>Comments</key><string>&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;&#55357;&#56846;</string>
   <key>BPM</key><string>80</string>
   <key>Location</key><string>file://localhost/C:/Users/Alex/Music/usbs/jungle%20trap/G%20JONES%20-%20GOBLIN_SC_Master.mp3</string>
</dict>

Working with DJ Software Rekordbox

Hi!
I was wondering if you have had any requests to include Pioneer's software Rekordbox within your code / testing?!

I'm using Win 10 64bit - Rekordbox 5.4.0 - and gave it a few basic attempts as I have zero programming knowledge!! MediaMonkey is 4.1.21 - and I have your export code of 1.6.2 - my iTunes version is 12.7.3

Initially Rekordbox did not see anything in the exported XML - so I opened the original iTunes XML in notepad, and compared it to the MediaMonkey exported XML. The main Header and footer were slightly different - so I copied and pasted these, and saved as a new test file.

Upon testing in Rekordbox - the XML was loaded to a degree - I was able to see the playlists created by MediaMonkey, and initially the playlists imported to MM from iTunes were displayed, but then disappeared! Sadly - not all of the tracks in the library were displayed, and none of them could be loaded!!

Anyway - perhaps getting away from iTunes and back to MM is further away than I hoped!!
Toby

→ encoded as &#8594; but should be embedded in file as-is

Example XML fragment:

  <key>5275</key>
  <dict>
     <key>Track ID</key><integer>5275</integer>
     <key>Name</key><string>Stutter (Original Mix)</string>
     <key>Artist</key><string>Hannah Wants</string>
     <key>Composer</key><string>&#8594; vk.com; world_club_music_o_o</string>
     <key>Album Artist</key><string>&#8594; vk.com; world_club_music_o_o</string>
     <key>Album</key><string>&#8594; vk.com/world_club_music_o_o</string>
     <key>Kind</key><string>MPEG audio file</string>
     <key>Size</key><integer>14021683</integer>
     <key>Genre</key><string>Night Bass / Tech House</string>
     <key>Total Time</key><integer>342465</integer>
     <key>Year</key><integer>2017</integer>
     <key>Date Modified</key><date>2018-08-03T19:13:35</date>
     <key>Date Added</key><date>2018-08-16T16:39:27</date>
     <key>Bit Rate</key><integer>320</integer>
     <key>Sample Rate</key><integer>44100</integer>
     <key>Track Type</key><string>File</string>
     <key>File Folder Count</key><integer>-1</integer>
     <key>Library Folder Count</key><integer>-1</integer>
     <key>Comments</key><string>&#8594; vk.com/world_club_music_o_o</string>
     <key>BPM</key><string>125</string>
     <key>Location</key><string>file://localhost/I:/Alex%20MediaMonkey%20Library/new%20night%20bass%20tech/WCM%20-%20Hannah%20Wants%20%20-%20Stutter%20%28Original%20Mix%29.mp3</string>
  </dict>

confirmed in MacOS iTunes

troubleshooting crashes?

Firstly thanks for posting this on git to share! I'm hoping to sync my MM playlists over to Traktor but even after using your latest script, Traktor crashes when opening the exported iTunes playlist file...

All it gives me is a binary mini-dump so I'm not sure how I can use this to troubleshoot and debug the script. How did you do this to fix problems in the past? I'd like to help if I can but so far I can't figure out what the problem is. any ideas?

MM 5

Hi, is there any chance to bring this to MediaMonkey 5?

Exported playlists not in same sort order as in MediaMonkey (alphabetically)

reported by Wim.R on MediaMonkey forum:
https://www.mediamonkey.com/forum/viewtopic.php?p=449419#p449419

Sorting of playlists. Take for example 3 playlists: A (created on 10/09/2018), B (created on 11/09/2018) and C (created on 09/09/2018).

Mediamonkey sorts these playlists alphabetically:

  • A
  • B
  • C

After export, Traktor sorts playlists according to creation date (or probably according to some unique number attached to a playlist). Thus the result in Traktor:

  • C
  • A
  • B

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.