[WS] iTunes

Good deal, I didn't mean iTunes itself has an error but the the source of the problems he was experienceing, haha.

Pone.

This is a great script and certainly saves a ton of time so Thank You!

How would this script be modified to search by Artist and Title? I have some MP3 where I would like to find the original album the song came from vs. "greatest Hits" or "Compilation" type of CDs. The current script looks by Artist and Album. I would assume the output view would have to be modified to show which Albums the Track/Song was on.

Thanks for any help here.

Open the .src file
At the head of the file change these two lines:

[IndexUrl]=http://itunes.apple.com/search?term=%s&entity=album&limit=100&country=DE
[SearchBy]=%artist% %album%

into this:
[IndexUrl]=http://itunes.apple.com/search?term=%s&entity=song&limit=100&country=DE
[SearchBy]=%artist% %title%

Peronally, I would recomend discogs for this kind of research. It has a much better, more complete database. I tunes dates are not always correct from what I know, sometimes the have the date of the remastering or the digital release for old albums.

First, thank you so much Pone! ^_^

I'd like to contribute, I added some countries. I'm good with simple stuff :rolleyes:

I hope you don't mind it Pone :wink:

_iTunes_Music_album_CA.src (4.12 KB)
_iTunes_Music_album_CO.src (4.13 KB)
_iTunes_Music_album_DE.src (4.12 KB)
_iTunes_Music_album_ES.src (4.12 KB)
_iTunes_Music_album_FR.src (4.12 KB)
_iTunes_Music_album_GB.src (4.12 KB)
_iTunes_Music_album_HK.src (4.12 KB)
_iTunes_Music_album_JP.src (4.12 KB)
_iTunes_Music_album_DO.src (4.12 KB)
_iTunes_Music_album_US.src (4.12 KB)
_iTunes_Music_video_GB.src (2.88 KB)
_iTunes_Music_video_US.src (2.88 KB)

_iTunes_Music_album_CA.src (4.12 KB)

_iTunes_Music_album_CO.src (4.13 KB)

_iTunes_Music_album_DE.src (4.12 KB)

_iTunes_Music_album_ES.src (4.12 KB)

_iTunes_Music_album_FR.src (4.12 KB)

_iTunes_Music_album_GB.src (4.12 KB)

_iTunes_Music_album_HK.src (4.12 KB)

_iTunes_Music_album_JP.src (4.12 KB)

_iTunes_Music_album_US.src (4.12 KB)

_iTunes_Music_video_GB.src (2.88 KB)

_iTunes_Music_video_US.src (2.88 KB)

_iTunes_Music_album_DO.src (4.12 KB)

hi,
at the first, very thanks you to made a itunes.src!
I move the itunes.src to my \Mp3tag\data\sources, but re-run the Mp3tag I can't find this in source button, I don't why...
please help me. thanks!

Please do not double-post.
You have asked the same question in this post:
Feature Request - iTunes Tag Source?

See answer there.

I'm very like this src...
but I want to ask: can I write something in this src file to I want to find 1200x1200 cover arts in itunes?

thanks.

sorry, got it, I'll fix my problem.
thanks.

There is obviously a limit of not more than 200 songs for an album in this script.
This should normally be enough, but at the moment I tree to tag a box-set with 316 songs and 19 CDs and this script only shows me th first 200 songs.

Is there a way to change this limit?

Hm, no. I did not build a limit into the script. There is a limit for search results which is 200, but not for songs within a release.
Maybe that's some technical limit at itunes, like you have to get to a seconcd page at the 201st song. I don't know. If you post the link to the itunes pages of the 316 song release, I will have a look at the problem

Sorry, I oversaw your question since you had two post i a row.

A little test gave me positve results. I is actually possible.
And, I just saw that the script in the starting post still has only 100x100 covers, personally I use 600x600 as cduve gave instructions over a year ago.:
[WS] iTunes
The same works for 1200x1200, though I don't know if this cover size is available for all releases. If not, you will parsing results without covers. If this happens, please leave a note here.
Do you know which cover sizes itunes provides?

Time for an update of the script. I hope to fix poster's 200 song problem, after that will be a good time for an update.

Thank you pone that you have a look.
It's this edition:
https://itunes.apple.com/de/album/sandy-den...ion/id399636518

I noticed that on the website itunes lists the songs with a seperate numbering for every CD of the box.
Is there a possibility to get this extra information in the websearch results?
Dano's Amazon-MP3 scripts had this information most of the time but they don't work anymore.

Actually I have built this limit into the script. It's in line 37:
say "&entity=song&limit=200"

But it looks like itunes forces API users to set a limt and the maximum is 200:
https://www.apple.com/itunes/affiliates/res...search-api.html
So I'm afraid, I see no way to change that.

