Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Tha Professor

macrumors regular
Apr 21, 2009
170
43
The Mothership
In the script, it says it scrapes the metadata for selected tracks or for entire library if nothing is selected.. Maybe just a heads up for people who do not wish to be fixing their entire library. Just use for untagged tracks!

I haven't tried it yet, since I only matched a part of library that is perfectly tagged, but I will add new stuff that is not very well tagged as soon as I finish uploading the first part...
 

ipedro

macrumors 603
Nov 30, 2004
6,250
8,534
Toronto, ON
So you select the songs you want to retag in iTunes before running the script? Is that how it works with selected tracks?
 

Tha Professor

macrumors regular
Apr 21, 2009
170
43
The Mothership
by @tapbot_paul
# Don't blame me if this nukes your metadata, formats your drive, kills your kids
# This script goes through any iCloud Matched songs in your iTunes library and tries to update the
# metadata from the iTunes Store
# Will run against selected tracks or if nothing selected entire library

that's exactly how I understood it...
 

ipedro

macrumors 603
Nov 30, 2004
6,250
8,534
Toronto, ON
I ran my library:

Reading 7108 tracks ********
Found 836 matched tracks
Querying US store for 836 tracks ********* 420 updated
Querying GB store for 419 tracks ***** 136 updated
Querying AU store for 284 tracks *** 31 updated
Querying FR store for 253 tracks *** 3 updated
Querying DE store for 250 tracks *** 14 updated
Querying CA store for 236 tracks *** 31 updated
Querying IT store for 205 tracks *** 3 updated
Querying JP store for 202 tracks *** 0 updated
Querying DZ store for 202 tracks *** 0 updated
Querying AO store for 202 tracks *** 0 updated
Querying AI store for 202 tracks *** 0 updated
Querying AG store for 202 tracks *** 0 updated
Querying AR store for 202 tracks *** 23 updated
Querying AM store for 179 tracks ** 0 updated
Querying AT store for 179 tracks ** 0 updated
Querying AZ store for 179 tracks ** 0 updated
Querying BS store for 179 tracks ** 0 updated
Querying BH store for 179 tracks ** 0 updated
Querying BD store for 179 tracks ** 0 updated
Querying BB store for 179 tracks ** 0 updated
Querying BY store for 179 tracks ** 0 updated
Querying BE store for 179 tracks ** 11 updated
Querying BZ store for 168 tracks ** 0 updated
Querying BM store for 168 tracks ** 0 updated
Querying BO store for 168 tracks ** 0 updated
Querying BW store for 168 tracks ** 0 updated
Querying BR store for 168 tracks ** 0 updated
Querying BN store for 168 tracks ** 0 updated
Querying BG store for 168 tracks ** 0 updated
Querying CM store for 168 tracks ** 0 updated
Querying KY store for 168 tracks ** 0 updated
Querying CL store for 168 tracks ** 0 updated
Querying CN store for 168 tracks ** 0 updated
Querying CO store for 168 tracks ** 0 updated
Querying CR store for 168 tracks ** 0 updated
Querying CI store for 168 tracks ** 0 updated
Querying HR store for 168 tracks ** 0 updated
Querying CY store for 168 tracks ** 0 updated
Querying CZ store for 168 tracks ** 0 updated
Querying DK store for 168 tracks ** 0 updated
Querying DM store for 168 tracks ** 0 updated
Querying DO store for 168 tracks ** 0 updated
Querying EC store for 168 tracks ** 0 updated
Querying EG store for 168 tracks ** 0 updated
Querying SV store for 168 tracks ** 0 updated
Querying EE store for 168 tracks ** 0 updated
Querying ET store for 168 tracks ** 0 updated
Querying FI store for 168 tracks ** 0 updated
Querying GH store for 168 tracks ** 0 updated
Querying GR store for 168 tracks ** 0 updated
Querying GD store for 168 tracks ** 0 updated
Querying GT store for 168 tracks ** 0 updated
Querying GY store for 168 tracks ** 0 updated
Querying HN store for 168 tracks ** 0 updated
Querying HK store for 168 tracks ** 0 updated
Querying HU store for 168 tracks ** 0 updated
Querying IS store for 168 tracks ** 0 updated
Querying IN store for 168 tracks ** 0 updated
Querying ID store for 168 tracks ** 0 updated
Querying IE store for 168 tracks ** 0 updated
Querying IL store for 168 tracks ** 0 updated
Querying JM store for 168 tracks ** 0 updated
Querying JO store for 168 tracks ** 0 updated
Querying KZ store for 168 tracks ** 0 updated
Querying KE store for 168 tracks ** 0 updated
Querying KR store for 168 tracks ** 0 updated
Querying KW store for 168 tracks ** 0 updated
Querying LV store for 168 tracks ** 0 updated
Querying LB store for 168 tracks ** 0 updated
Querying LY store for 168 tracks ** 0 updated
Querying LI store for 168 tracks ** 0 updated
Querying LT store for 168 tracks ** 0 updated
Querying LU store for 168 tracks ** 0 updated
Querying MO store for 168 tracks ** 0 updated
Querying MK store for 168 tracks ** 0 updated
Querying MG store for 168 tracks ** 0 updated
Querying MY store for 168 tracks ** 0 updated
Querying MV store for 168 tracks ** 0 updated
Querying ML store for 168 tracks ** 0 updated
Querying MT store for 168 tracks ** 0 updated
Querying MU store for 168 tracks ** 0 updated
Querying MX store for 168 tracks ** 2 updated
Querying MD store for 166 tracks ** 0 updated
Querying MS store for 166 tracks ** 0 updated
Querying MM store for 166 tracks ** 0 updated
Querying NP store for 166 tracks ** 0 updated
Querying NL store for 166 tracks ** 1 updated
Querying NZ store for 165 tracks ** 0 updated
Querying NI store for 165 tracks ** 0 updated
Querying NE store for 165 tracks ** 0 updated
Querying NG store for 165 tracks ** 0 updated
Querying NO store for 165 tracks ** 0 updated
Querying OM store for 165 tracks ** 0 updated
Querying PK store for 165 tracks ** 0 updated
Querying PA store for 165 tracks ** 0 updated
Querying PY store for 165 tracks ** 0 updated
Querying PE store for 165 tracks ** 0 updated
Querying PH store for 165 tracks ** 0 updated
Querying PL store for 165 tracks ** 1 updated
Querying PT store for 164 tracks ** 0 updated
Querying QA store for 164 tracks ** 0 updated
Querying RO store for 164 tracks ** 0 updated
Querying RU store for 164 tracks ** 0 updated
Querying KN store for 164 tracks ** 0 updated
Querying LC store for 164 tracks ** 0 updated
Querying VC store for 164 tracks ** 0 updated
Querying SA store for 164 tracks ** 0 updated
Querying SN store for 164 tracks ** 0 updated
Querying RS store for 164 tracks ** 0 updated
Querying SG store for 164 tracks ** 0 updated
Querying SK store for 164 tracks ** 0 updated
Querying SI store for 164 tracks ** 0 updated
Querying ZA store for 164 tracks ** 0 updated
Querying ES store for 164 tracks ** 0 updated
Querying LK store for 164 tracks ** 0 updated
Querying SR store for 164 tracks ** 0 updated
Querying SE store for 164 tracks ** 0 updated
Querying CH store for 164 tracks ** 2 updated
Querying TW store for 162 tracks ** 0 updated
Querying TZ store for 162 tracks ** 0 updated
Querying TH store for 162 tracks ** 0 updated
Querying TT store for 162 tracks ** 0 updated
Querying TN store for 162 tracks ** 0 updated
Querying TR store for 162 tracks ** 0 updated
Querying TC store for 162 tracks ** 0 updated
Querying UG store for 162 tracks ** 0 updated
Querying UA store for 162 tracks ** 0 updated
Querying AE store for 162 tracks ** 0 updated
Querying UY store for 162 tracks ** 0 updated
Querying UZ store for 162 tracks ** 0 updated
Querying VE store for 162 tracks ** 0 updated
Querying VN store for 162 tracks ** 0 updated
Querying VG store for 162 tracks ** 0 updated
Querying YE store for 162 tracks ** 0 updated
Couldn't find meatadata for 162 tracks

