iTunesMonkey 1.0 + Acoustid

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

MMuser2011
Posts: 1308
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: iTunesMonkey 1.0 + Acoustid

Post by MMuser2011 »

You are right, trancefx. The iTunes Part of this script seems not to work anymore.
(Only the part "Acoustid Fingerprint" works still fine - creating a fingerprint for every song and lookup the metadata in MusicBrainz).

Anybody knows if Apple has changed something (what?) in their iTunes search API recently?
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version
MMuser2011
Posts: 1308
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: iTunesMonkey 1.0 + Acoustid

Post by MMuser2011 »

Maybe I have found a quick and dirty workaround for the problem with the iTunes part!
Please be warned: I'm not a Regular Expressions specialist and this change could have side effects :oops:
Double check your results after applying this workaround!

Step by step instructions:
1. Open the directory with this script inside, usually something like
%appdata%\MediaMonkey\Scripts\iTunesMonkey

2. Open the file iTunesMonkey.vbs (about 95kb) in a text editor like Notepad++

3. Search for the line with the text

Code: Select all

With reWrapper
the only existing one should be around line number 218

4. Add 1 apostrophe/single quotation mark in front of the following 3rd line

Code: Select all

'.Pattern = ...
This will deactivate this complete line.

5. Paste the following complete text as one new line directly under the deactivated one

Code: Select all

