https://twitter.com/#!/tapbot_paul/status/138269351643070464
This is a ruby script to do what is being asked. I can't quite get it to work though. I believe it is because I'm not using the default locations or library. I have 3 different libraries on my machine, but I'm not sure if that actually has any effect on it...
Any ideas?
How exactly do you execute this script?
This is a ruby script to do what is being asked.
#!/usr/bin/env ruby
# 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
# install the required gems with the following commands
# sudo gem install json
# sudo gem install rb-appscript
# then run the script with "ruby meta.rb"
Reading 17494 tracks *********************************************************************************************************
Found 10564 matched tracks
Querying US store for 10564 tracks ********************************************************************************************************** 6738 updated
Querying GB store for 3888 tracks *************************************** 1203 updated
Querying AU store for 2690 tracks *************************** 171 updated
Querying FR store for 2520 tracks ************************** 53 updated
Querying DE store for 2467 tracks ************************* 52 updated
Querying CA store for 2416 tracks ************************* 98 updated
Querying IT store for 2319 tracks ************************ 8 updated
Querying JP store for 2311 tracks ************************ 14 updated
Querying DZ store for 2297 tracks *********************** 0 updated
Querying AO store for 2297 tracks *********************** 0 updated
Querying AI store for 2297 tracks *********************** 0 updated
Querying AG store for 2297 tracks *********************** 0 updated
Querying AR store for 2297 tracks *********************** 54 updated
Querying AM store for 2243 tracks *********************** 0 updated
Querying AT store for 2243 tracks *********************** 4 updated
Querying AZ store for 2239 tracks *********************** 0 updated
Querying BS store for 2239 tracks *********************** 0 updated
Querying BH store for 2239 tracks *********************** 0 updated
Querying BD store for 2239 tracks *********************** 0 updated
Querying BB store for 2239 tracks *********************** 0 updated
Querying BY store for 2239 tracks *********************** 0 updated
Querying BE store for 2239 tracks *********************** 35 updated
Querying BZ store for 2204 tracks *********************** 0 updated
Querying BM store for 2204 tracks *********************** 0 updated
Querying BO store for 2204 tracks *********************** 0 updated
Querying BW store for 2204 tracks *********************** 0 updated
Querying BR store for 2204 tracks *********************** 0 updated
Querying BN store for 2204 tracks *********************** 0 updated
Querying BG store for 2204 tracks *********************** 6 updated
Querying CM store for 2198 tracks ********************** 0 updated
Querying KY store for 2198 tracks ********************** 0 updated
Querying CL store for 2198 tracks ********************** 0 updated
Querying CN store for 2198 tracks ********************** 0 updated
Querying CO store for 2198 tracks ********************** 0 updated
Querying CR store for 2198 tracks ********************** 0 updated
Querying CI store for 2198 tracks ********************** 0 updated
Querying HR store for 2198 tracks ********************** 0 updated
Querying CY store for 2198 tracks ********************** 0 updated
Querying CZ store for 2198 tracks ********************** 14 updated
Querying DK store for 2184 tracks ********************** 6 updated
Querying DM store for 2178 tracks ********************** 0 updated
Querying DO store for 2178 tracks ********************** 0 updated
Querying EC store for 2178 tracks ********************** 0 updated
Querying EG store for 2178 tracks ********************** 0 updated
Querying SV store for 2178 tracks ********************** 0 updated
Querying EE store for 2178 tracks ********************** 0 updated
Querying ET store for 2178 tracks ********************** 0 updated
Querying FI store for 2178 tracks ********************** 0 updated
Querying GH store for 2178 tracks ********************** 0 updated
Querying GR store for 2178 tracks ********************** 0 updated
Querying GD store for 2178 tracks ********************** 0 updated
Querying GT store for 2178 tracks ********************** 0 updated
Querying GY store for 2178 tracks ********************** 0 updated
Querying HN store for 2178 tracks ********************** 0 updated
Querying HK store for 2178 tracks ********************** 0 updated
Querying HU store for 2178 tracks ********************** 4 updated
Querying IS store for 2174 tracks ********************** 0 updated
Querying IN store for 2174 tracks ********************** 0 updated
Querying ID store for 2174 tracks ********************** 0 updated
Querying IE store for 2174 tracks ********************** 1 updated
Querying IL store for 2173 tracks ********************** 0 updated
Querying JM store for 2173 tracks ********************** 0 updated
Querying JO store for 2173 tracks ********************** 0 updated
Querying KZ store for 2173 tracks ********************** 0 updated
Querying KE store for 2173 tracks ********************** 0 updated
Querying KR store for 2173 tracks ********************** 0 updated
Querying KW store for 2173 tracks ********************** 0 updated
Querying LV store for 2173 tracks ********************** 0 updated
Querying LB store for 2173 tracks ********************** 0 updated
Querying LY store for 2173 tracks ********************** 0 updated
Querying LI store for 2173 tracks ********************** 0 updated
Querying LT store for 2173 tracks ********************** 0 updated
Querying LU store for 2173 tracks ********************** 0 updated
Querying MO store for 2173 tracks ********************** 0 updated
Querying MK store for 2173 tracks ********************** 0 updated
Querying MG store for 2173 tracks ********************** 0 updated
Querying MY store for 2173 tracks ********************** 0 updated
Querying MV store for 2173 tracks ********************** 0 updated
Querying ML store for 2173 tracks ********************** 0 updated
Querying MT store for 2173 tracks ********************** 0 updated
Querying MU store for 2173 tracks ********************** 0 updated
Querying MX store for 2173 tracks ********************** 140 updated
Querying MD store for 2036 tracks ********************* 0 updated
Querying MS store for 2036 tracks ********************* 0 updated
Querying MM store for 2036 tracks ********************* 0 updated
Querying NP store for 2036 tracks ********************* 0 updated
Querying NL store for 2036 tracks ********************* 1 updated
Querying NZ store for 2035 tracks ********************* 0 updated
Querying NI store for 2035 tracks ********************* 0 updated
Querying NE store for 2035 tracks ********************* 0 updated
Querying NG store for 2035 tracks ********************* 0 updated
Querying NO store for 2035 tracks ********************* 0 updated
Querying OM store for 2035 tracks ********************* 0 updated
Querying PK store for 2035 tracks ********************* 0 updated
Querying PA store for 2035 tracks ********************* 0 updated
Querying PY store for 2035 tracks ********************* 0 updated
Querying PE store for 2035 tracks ********************* 0 updated
Querying PH store for 2035 tracks ********************* 0 updated
Querying PL store for 2035 tracks ********************* 1 updated
Querying PT store for 2034 tracks ********************* 0 updated
Querying QA store for 2034 tracks ********************* 0 updated
Querying RO store for 2034 tracks ********************* 0 updated
Querying RU store for 2034 tracks ********************* 0 updated
Querying KN store for 2034 tracks ********************* 0 updated
Querying LC store for 2034 tracks ********************* 0 updated
Querying VC store for 2034 tracks ********************* 0 updated
Querying SA store for 2034 tracks ********************* 0 updated
Querying SN store for 2034 tracks ********************* 0 updated
Querying RS store for 2034 tracks ********************* 0 updated
Querying SG store for 2034 tracks ********************* 0 updated
Querying SK store for 2034 tracks ********************* 0 updated
Querying SI store for 2034 tracks ********************* 0 updated
Querying ZA store for 2034 tracks ********************* 0 updated
Querying ES store for 2034 tracks ********************* 1 updated
Querying LK store for 2033 tracks ********************* 0 updated
Querying SR store for 2033 tracks ********************* 0 updated
Querying SE store for 2033 tracks ********************* 0 updated
Querying CH store for 2033 tracks ********************* 5 updated
Querying TW store for 2028 tracks ********************* 0 updated
Querying TZ store for 2028 tracks ********************* 0 updated
Querying TH store for 2028 tracks ********************* 0 updated
Querying TT store for 2028 tracks ********************* 0 updated
Querying TN store for 2028 tracks ********************* 0 updated
Querying TR store for 2028 tracks ********************* 0 updated
Querying TC store for 2028 tracks ********************* 0 updated
Querying UG store for 2028 tracks ********************* 0 updated
Querying UA store for 2028 tracks ********************* 0 updated
Querying AE store for 2028 tracks ********************* 0 updated
Querying UY store for 2028 tracks ********************* 0 updated
Querying UZ store for 2028 tracks ********************* 0 updated
Querying VE store for 2028 tracks ********************* 0 updated
Querying VN store for 2028 tracks ********************* 0 updated
Querying VG store for 2028 tracks ********************* 0 updated
Querying YE store for 2028 tracks ********************* 0 updated
Couldn't find meatadata for 2028 tracks
Do you by chance have Xcode installed?I bolded the commands to type in Terminal.
Reading 5412 tracks **************
Found 1408 matched tracks
Querying US store for 1408 tracks *************** 839 updated
Querying GB store for 577 tracks ****** 102 updated
Querying AU store for 475 tracks ***** 29 updated
Querying FR store for 446 tracks ***** 23 updated
Querying DE store for 423 tracks ***** 2 updated
Querying CA store for 421 tracks ***** 4 updated
Querying IT store for 417 tracks ***** 5 updated
Querying AT store for 412 tracks ***** 1 updated
Querying BE store for 411 tracks ***** 1 updated
Querying CZ store for 410 tracks ***** 3 updated
Querying DK store for 407 tracks ***** 1 updated
Querying MX store for 406 tracks ***** 6 updated
Querying NL store for 400 tracks **** 1 updated
Couldn't find meatadata for 399 tracks
Here is a link to download the script: https://gist.github.com/368476/a52777ef8ccd63802d72f3cbf26d5800ab5402d4
Place it in your user folder.
I can tell you how it I did, although there may be an easier way.I'm still confused about how to get this script to work. Can you please outline exactly what needs to be done?
This ruined my metadata. Use at your own risk, or you'll be renumbering tracks and changing albums for the next 4 hours like me.
I appreciate the effort but man this hurts.
Here is what I am getting. It says it times out and it isn't working for me for some reason. Last night I had only 1 song in my library that I ran it on and it worked right away and updated the song. Now it isn't working at all for me. Any suggestions on what I could be doing wrong or what is stopping it from working?Last login: Thu Dec 8 20:05:18 on ttys000
USERNAMEs-MacBook-Air:~ USERNAME$ cd downloads
USERNAMEs-MacBook-Air:downloads USERNAME$ sudo gem install json
Password:
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...
USERNAMEs-MacBook-Air:downloads USERNAME$ 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...
USERNAMEs-MacBook-Air:downloads USERNAME$ ruby meta.rb
Reading 5527 tracks **************************************************
Found 5039 matched tracks
Querying US store for 5039 tracks /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:560:in `initialize': getaddrinfo: nodename nor servname provided, or not known (SocketError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:560:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:560:in `connect'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:53:in `timeout'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:93:in `timeout'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:560:in `connect'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:553:in `do_start'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:542:in `start'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:242:in `open_http'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:616:in `buffer_open'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:164:in `open_loop'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:162:in `catch'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:162:in `open_loop'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:132:in `open_uri'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:518:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:30:in `open'
from meta.rb:85
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/delegate.rb:137:in `each_slice'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/delegate.rb:137:in `each'
from meta.rb:83:in `each_slice'
from meta.rb:83
from meta.rb:80:in `each'
from meta.rb:80
USERNAMEs-MacBook-Air:downloads USERNAME$