[WS] Apple Music

You need access to Apple Music API to fetch "Barcode" but some music use that 12-digit number as their album art filename. So if that happen you can grab them by:

json_select_object "artwork"
IfNot ""
		json_select_object "dictionary"
			json_select "url"
			RegexpReplace ".+\/(\d{12})\.jpg\/.*" "$1"
			RegexpReplace "^https.*" "Null"
			IfNot "Null"
				OutputTo "BARCODE"
				SayRest
			EndIf
		json_unselect_object
	json_unselect_object
EndIf

I think you were correct that the script wasn't able to find the settings file. I am using v3.7. The filename for the settings file (as downloaded and unzipped) was "&Apple Music#SettingsΓǪ.settings". I fixed the problem by renaming the settings file to "&Apple Music#Settings.settings", then opening the "Apple Music Web.inc" file and replacing "[Settings]=&Apple Music#Settings….settings" with "[Settings]=&Apple Music#Settings.settings". Now it's working.

@AreDigg was the settings filename supposed to be "&Apple Music#Settings….settings" or are the "…" there by accident somehow?

Check your software you use to unzip, or that your filesystem supports UTF-8.

1 Like

Thanks, at what line do I put it ?

IfOutput "ValidSection"
	json_foreach "items"
		# Primary
		...
		# Secondary
		# Cleanup
		# Third
		Set "SectionAlbum"
		Set "SectionSong"

Hmm, anywhere from # Secondary but before Set "SectionAlbum", but to be specific: Apple Music v3.7 lines 530-531

OutputTo "COVERURL"
json_select_object "artwork"
IfNot ""
		json_select_object "dictionary"
			...
		json_unselect_object
	json_unselect_object
EndIf

json_select_object "artwork"
IfNot ""
		json_select_object "dictionary"
			json_select "url"
			RegexpReplace ".+\/(\d{12})\.jpg\/.+" "$1"
			RegexpReplace "^https.*" "Null"
			IfNot "Null"
				OutputTo "BARCODE"
				SayRest
			EndIf
		json_unselect_object
	json_unselect_object
EndIf

# Third
IfOutput "SectionAlbum"
...

Tried on two albums but couldn't find the barcode value, I must be doing something wrong.

                    json_select_object "artwork"
                    IfNot ""
		                       json_select_object "dictionary"
			                        json_select "url"
			                        RegexpReplace ".+\/(\d{12})\.jpg\/.+" "$1"
			                        RegexpReplace "^https.*" "Null"
			                        IfNot "Null"
				                        OutputTo "BARCODE"
				                        SayRest
			                        EndIf
		                       json_unselect_object
	                json_unselect_object
                    EndIf
				
								
				# Third
				IfOutput "SectionAlbum"
				
					OutputTo "Album"
					json_select "title"
					IfNotVar "originalTitles" "true"
						Replace " - Single" ""
						Replace " - EP" ""
						RegexpReplace "\(.*\)" ""
						RegexpReplace "\[.*\]" ""
					EndIf
					If ""
						json_select "title"
					EndIf
					SayRest

Untitled_1


Here edited v3.7 I used. I only tested it with USA (English).src and UK (English).src
Apple Music Web v3.7.inc [edited].zip (4.5 KB)
Not every album art named with their barcode. BTW what you search for ?

Thanks Khai, it works but only a few albums retrieved the Barcode value, around 2 from 20 albums I tried so I think it's not worth the effort and maybe we should try something else that yields better results.

But in any case, I thank you for kind assistance, your contribution is highly appreciated.

Since the new versions became necessary, I've noticed changes in the search results.
If I remember the previous behavior correctly, matching albumnames and songnames according to the search string were listed in the previous versions.
But now I get all the songs on the album I'm looking for in the list of results, not just those whose title names match the album name.

I'm 99.99% interested in pure album results when searching the web source and the additional song results only bother me because they sometimes bring an inflation of results that are irrelevant to me. In my opinion, someone who is only interested in individual songs would enter them into the search mask and not search for the album.

Would it be possible to limit the list of results to albums and EPs by changing the script?

Yes I could add an option to not show the songs in the result.

I would appreciate this option.

I have tested out a new alternative version, which uses a python proxy web server. If you are a bit savvy you can try it out yourself. You need to make your own cert-keys for the server for ssl.

Thanks for bringing this option in your new version 3.10.

the script doesn't work at all on MAC version of mp3tag

It works, please be more specific (versions, queries, …)

1 Like

This looks interesting - would be willing to give it a go...?

hi florian sorry my mistake, the Apple Music for MP3Tag v3.10 works but its the web source 4.0b1 which i was trying out. this one somehow doesnt work. im on mac ventura 13.5.1 with mp3tag Version 1.8.5 (85)

First of all, thanks for making this fantastic script, AreDigg! For someone who needs quick acceess to metadata from recently released music, this is a huge time saver. Although I have one question:
Would it be possible to implement the Producer tag among the tags that are being imported? On one recent occasion it actually did, and I tried to figure out why – but I haven't been able to recreate the circumstances for it to happen again. It was an album that wasn't available on Apple Music in my territory, so I located the iTunes ID and used it to search though the US version of the script. My point being: Apparently it's possible, but is it possible to tweak it to make it standard?

There is no "producer" from the source, it adds a publisher if a "recordLabel" field is available.

Apparently there are two different sources

Is there a way to get composer info from the song credits?

P.D. Idk if I'm violating the terms for upload these screenshots, sorry for that.