Does this mean it didn't find matches for most of my library?

Reading 7108 tracks
Found 836 matched tracks

I believe it's because when I first got iTunes, I replaced the Artist field in songs with several artists, to artist + artist syntax. If so, it kind of defeats the purpose of this script if you have to have the artist, song title, album exactly like iTunes in order for it to find a match.
 

davidduzy

macrumors newbie
Dec 16, 2011
21
0
Europe apple store

Can someone help me? i've run the script but I live in Europe (itunes match is available since today in Belgium). but the script is not working :( What can i change?
 

m11rphy

macrumors 6502a
Dec 26, 2009
642
372
Hey Guys

If i run this script how do you limit it to just updating the songs you want updating ?
 

ruhrpotts-proud

macrumors newbie
Dec 18, 2011
11
0
Sadly, I always get an error, while executing the "sudo gem install rb-appscript" command.

Does anybody has an idea how to fix that? Spend hours trying to get this working... :(

Latest xCode is installed, the first command worked fine!


That's what I get after executing it:
Code:
Password:
Building native extensions.  This could take a while...
ERROR:  Error installing rb-appscript:
	ERROR: Failed to build gem native extension.

        /usr/local/bin/ruby extconf.rb
create /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1/src/osx_ruby.h ...
create /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1/src/osx_intern.h ...
creating Makefile

make
Makefile:188: warning: overriding commands for target `/usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1/lib'
Makefile:182: warning: ignoring old commands for target `/usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1/lib'
gcc -I. -I/usr/local/lib/ruby/1.8/i686-darwin9.7.0 -I/usr/local/lib/ruby/1.8/i686-darwin9.7.0 -Isrc -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -D_XOPEN_SOURCE=1  -fno-common -pipe -fno-common  -Wall  -c src/rbae.c
gcc -I. -I/usr/local/lib/ruby/1.8/i686-darwin9.7.0 -I/usr/local/lib/ruby/1.8/i686-darwin9.7.0 -Isrc -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -D_XOPEN_SOURCE=1  -fno-common -pipe -fno-common  -Wall  -c src/SendThreadSafe.c
cc -dynamic -bundle -undefined suppress -flat_namespace -o ae.bundle rbae.o SendThreadSafe.o -L. -L/usr/local/lib -L.  -framework Carbon -framework ApplicationServices    -lruby  -lpthread -ldl -lobjc  
ld: warning: ignoring file /usr/local/lib/libruby.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: in /usr/local/lib/libxml2.2.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64) for architecture x86_64
collect2: ld returned 1 exit status
make: *** [ae.bundle] Error 1


Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1/./gem_make.out
 

