Add script for pulling artist images from iTunes/Apple Music
Brought to you by:
alexvallat,
marclandis
Would you please be able to add a script for pulling artist images from iTunes?
Example image for "The Beatles": https://is4-ssl.mzstatic.com/image/thumb/Features/v4/77/e2/28/77e228ad-f685-23af-17a7-6aafee80e0b2/mzl.iqsemtpx.jpg/570x570cc.jpg
http://album-art.sourceforge.net/scripts/itunes.boo already exists.
Thanks for looking at the ticket, but that script only seems to pull down album images, and not artist images. Or is there another setting I'm not seeing?
Oh, sorry, my mistake didn't look clearly enough. The script is just for album images, yes, not artist imges.
Not sure if this is still something that could be looked at, but I've been playing around with the PowerShell Invoke-RestMethod function and have managed to put together a rudimentary iTunes artist image download function, which could probably by recreated in Boo by someone more adept at scripting than me?
An example for "The Beatles" would be as follows:
Invoke-RestMethod -Uri "https://itunes.apple.com/search?country=US&entity=musicArtist&term=the+beatles" | Select-Object -ExpandProperty results | Where-Object { $_.artistName -eq "The Beatles" } | Select-Object -ExpandProperty artistLinkUrl
This returns an array of artist page URLs:
https://music.apple.com/us/artist/the-beatles/136975?uo=4
https://music.apple.com/us/artist/the-beatles/1502588323?uo=4
You can then do a regex match on the HTML content of each URL to find the relevant image path, which currently seems to end with "380x380cc-60.jpg", and perform the same replacement functions as the album art script to get the largest image possible.