[WS] Apple Music

Apple do not distinguish composers and lyricists. And as long as the Apple Music or iTunes app have support for that field, I don't expect them to, unless that changes.

If you have a release where knowing the lyricist (or another field) is important, I could check if there is more metadata available and add it to the script.

I've been trying to extract the country code from the Apple Music script without luck. It looks like the only place it is available is in the storefronts data, which I am having issues accessing. Would you be able to suggest where in the script and how I might be able to pull and write the two letter country code?

Thanks

I did not test this, but if you put this before "json_select "mp3tagalbum"" it should work

json_select_object ".storefronts"
  json_select_array "d" 1
    json_select "id"
    OutputTo "COUNTRYCODE"
    SayRest
  json_unselect_object
json_unselect_object

Worked like a charm. Much appreciated!

Updated scripts again, should be better at getting more releases.

Apple Music for Mp3Tag 1.5.zip (35.2 KB)
iTunes API for Mp3Tag 1.7.zip (33.6 KB)

2 Likes

As I understand Apple puts all under "composer". Here are some examples for albums:
https://music.apple.com/fr/album/belle-ile-en-mer-1977-1988/253082950
Laurent Voulzy ist the composer in most cases, Alain Souchon the lyricist.

https://music.apple.com/gb/album/goodbye-yellow-brick-road-deluxe/1440883261
One of the best known writer-duos: Elton John as the composer and Bernie Taupin as the lyricist.

https://music.apple.com/de/album/die-dreigroschenoper-the-threepenny-opera/419413100
Kurt Weill as composer and Bertolt Brecht, the famous author as lyricist.

Apple is not alone with throwing things together. Often sources use "Written by" for both. It would be not such a problem if there was an official tagfield named "Author" or Writer", where you could name both but naming both of them "composer" is irritating.

BTW:
I am not so familiar with the apple-world. Is there a website where you see all those informations you get in your apple-script?

Another thing:
You script lists a tagfiled AMLYRICS and gets informations of 0 or 1. As I understand that could stand for "Apple Music Lyrics", right?
Are you able to get these lyrics in cases the field shows 1?

Apple Music has its history from MP3 world and the SoundJam app, as well as requiring the AMG database, which all only uses "composer" only. This was all in iTunes days, but they don't seem to have expanded it further. I guess it is because there is little value for them in return, and having one field only makes the apps more coherent. Now it seem like the record labels update the data themselves, directly in Apple Music. While Apple have relatively strict guidelines for metadata, many labels do not (especially minor ones) follow them.

The Apple documentation for iTunes Api, and Apple Music is here:
https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/iTuneSearchAPI/index.html#//apple_ref/doc/uid/TP40017632-CH3-SW1

and

https://developer.apple.com/documentation/applemusicapi

AMLYRICS is just if Apple have lyrics or not, I was looking for a way to get it, but I don't know of any way. I should probably remove the tag from future scripts, as I don't think it is necessary for anyone.

Hello,
Mp3Tag has just been updated to support a bunch of m4a fields such as the Album ID via ITUNESALBUMID. Can you please update your source to support it? Ik it’s probably so easy and I could just tweak it myself but I have no knowledge about that :confused:

I will check out the new ones and make an update.

Edit:
Here are new versions to support the new tags. Check if it works. It seem like the country storefront id is not being saved as sfID.

Apple Music for Mp3Tag 1.6.zip (33.3 KB)
iTunes API for Mp3Tag 1.8.zip (34.2 KB)

2 Likes

just checked with AtomicParsley. Everything is saved properly except for the country id. not a big deal tho. thanks for the good job

The ITUNESCOUNTRYID is supposed to be the storefront ID, not the two-digit country code. Also, there is a funny x at line 249 of Apple Music Web.inc.

Please also remove the debug output from the official scripts — it has performance implications and also might Mp3tag seem suspicious, trying to create random files in the root folder of the system drive.

you can find storefront IDs listed here
https://code.google.com/archive/p/mp4v2/wikis/iTunesMetadata.wiki

1 Like

Yes I already figured out that it should be the storefront id, I think I will drop saving that field altogether as it is not really that useful. You already choose which storefront by which country store to collect the information from anyway. Another option will be to convert the country code to the respective storefront id.

The "x" is deliberate, although I should have removed it (actually the entire surrounding code) as well as the debug output, which I always keep forgetting to remove, before publishing. Sorry about that. I store the debug on the root because I run MP3tag on my M1 Mac via crossover and it is too tedious to keep it buried deeply.

I was originally hesitant to update the script until the 3.06b version of MP3Tag was not a beta version, but because it was requested I rushed out a new version yesterday. If the script is run on a pre beta version they will not be stored as expected. Which brings me another curious question to what happens if you open those tags again after saved in 3.06a and earlier and save again in v 3.06b?

Anyway here are new version, not much changes except some removals.
Apple Music for Mp3Tag 1.6.zip (33.0 KB)
iTunes API for Mp3Tag 1.8.zip (34.3 KB)

3 Likes

No problem with the small issues, just wanted to mention.

Then they're converted from custom fields to the new iTunes-specific fields.