davidduzy

macrumors newbie
Dec 16, 2011
21
0
help please

I keep getting 0 ..

Can anyone please help?




Building native extensions. This could take a while...
Successfully installed json-1.6.3
1 gem installed
Installing ri documentation for json-1.6.3...
Installing RDoc documentation for json-1.6.3...
MacBook-Air-van-David:Downloads ******$ sudo gem install rb-appscript
Building native extensions. This could take a while...
Successfully installed rb-appscript-0.6.1
1 gem installed
Installing ri documentation for rb-appscript-0.6.1...
Installing RDoc documentation for rb-appscript-0.6.1...
MacBook-Air-van-David:Downloads ****** ruby meta.rb
Reading 2132 tracks
Found 0 matched tracks
Querying US store for 0 tracks 0 updated
MacBook-Air-van-David:Downloads ******$ ruby meta.rb
Reading 2132 tracks
Found 0 matched tracks
Querying GB store for 0 tracks 0 updated
MacBook-Air-van-David:Downloads ******$ ruby meta.rb
Reading 2132 tracks
Found 0 matched tracks
Querying BE store for 0 tracks 0 updated
MacBook-Air-van-David:Downloads ******$
 

enigma9682

macrumors newbie
Dec 18, 2011
2
0
That's exactly what is displayed here... The problem is I have an account for the German iTunes Store. Thus, not a single track is found and updated.

Would greatly appreciate if somebody could help here!
 

ruhrpotts-proud

macrumors newbie
Dec 18, 2011
11
0
Try to change this line:
Code:
if iTunes_track.kind.get == 'Abgeglichene AAC-Audiodatei'

Should work!
 
Last edited:

ruhrpotts-proud

macrumors newbie
Dec 18, 2011
11
0
Ok, I give up.
Spend the last hours trying to work my problem with the "sudo gem install rb-appscript" command out, but without any luck...

If anybody has an idea, please let me know!

Did a complete reinstall of Lion, which fixed my problem. Guess it was somehow connected to previously installed xCode Versions on Leopard and Snow Leopard.
 
Last edited:

CrazyMBalla

macrumors newbie
Jul 10, 2010
24
0
Hi Folks,

Need some help please! I keep getting the following, What am i doing wrong here?

Reading 6522 tracks
Found 0 matched tracks
Querying US store for 0 tracks 0 updated
 

ruhrpotts-proud

macrumors newbie
Dec 18, 2011
11
0
@CrazyMBalla You need to delete and redownload all of your tracks from the cloud first! Otherwhys you won't have the "matched aac audio" in your Tags and the script can't work.
 

CrazyMBalla

macrumors newbie
Jul 10, 2010
24
0
@CrazyMBalla You need to delete and redownload all of your tracks from the cloud first! Otherwhys you won't have the "matched aac audio" in your Tags and the script can't work.

