Skip to main content

Topic: Album Art Downloader XUI (Read 1289168 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • AlexVallat
  • [*][*][*][*][*]
  • Developer
Album Art Downloader XUI
Reply #2675
Hi all,
I can't run AAD on Win 10 Pro. It throws this error when trying to start the program. All .NET version are installed.
Any ideas?

Huh, no, I've not seen that before, and I have checked that it works on Windows 10, so long as .net 3.5 is installed. According to the error report, it is related to the culture and language settings - what language is your version of Windows 10? Have you set up any special language or culture related settings? Unfortunately it looks like it's happening within the .net system code, all I'm doing is requesting the default settings store, so I don't know whether it will be possible for me to fix, but I can investigate the language angle a bit further.

Alex

  • marc2003
  • [*][*][*][*][*]
  • Developer
Album Art Downloader XUI
Reply #2676
i've not tested AAD recently but IIRC it has a last.fm artist download script included. this will no longer function as before because the html layout/URLs have changed since they've launched a new website.

  • wardakhin
  • [*]
Album Art Downloader XUI
Reply #2677
Hi all,
I can't run AAD on Win 10 Pro. It throws this error when trying to start the program. All .NET version are installed.
Any ideas?

Huh, no, I've not seen that before, and I have checked that it works on Windows 10, so long as .net 3.5 is installed. According to the error report, it is related to the culture and language settings - what language is your version of Windows 10? Have you set up any special language or culture related settings? Unfortunately it looks like it's happening within the .net system code, all I'm doing is requesting the default settings store, so I don't know whether it will be possible for me to fix, but I can investigate the language angle a bit further.

Alex


Hi Alex,
Yeah, my regional and location settings was mismatched after upgrade from Win 8.1 to Win 10... I sorted that, and now everything works fine.
Thanks for you input. 

Album Art Downloader XUI
Reply #2678
Quick question, how do I stop it from labeling everything starting with Folder, as in Folder - Front, Folder -  Back, I just want Front, back ect without the folder in front of it, I've gone into the settings and set my string up like this C:\Users\User\Pictures\Album Art\%artist%\%album%\%preset%.%extension% but when I go to download it reverts to the Folder - front, ect, call me picky but I just want front.jpg, back.jpg, ect labeling, it works easier with Foobar.

  • AlexVallat
  • [*][*][*][*][*]
  • Developer
Album Art Downloader XUI
Reply #2679
I've gone into the settings and set my string up like this C:\Users\User\Pictures\Album Art\%artist%\%album%\%preset%.%extension% but when I go to download it reverts to the Folder - front, ect

Are you using the file browser? If so, then you have to change the setting there (under Specify path to find images) to be just %preset%.%extension%

Album Art Downloader XUI
Reply #2680
I've gone into the settings and set my string up like this C:\Users\User\Pictures\Album Art\%artist%\%album%\%preset%.%extension% but when I go to download it reverts to the Folder - front, ect

Are you using the file browser? If so, then you have to change the setting there (under Specify path to find images) to be just %preset%.%extension%



I finally used that method and got it to name the way I wanted to

  • pochaboo
  • [*]
Album Art Downloader XUI
Reply #2681
Hello, Alex!
I edited your itunes.boo script a little.

Note:
* artworkUrl100's size-info often seems to be "100x100bb.jpg", not "100x100-75.jpg".
* We can often get full size image by appending "5000x5000-100.jpg" to imageUrlBase.
Code: [Select]
def Search(artist as string, album as string, results as IScriptResults):
artist = StripCharacters("&.'\";:?!", artist)
album = StripCharacters("&.'\";:?!", album)

searchResultsJson as string = GetPage("http://itunes.apple.com/search?entity=album&country=${CountryCode}&term=" + EncodeUrl("\"" + artist + "\" \"" + album + "\""))

json = JavaScriptSerializer()
searchResults = json.DeserializeObject(searchResultsJson) as Dictionary[of string, object]

results.EstimatedCount = searchResults["resultCount"]

for result as Dictionary[of string, object] in searchResults["results"]:
title = result["artistName"] + " - " + result["collectionName"]
url = result["collectionViewUrl"]
imageUrlBase = result["artworkUrl100"]
// Remove size from image to get base
#SizeMatch = Regex("^.+(?<size>\\d{2,4}x\\d{2,4}.+\\.jpg)$", RegexOptions.IgnoreCase).Match(imageUrlBase)
SizeMatch = Regex("^.+(?<size>100x100.+\\.jpg)$", RegexOptions.IgnoreCase).Match(imageUrlBase) //example: "100x100-75.jpg" or "100x100bb.jpg"
if (SizeMatch.Success):
imageUrlBase = imageUrlBase.Substring(0, imageUrlBase.Length - SizeMatch.Groups["size"].Value.Length)
else:
imageUrlBase = imageUrlBase.Substring(0, imageUrlBase.Length - "100x100-75.jpg".Length)

// See if full size jpg is available
if CheckResponse(imageUrlBase + "jpg"):
fullSizeImageUrl = imageUrlBase + "jpg"
extension = "jpg"
elif CheckResponse(imageUrlBase + "5000x5000-100.jpg"): //we can often get full size image!
fullSizeImageUrl = imageUrlBase + "5000x5000-100.jpg"
extension = "jpg"
elif CheckResponse(imageUrlBase + "5000x5000-75.jpg"):
fullSizeImageUrl = imageUrlBase + "5000x5000-75.jpg"
extension = "jpg"
elif CheckResponse(imageUrlBase + "tif"): // Couldn't find full size .jpg, try .tif
fullSizeImageUrl = imageUrlBase + "tif"
extension = "tiff"
elif CheckResponse(imageUrlBase + "1200x1200-75.jpg"): // Couldn't find full size .jpg or .tif, fall back on 1200x1200
fullSizeImageUrl = imageUrlBase + "1200x1200-75.jpg"
extension = "jpg"
else:
// Final fall back on 600x600
fullSizeImageUrl = imageUrlBase + "600x600-75.jpg"
extension = "jpg"

results.Add(imageUrlBase + "170x170-75.jpg", title, url, -1, -1, fullSizeImageUrl, CoverType.Front, extension);
There may be a mistake because I'm not a C#(and English, haha) expert.
Thank you for your great work!
  • Last Edit: 12 November, 2015, 03:39:46 AM by pochaboo

  • AlexVallat
  • [*][*][*][*][*]
  • Developer
Album Art Downloader XUI
Reply #2682
Hello, Alex!
I edited your itunes.boo script a little.

Thanks, looks good to me. Could you give me an example of a "100x100bb.jpg" style artwork I can use for testing? I thought it would make more sense to use the regex directly to get the url base, so ^(?<imageUrlBase>.+)100x100.+\.jpg making the capture the part we want to keep rather than the part to throw away. Also, can you tell me what the purpose of the other (commented) version with \d{2,4} instead of 100 ? Had you found any examples where the size wasn't 100?

Alex

  • pochaboo
  • [*]
Album Art Downloader XUI
Reply #2683
Thanks for your reply.
Could you give me an example of a "100x100bb.jpg" style artwork I can use for testing?

Yes, I can give you the following examples:
[artist]                [album]
Evanescence      Fallen
Adele                21
Michael Jackson  Thriller
Also, can you tell me what the purpose of the other (commented) version with \d{2,4} instead of 100 ? Had you found any examples where the size wasn't 100?

Sorry, I forgot to delete the comment. I have never found any cases where the size wasn't 100.
  • Last Edit: 13 November, 2015, 10:11:46 PM by pochaboo

  • AlexVallat
  • [*][*][*][*][*]
  • Developer
Album Art Downloader XUI
Reply #2684

OK, I'll ignore the possibility of not 100x100 then. I've uploaded the updated script now, thanks again.

Alex

  • pochaboo
  • [*]
Album Art Downloader XUI
Reply #2685
Thanks for updating the script! It works very well.
Also, thanks for a great application

  • vmcosco
  • [*]
Album Art Downloader XUI
Reply #2686
I have been using AAD for years without issue.  A couple of months ago, whenever I open the program, the window is completely transparent.  I have the title bar and window border but that is it.  I have uninstalled AAD and reinstalled without benefit.  Any idea what could be causing this?  I am running AAD on a headless Windows 7 x64 box that processes and houses all of my media.  Outside of standard windows updates, I have not made any changes to my system in quite some time.

Thanks for the help.

  • minterbrad
  • [*]
Album Art Downloader XUI
Reply #2687
When I find covers that have the same name, Album Art Downloader XUI asks me if I want to overwrite or rename the new cover and I have to answer all the times that I want to rename this does not overwrite the file present, and it's a break

Ah, OK, I understand now, you want an option to always overwrite, or to always save with another name, rather than asking for every file. Sorry, Album Art Downloader can't do that at present. I didn't think people would be overwriting existing files very often!

I'll consider adding a "Don't ask me again" checkbox to the Overwrite window for the next version. I don't really like the idea of overwriting files without warning, though, so I'd have to be careful about it. Perhaps it would only apply for the current session, and be forgotten next time you run AAD.


In saving subsequent images for the same album, is there a way to change the default renaming scheme from "Album.jpg, Album.jpg (2)..." to "Album.jpg(01), Album.jpg(02)..."?
This would solve sorting issues I am having in Windows and on HDI Dune player for sequential playback of an image slideshow.
I understand that there is a button option to rename manually, but that is tedious when saving as many unique images as possible for the same album.
I am using AAD within MP3Tag.
Great program!  Thanks!

  • AlexVallat
  • [*][*][*][*][*]
  • Developer
Album Art Downloader XUI
Reply #2688
A couple of months ago, whenever I open the program, the window is completely transparent.  I have the title bar and window border but that is it.  I have uninstalled AAD and reinstalled without benefit.  Any idea what could be causing this?
Not a clue, sorry. Never heard of that one before! You could try uninstalling and reinstalling the .NET Framework, that might help. Or even your graphics card drivers, that's been known to affect WPF.

In saving subsequent images for the same album, is there a way to change the default renaming scheme from "Album.jpg, Album.jpg (2)..." to "Album.jpg(01), Album.jpg(02)..."?

When the prompt appears offering you the choice to overwrite or to save with a new name, click the "Options..." link (just above the buttons) and you get a box where you can put in the scheme that you want to use. Yours would be %filename%.%extension%(%nn%)

It isn't possible to have it exactly as you describe because the first image saved won't have any numeric suffix to it. It's only when you try and overwrite an image that already exists that a suffix is added, so you would get "Album.jpg, Album.jpg(01), Album.jpg(02)...".

I should also point out that it's pretty weird to put the suffix after the extension. You can do it if you really want to, but I'd recommend %filename%(%nn%).%extension% instead.

Album Art Downloader XUI
Reply #2689
Where is the latest download?

  • marc2003
  • [*][*][*][*][*]
  • Developer
Album Art Downloader XUI
Reply #2690
I think you should consider reading the first post.

Album Art Downloader XUI
Reply #2691
I think you should consider reading the first post.

Oops! I was thinking this was part of Foobar. 

  • beesmyer
  • [*]
Album Art Downloader XUI
Reply #2692
I use my library in kodi as well. AS such I have the following structure...

music\artist\album\booklet
music\artist\extrafanart
music\artist\album

I have figured out how to get AAD to check for certain art like folder.jpg, fanart.jpg etc...
But I can't figure out how to get it to stop searching at certain folder levels or to leave certain folders out of the search.
For example... if I search for missing fanart.jpg in the artist folder it shows this missing in all folders like the albums, extrafanart, etc.. showing them as artists.
Is it possible to tell AAD to search in a certain folder level and return the result with an accurate listing of artist or albums?
I hope that makes sense.

  • AlexVallat
  • [*][*][*][*][*]
  • Developer
Album Art Downloader XUI
Reply #2693
Is it possible to tell AAD to search in a certain folder level and return the result with an accurate listing of artist or albums?

I would suggest using file path pattern matching, and including the parent folder as part of the pattern. So, in your case, to find C:\music\artist\fanart.jpg but not C:\music\artist\album\fanart.jpg, use a path pattern of "\music\%artist%\." and a path to find images of "fanart.jpg" (or fanart.%extension% if you might have non .jpg art files).

Alex

  • beesmyer
  • [*]
Album Art Downloader XUI
Reply #2694
Is it possible to tell AAD to search in a certain folder level and return the result with an accurate listing of artist or albums?

I would suggest using file path pattern matching, and including the parent folder as part of the pattern. So, in your case, to find C:\music\artist\fanart.jpg but not C:\music\artist\album\fanart.jpg, use a path pattern of "\music\%artist%\." and a path to find images of "fanart.jpg" (or fanart.%extension% if you might have non .jpg art files).

Alex


That's it. Thank you for your time. Was so close. Was missing the "." at the end.

  • NFS_FM
  • [*]
Album Art Downloader XUI
Reply #2695
Hello, is it possible to update the beatport script to act like this: YouTube. Also, check that method for iTunes, maybe it's possible to gain something more.

PS: I have already asked for SoundCloud, maybe you have came up with something?

  • AlexVallat
  • [*][*][*][*][*]
  • Developer
Album Art Downloader XUI
Reply #2696
Hello, is it possible to update the beatport script to act like this: YouTube. Also, check that method for iTunes, maybe it's possible to gain something more.

PS: I have already asked for SoundCloud, maybe you have came up with something?

I have updated beatport.boo, thanks. Sadly they are no longer offering their API without a key, so it has to use scraping now. It does try the +1 increment in id for a larger size, too.

As far as I know, nothing has changed with SoundCloud; there is still no useful search.

Alex

  • pochaboo
  • [*]
Album Art Downloader XUI
Reply #2697
Hello, Alex!
I created Gracenote script 
Code: [Select]
import System
import System.Xml
import System.Xml.Linq
import AlbumArtDownloader.Scripts
import util

class Gracenote(AlbumArtDownloader.Scripts.IScript):
Name as string:
get: return "Gracenote"
Version as string:
get: return "0.1"
Author as string:
get: return "VKP"

protected gnClientID as string:
get: return "XXXXXXX-XXXXXXXXXXXXXXXXXXX" //Please replace this with yours.
protected gnUserID as string:
get: return "XXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXX" //Please replace this with yours.
protected gnUrl as string:
get: return "https://c" + gnClientID.Substring(0, 7) + ".web.cddbp.net/webapi/xml/1.0/"
protected coverSizeSearchPattern as string:
get: return "XLARGE,LARGE,MEDIUM,SMALL,THUMBNAIL"

def Search(artist as string, album as string, results as IScriptResults):
resXml = System.Xml.XmlDocument()

//Search Artist Image
reqXml = CreateSearchAlbumXml(artist, album, "SINGLE_BEST_COVER", "ARTIST_IMAGE")
try:
resXml.Load(GetResultXmlStream(reqXml))
imageUrlNode = resXml.SelectSingleNode("/RESPONSES/RESPONSE[@STATUS='OK']/ALBUM/URL[@TYPE='ARTIST_IMAGE']")
imageUrl = imageUrlNode.InnerText
albumArtistNode = resXml.SelectSingleNode("/RESPONSES/RESPONSE[@STATUS='OK']/ALBUM/ARTIST")
try:
width = System.Int32.Parse(imageUrlNode.Attributes["WIDTH"].Value)
height = System.Int32.Parse(imageUrlNode.Attributes["HEIGHT"].Value)
except e:
width = -1
height = -1

results.Add(imageUrl, albumArtistNode.InnerText, imageUrl, width, height, imageUrl)
results.EstimatedCount = 1
except e:
results.EstimatedCount = 0

//Search Cover Art
reqXml = CreateSearchAlbumXml(artist, album, "", "COVER")
try:
resXml.Load(GetResultXmlStream(reqXml))
albumNodes as System.Xml.XmlNodeList = resXml.SelectNodes("/RESPONSES/RESPONSE[@STATUS='OK']/ALBUM")
results.EstimatedCount += System.Int32.Parse(resXml.SelectSingleNode("/RESPONSES/RESPONSE[@STATUS='OK']/RANGE/END").InnerText)
except e:
return

for albumNode as System.Xml.XmlNode in albumNodes:
try:
gnID = albumNode["GN_ID"].InnerText
reqXml = CreateFetchAlbumXml(gnID, "SINGLE_BEST_COVER", "COVER")
resXml.Load(GetResultXmlStream(reqXml))

imageUrlNode = resXml.SelectSingleNode("/RESPONSES/RESPONSE[@STATUS='OK']/ALBUM/URL[@TYPE='COVERART']")
imageUrl = imageUrlNode.InnerText
albumArtistNode = resXml.SelectSingleNode("/RESPONSES/RESPONSE[@STATUS='OK']/ALBUM/ARTIST")
albumTitleNode = resXml.SelectSingleNode("/RESPONSES/RESPONSE[@STATUS='OK']/ALBUM/TITLE")
title = albumArtistNode.InnerText + " - " + albumTitleNode.InnerText
try:
width = System.Int32.Parse(imageUrlNode.Attributes["WIDTH"].Value)
height = System.Int32.Parse(imageUrlNode.Attributes["HEIGHT"].Value)
except e:
width = -1
height = -1

results.Add(imageUrl, title , imageUrl, width, height, imageUrl, CoverType.Front)

except e:
continue

def RetrieveFullSizeImage(fullSizeCallbackParameter):
return fullSizeCallbackParameter

def CreateSearchAlbumXml(artist as string, album as string, mode as string, coverType as string):
xml = System.Xml.Linq.XElement("QUERIES",
       System.Xml.Linq.XElement("AUTH",
           System.Xml.Linq.XElement("CLIENT", gnClientID),
           System.Xml.Linq.XElement("USER", gnUserID)
           ),
       System.Xml.Linq.XElement("QUERY", System.Xml.Linq.XAttribute("CMD", "ALBUM_SEARCH"),
               System.Xml.Linq.XElement("MODE", mode),
               System.Xml.Linq.XElement("TEXT", System.Xml.Linq.XAttribute("TYPE", "ARTIST"), artist),
               System.Xml.Linq.XElement("TEXT", System.Xml.Linq.XAttribute("TYPE", "ALBUM_TITLE"), album),
               System.Xml.Linq.XElement("OPTION",
                   System.Xml.Linq.XElement("PARAMETER", "SELECT_EXTENDED"),
                   System.Xml.Linq.XElement("VALUE", coverType)
                   ),
               System.Xml.Linq.XElement("OPTION",
                   System.Xml.Linq.XElement("PARAMETER", "COVER_SIZE"),
                   System.Xml.Linq.XElement("VALUE", coverSizeSearchPattern)
                   )
           )
         )
return xml

def CreateFetchAlbumXml(gnID as string, mode as string, coverType as string):
xml = System.Xml.Linq.XElement("QUERIES",
       System.Xml.Linq.XElement("AUTH",
           System.Xml.Linq.XElement("CLIENT", gnClientID),
           System.Xml.Linq.XElement("USER", gnUserID)
           ),
       System.Xml.Linq.XElement("QUERY", System.Xml.Linq.XAttribute("CMD", "ALBUM_FETCH"),
               System.Xml.Linq.XElement("MODE", mode),
               System.Xml.Linq.XElement("GN_ID", gnID),
               System.Xml.Linq.XElement("OPTION",
                   System.Xml.Linq.XElement("PARAMETER", "SELECT_EXTENDED"),
                   System.Xml.Linq.XElement("VALUE", coverType)
                   ),
               System.Xml.Linq.XElement("OPTION",
                   System.Xml.Linq.XElement("PARAMETER", "COVER_SIZE"),
                   System.Xml.Linq.XElement("VALUE", coverSizeSearchPattern)
                   )
           )
         )
return xml

def GetResultXmlStream(reqXml as System.Xml.Linq.XElement):
postData = Encoding.UTF8.GetBytes(reqXml.ToString());
req = System.Net.HttpWebRequest.Create(gnUrl);
req.Method = "POST";
req.ContentType = "text/xml; encoding='utf-8'";
req.ContentLength = postData.Length;

reqStream = req.GetRequestStream();
reqStream.Write(postData, 0, postData.Length);
reqStream.Close();

res = req.GetResponse();
resStream = res.GetResponseStream();
return resStream

Please replace gnClientID and gnUserID with yours.
Thanks

  • AlexVallat
  • [*][*][*][*][*]
  • Developer
Album Art Downloader XUI
Reply #2698
Hello, Alex!
I created Gracenote script 

Please replace gnClientID and gnUserID with yours.
Thanks

Thank you for your effort, that is good work. Unfortunately I cannot distribute scripts which require API keys to use, as API keys are fundamentally incompatible with open source client software. It is not possible to use such keys without disclosing them to anyone who inspects the source. As all APIs that require accounts also require you to keep the keys secret (otherwise why even bother with them, I suppose), they can therefore not be used.

If anyone wants to make a private copy of the script and apply for their own developer account at gracenote then they are welcome to do so, but I cannot distribute a public version.

Alex

  • pochaboo
  • [*]
Album Art Downloader XUI
Reply #2699
If anyone wants to make a private copy of the script and apply for their own developer account at gracenote then they are welcome to do so, but I cannot distribute a public version.
I see.
I'm happy if this script helps anyone 

BTW, I edited your lastfm-artist.boo script a little.
Code: [Select]
def Search(artist as string, album as string, results as IScriptResults):
artist = StripCharacters("&.'\";:?!", artist)

encodedArtist = EncodeUrl(artist)
imagesHtml = GetPage("http://www.last.fm/music/${encodedArtist}/+images")

imageIdMatches = Regex("<a\\s+href=\"/music/[^/]+/\\+images/(?<id>[^\"]+)\"[^<]+<img src=\"(?<imageUrlBase>[^\"]+?)(?<thumbnail>\\d+x\\d+)/").Matches(imagesHtml)

results.EstimatedCount = imageIdMatches.Count

for imageIdMatch as Match in imageIdMatches:
id = imageIdMatch.Groups["id"].Value
imageUrlBase = imageIdMatch.Groups["imageUrlBase"].Value
thumbnail = imageIdMatch.Groups["thumbnail"].Value
results.Add(imageUrlBase + thumbnail + "/" + id, artist, "http://www.last.fm/music/${encodedArtist}/+images/${id}", -1, -1, imageUrlBase + "ar0/" + id);
I tested it by some artists. it seems to work properly.