.Pattern = "^{""wrapperType"":""track"", ""kind"":""song"",[^,]+, ""collectionId"":(\d+), ""trackId"":(\d+)(,.+(?:\n[^{].+)*[^\\]"")(?:, )?(?:\n{""wrapperType"":""collection""(?:,[^,]+){3,4},[ \n]+""artistName"":""((?:[^""""\\]+|\\.)*)"",.+(?:\n[^{].+)*[^\\]""}(?:, )?$)?"
This line should be very similar to the existing one. :wink:

6. Save the modified file iTunesMonkey.vbs

Run this script inside MediaMonkey as usual.

Again: This is only a workaround until the original Author 'CarlitoGil' provides a real fix.
Any feedback is appreciated!
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version
trancefx

Re: iTunesMonkey 1.0 + Acoustid

Post by trancefx »

MMuser2011 wrote:Maybe I have found a quick and dirty workaround for the problem with the iTunes part!
Please be warned: I'm not a Regular Expressions specialist and this change could have side effects
Double check your results after applying this workaround!
That did the trick! It's crazy that, without a proper JSON parsing library for VBS, you're forced to use RegEx. Thank you very much! :D
ObsessiveTagger

Re: iTunesMonkey 1.0 + Acoustid

Post by ObsessiveTagger »

This almost fixed iTunesMonkey only the Album Artist doesn't appear in iTunes Search or iTunes Monkey for a song except for a check mark next to a blank space where the album artist normally is. Can you think of a workaround for that? Btw thanks for finding this workaround!
MMuser2011
Posts: 1308
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: iTunesMonkey 1.0 + Acoustid

Post by MMuser2011 »

ObsessiveTagger wrote:Can you think of a workaround for that?
I try it. :wink:

Repeat step 1 and 2 from above
3. Search for the 3 lines with the text

Code: Select all

Select Case mData.Item(0)
	Case "albumArtistName"
      .AlbumArtistName = 
you will find several identical lines! Be sure to find the ones starting around line number 2522

4. Insert the following complete text as two new lines under the above "Case" statement, before the next "Case" statement for "artistName"

Code: Select all

   Case "collectionArtistName"
	   .AlbumArtistName = reUnescape.Replace(mData.Item(1), "$1")
5. In the already existing "Case artistName" add the following line after the existing line .ArtistName =

Code: Select all

   If .AlbumArtistName = "" and .ArtistName <> "" Then .AlbumArtistName = .ArtistName
The entire code block should look like this:

Code: Select all

Select Case mData.Item(0)
				Case "albumArtistName"
					.AlbumArtistName = reUnescape.Replace(mData.Item(1), "$1")
				Case "collectionArtistName"
					.AlbumArtistName = reUnescape.Replace(mData.Item(1), "$1")
				Case "artistName"
					.ArtistName = reUnescape.Replace(mData.Item(1), "$1")
					If .AlbumArtistName = "" and .ArtistName <> "" Then .AlbumArtistName = .ArtistName
				Case "collectionName"
					.AlbumName = reUnescape.Replace(mData.Item(1), "$1")
...
This should bring back the "Album Artist" for albums with only one single artist (in most cases the same as artist) AND for albums where every track has a different track artist (mostly in compilations).

As you already know:
This is only a workaround until the original Author 'CarlitoGil' provides a real fix.
Double check your results after applying this workaround.
Any feedback is appreciated!
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version
ObsessiveTagger

Re: iTunesMonkey 1.0 + Acoustid

Post by ObsessiveTagger »

You did it, it worked! Those new lines of code allowed iTunesMonkey to write the Album Artist from the iTunes database to the Album Artist field for a track from a compilation album that has a different Artist for each track on the album just like you said! You're a genius how did you come up with this solution?
MMuser2011
Posts: 1308
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: iTunesMonkey 1.0 + Acoustid

Post by MMuser2011 »

ObsessiveTagger wrote:You did it, it worked! You're a genius how did you come up with this solution?
Thank you for your feedback! :D The inventor of this fantastic script - 'CarlitoGil' - wrote his code in a very tidy manner. This is the main reason why it was possible for me to add this little workaraound.
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version
ObsessiveTagger

Re: iTunesMonkey 1.0 + Acoustid

Post by ObsessiveTagger »

No no no no now the artwork from the iTunes store isn't appearing in iTunesMonkey. I uninstalled the extension because I thought there was a problem with this amended code but there wasn't so I reinstalled it and recopied all your code. Why the f*** did the album art disappear?
MMuser2011
Posts: 1308
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: iTunesMonkey 1.0 + Acoustid

Post by MMuser2011 »

For some unknown reason, we actually only get cover pictures with a size about 100x100 pixels from iTunes.
The script only show covers with a minimal size of 600x600 pixels (Definition of this display size in line 50 and 51).

I try to find the reason for this small pictures and how we can get bigger ones.

Does anyone knows, if Apple has changed something in the API in the last few days?
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version
MMuser2011
Posts: 1308
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: iTunesMonkey 1.0 + Acoustid

Post by MMuser2011 »

I've got it! :wink:
It seems that Apple sligthly changed the syntax for the 100x100 thumbnail picture URL.

If you want to fix it manually and get back the bigger iTunes cover art:
Repeat step 1 and 2 from http://www.mediamonkey.com/forum/viewto ... 35#p411315

3. Search for the line with this text

Code: Select all

reArtworkURL.Pattern = "\b\d+x\d+(?=-\d+\.jpg$)"
there should be only one exactly matching line

4. Replace this line completely with

Code: Select all

reArtworkURL.Pattern = "\d+x\d+(?=.*-\d+\.jpg$)"
5. Save the modified file iTunesMonkey.vbs

Run this script inside MediaMonkey as usual.

As you already know:
This is only a workaround until the original Author 'CarlitoGil' provides a real fix.
Double check your results after applying this workaround.

As soon I get some positive feedback, I will upload the complete working script to a file hoster for your convenience.
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version
arkers
Posts: 1
Joined: Sun Sep 27, 2009 4:24 pm

Re: iTunesMonkey 1.0 + Acoustid

Post by arkers »

MMuser2011 wrote:I've got it! :wink:


As you already know:
This is only a workaround until the original Author 'CarlitoGil' provides a real fix.
Double check your results after applying this workaround.

As soon I get some positive feedback, I will upload the complete working script to a file hoster for your convenience.
I had to jump on and post a huge thank you to you for providing these workarounds. I was getting extremely frustrated with how slow this had become and you saved the day! :D
MMuser2011
Posts: 1308
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: iTunesMonkey 1.0 + Acoustid

Post by MMuser2011 »

Thank you for the feedback, arkers. :)

I still wait for an answer from ObsessiveTagger, if it works for him/her too. But anyway, everyone can download the complete patched version from here: http://www.happymonkeying.com/plugin.php?q=300103
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version
Peke
Posts: 17446
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: iTunesMonkey 1.0 + Acoustid

Post by Peke »

Can you Ask Author if he will parse the flag to you?
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
MMuser2011
Posts: 1308
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: iTunesMonkey 1.0 + Acoustid

Post by MMuser2011 »

@Peke: I try it.
Maybe you can edit his first post and add the link to this patched version?
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version
bobcov
Posts: 8
Joined: Mon Sep 29, 2008 1:34 am

Re: iTunesMonkey 1.0 + Acoustid

Post by bobcov »

The download link only gives me a file with a .php extension. How do I download the script? Okay, fixed that by renaming to .mmip, but now all of the scripts throw an error when used, except for AcousticFingerprint and iTunes Album. Invalid argument line 995 column 4. That line looks like this, but I am not a coder.

.style.width = (iProgress / iMax) * 100 &"%"
Post Reply