WOW that's a ton of tracks to re-download. Does everyone just move their original to backup?
 

ruhrpotts-proud

macrumors newbie
Dec 18, 2011
11
0
I deleted everything and redownloaded it from the iTunes Store. That was why I bought iTunes Match, to get everything in a higher quality.

Btw. This is an awesome tool: http://tune-instructor.de/com/matchTag/app.html called matchTag. It will do the same as the script does, but with more options and a GUI (still Beta, will stop working after the 31st of December).
 

CrazyMBalla

macrumors newbie
Jul 10, 2010
24
0
I deleted everything and redownloaded it from the iTunes Store. That was why I bought iTunes Match, to get everything in a higher quality.

Btw. This is an awesome tool: http://tune-instructor.de/com/matchTag/app.html called matchTag. It will do the same as the script does, but with more options and a GUI (still Beta, will stop working after the 31st of December).

Ok, I have been downloading for about 5 hours now. Almost done! Thanks for your help, I will post back how things go after I run the script.
 

albrechtmj

macrumors newbie
Oct 19, 2011
4
0
Fellas-

I keep getting this result:

Reading 46 tracks
Found 46 matched tracks
Querying US store for 46 tracks */Library/Ruby/Gems/1.8/gems/rb-appscript-0.6.1/lib/appscript.rb:542:in `_send_command': CommandError (Appscript::CommandError)
OSERROR: -1731
MESSAGE: Unknown object type.
COMMAND: app("/Applications/iTunes.app").sources.ID(71).user_playlists.ID(100537).file_tracks.ID(100681).disc_number.set(1)
from /Library/Ruby/Gems/1.8/gems/rb-appscript-0.6.1/lib/appscript.rb:642:in `method_missing'
from meta.rb:43:in `update_track'
from meta.rb:91
from meta.rb:89:in `each'
from meta.rb:89
from meta.rb:87:in `each'
from meta.rb:87
from meta.rb:83:in `each_slice'
from meta.rb:83
from meta.rb:80:in `each'
from meta.rb:80

I can re-run "ruby meta.rb" after this result, and it works for one track (i.e. this time it says 45 tracks, then run it again with 44 tracks, etc.) but then it gives the same error and I have to re-type "ruby meta.rb" again, and again, and again...

I have about 2000 more tracks to go.

Suggestions?

Thank you!
 

albrechtmj

macrumors newbie
Oct 19, 2011
4
0
I think I figured it out...

I was using a Smart Playlist to keep track of the songs that needed tags.

I highlighted all of the songs in my Smart Playlist and created a new (normal) Playlist from Selection.

The script is now running properly (with about 69% success).

Fellas-

I keep getting this result:

Reading 46 tracks
Found 46 matched tracks
Querying US store for 46 tracks */Library/Ruby/Gems/1.8/gems/rb-appscript-0.6.1/lib/appscript.rb:542:in `_send_command': CommandError (Appscript::CommandError)
OSERROR: -1731
MESSAGE: Unknown object type.
COMMAND: app("/Applications/iTunes.app").sources.ID(71).user_playlists.ID(100537).file_tracks.ID(100681).disc_number.set(1)
from /Library/Ruby/Gems/1.8/gems/rb-appscript-0.6.1/lib/appscript.rb:642:in `method_missing'
from meta.rb:43:in `update_track'
from meta.rb:91
from meta.rb:89:in `each'
from meta.rb:89
from meta.rb:87:in `each'
from meta.rb:87
from meta.rb:83:in `each_slice'
from meta.rb:83
from meta.rb:80:in `each'
from meta.rb:80

I can re-run "ruby meta.rb" after this result, and it works for one track (i.e. this time it says 45 tracks, then run it again with 44 tracks, etc.) but then it gives the same error and I have to re-type "ruby meta.rb" again, and again, and again...

I have about 2000 more tracks to go.

Suggestions?

Thank you!
 

Hinza

macrumors newbie
Jun 8, 2011
18
0
BE
Can someone help me? i've run the script but I live in Europe (itunes match is available since today in Belgium). but the script is not working :( What can i change?

Try to change this line:
Code:
if iTunes_track.kind.get == 'Abgeglichene AAC-Audiodatei'

Should work!
Maybe if you change that to the dutch or french version?

Btw. This is an awesome tool: http://tune-instructor.de/com/matchTag/app.html called matchTag. It will do the same as the script does, but with more options and a GUI (still Beta, will stop working after the 31st of December).

Ah I want a windows version :(
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.