I can add discnumber and tracknumber to the script. Maybe at the update. Or I will build an optional code into the script, which can be activated by editing the script.
Until that, you can make my beta tester:

add this to the TRACK LOOP:

outputto "TRACK TEMP"

sayregexp "(?<=\"trackNumber\":)\d+?(?=\D)" ", " "}"
say "|"

outputto "DISCNUMBER"
sayregexp "(?<=\"discNumber\":)\d+?(?=\D)" ", " "}"
say "|"</i>

and this at the end of the script:

outputto "TITLE"
sayoutput "TRACKS"

outputto "TRACK"
sayoutput "TRACK TEMP"
set "TRACK TEMP"

please let me know if you are experiencing any troubles

I found this code before asking here and realized that changing the 200 to another value made no difference. So Itunes is obviously setting the limit anyway.

Do you see any workaround to get the informations for the tracks 201 - ...?
Is there a possibility for coding in a seperate script to skip the first 200 and start with 201?

Many thanks for your effort to make your scripts even better.
I made somes tests with your code-changes.

There is a shift-problem qith these consequences:
The track-numbers start with "2" instead of "1". Therefore the last track gets unnumbered in tracks and discnumbers. The second CD tracknumbers and disknumbers start with the last track of the first CD and so on.

I am sure you are able to fix this. :wink:

I found a solution of this problem myself.

I first had added

outputto "TRACK TEMP"
sayregexp "(?<=\"trackNumber\":)\d+?(?=\D)" ", " "}"
say "|"

outputto "DISCNUMBER"
sayregexp "(?<=\"discNumber\":)\d+?(?=\D)" ", " "}"
say "|"

at the end of the track loop.
I now added it in the track loop in the beginning after

joinuntil "\"}"
replace "\\\"" "&quot;"

and it works as intended.

What would I have to change to get these results:

  1. Tracknumbers like 101/15 (101=track 1 of first CD; 15=totaltracks per CD) if there is a CD-set.

  2. Disnumbers like 1/3 (Disk 1 of 3 disks)

I found the solution for 2.

outputto "DISCNUMBER"
sayregexp "(?<=\"discNumber\":)\d+?(?=\D)" ", " "}"
say "/"
sayregexp "(?<=\"discCount\":)\d+?(?=\D)" ", " "}"
say "|"

but no solution for 1, because I dont't know how to format the result for trackNumber with 2 or 3 digits and leaqding zeros.

This line adds a leading zero to all single digit tracknumber. Put it at the top of the track loop, after the first two lines with the "joinuntil" and "replace" commands:

regexpreplace ""trackNumber":(\d)(\D)" ""trackNumber":0$1$2"

after that, add the red lines to the track number section in the track loop:

outputto "TRACK TEMP"

sayregexp "(?<=\"discNumber\":)\d+?(?=\D)" ", " "}"
sayregexp "(?<=\"trackNumber\":)\d+?(?=\D)" ", " "}"
say "/"
sayregexp "(?<=\"trackCount\":)\d+?(?=\D)" ", " "}"    <!--colorc--></span><!--/colorc-->
say "|"</i>

(the same trick you did at discnumber)

No. You should think the should be something to do that. But I can't find anything. Google search in other forums also didn't bring much help.

Thank you pone.
Your suggestions work as intended.

Please be so kind and tell me what this piece of code does, becaus I like to lean and understand what I am doing:

regexpreplace "\"trackNumber\":(\d)(\D)" "\"trackNumber\":0$1$2"

So I have to tag 116 files manually because I cound not find another source that delivers this box-set.
Thank God that there are not so many box-sets which have more than 2000 songs. :rolleyes:

This adds a zero to single digit number (1-9)

in regular expressions:

\d is a digit, a single number 0-9

\D is every other character which is no digit.
() groups any sequence of characters which is inside the parenthesis together. This group can be recalled in the second part or the regexreplace command with $n ($1 and $2 in this case)

""trackNumber":(\d)(\D)"

\d\D is a digit which is NOT followed by another digit, so it's 1, 2, 3,... but not 10, 11, 12

""trackNumber":0$1$2"

this adds 0 in front of the single digit, than puts the single digit and whaterver followed after it as it was before
in cases of two digit numbers (10, 11, 12, ...) the command does nothing because the regular expression \"trackNumber\":\d\D can not be found.

thinking about that command again, I see I could have done it more simple:
regexpreplace ""trackNumber":(\d\D)" ""trackNumber":0$1"

Hi! I'm a total newbie to this stuff, and was helpfully pointed to your script from another forum. I have it installed and running fine, but I'm trying to get it to tag over 6000 of my songs. Is there any way to make it tag them all automatically, or am I going to be going through each one individually doing this? Thanks in advance!