Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Album Art Downloader XUI (Read 2056861 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: Album Art Downloader XUI

Reply #3100
Nice find, Ben Dodson has made his source available too, so I can use the same logic to get the original file when available. It will then fall back on all the existing fall-backs if that isn't there. Please give the attached itunes.boo 0.6 a try to compare with the results you had noticed were different, and see if the quality now matches? Or more importantly if there are any where it gives a worse result!

Yep, it works.

I must say, after much deliberation, I did decide to stick to using the old source, as I think the JPG files sourced from there are ever so slightly higher quality -- other than the albums that have PNG files uploaded on the new/alternate source (vanishingly few; Radiohead's discography is one such example). I suspect the new source uses a newer, more efficient JPEG encoder like mozjpeg, so they lowered the file size accordingly, but didn't do exhaustive pixel peeping like I do, so they didn't match the quality precisely between the old and new encodes.

Re: Album Art Downloader XUI

Reply #3101
If there is albumart available for booklets in good quality I like to download and add them to my album-folder.
Musicbrainz is often a source for these booklets (as pictures) and AAD seems to show up to 7 pictures. But when there are more covers available beacause the booklet is bigger they are not shown and I have to grab them from the website, which is not so comfortable and needs more time.

Is this a limitation of Musicbrainz, that AAD can not grab more pictures or dows AAD limit them and this could be changed?

Re: Album Art Downloader XUI

Reply #3102
Hi, firstly I love this app. -thanks! Has Qobuz script stopped working?

Re: Album Art Downloader XUI

Reply #3103
Thanks for reporting this, qobuz.boo v0.4 should now be working again.

Re: Album Art Downloader XUI

Reply #3104
In the results window all of a sudden I get really big pictures of the cover art. Does anyone know how to make the result icons smaller? I don't know what I did to make them so huge. The results used to be smaller in size.

Re: Album Art Downloader XUI

Reply #3105
Sounds like probably toggling between wide and square results using the little arrow button (⤶/⤴) at the bottom right of the results. That changes whether the text goes below or to the right of the art. If that's not it, then just grab the bottom right corner of the art and drag it to resize to whatever size you like.

Re: Album Art Downloader XUI

Reply #3106
This is such an incredibly useful and helpful program... ...when it works. And then sometimes it doesn't work, and it makes me wonder if I'm just doing something completely wrong.

Take this, for example:



I'm searching for cover art that I know exists on Discogs. How do I know it exists on Discogs? Well, when I type "Sun Jamming" into the Discogs search bar, I get:



But Album Art Downloader just finds some bizarrely-irrelevant album by a band called Happy Flowers, which doesn't even include a song called "Sun Jamming" or anything like that. I mean, the theme of the words themselves is on-point - sun jamming, flowers, surf music, happy hippies, sure, all fits in the same spray-painted VW Bus. But as a Boolean search, maybe not so much.

It also fails to return images on eBay or Amazon that both exist (though to be fair, the Amazon one only pops up on a Google Images search, not a direct Amazon.com search). See here and here for screenshots, if necessary. Neither of these show up in Album Art Downloader.

Is there something I can tweak on my end to either return more than one result from Discogs, or, failing that, to at least ensure that when I'm searching for "Sun Jamming", AAD actually sends the words "Sun" and "Jamming" to Discogs and returns the first result?

Re: Album Art Downloader XUI

Reply #3107
I've checked out the example of Sun Jamming on Discogs, and this isn't showing up because it doesn't have a Master Release (for some reason). The Discogs script searches for Master releases so as not to return a lot of duplicates. You could change that by editing discogs.boo in notepad and on line 28 replacing searchType=master with searchType=release, but you may find a lot of duplicates in your results.

Secondly, there was a bug with the discogs script that would stop it from working on pages where there was not a "More images" link beneath the album artwork. I've fixed that here: discogs.boo v0.27.

As far as the relevance of the search, there's not really much I can do about that. Album Art Downloader sends the search query "" "Sun Jamming" to Discogs (first "" because there is no artist), and those are the results it returns.

I expect better results could be obtained using the API, but they have gated this behind requiring an API key, which is not suitable for an open source application.

Re: Album Art Downloader XUI

Reply #3108
I've checked out the example of Sun Jamming on Discogs, and this isn't showing up because it doesn't have a Master Release (for some reason). The Discogs script searches for Master releases so as not to return a lot of duplicates. You could change that by editing discogs.boo in notepad and on line 28 replacing searchType=master with searchType=release, but you may find a lot of duplicates in your results.

Secondly, there was a bug with the discogs script that would stop it from working on pages where there was not a "More images" link beneath the album artwork. I've fixed that here: discogs.boo v0.27.

As far as the relevance of the search, there's not really much I can do about that. Album Art Downloader sends the search query "" "Sun Jamming" to Discogs (first "" because there is no artist), and those are the results it returns.

I expect better results could be obtained using the API, but they have gated this behind requiring an API key, which is not suitable for an open source application.

Thanks for the super-rapid response, Alex! I'll consider what you said about line 28.

I believe (though I'm not a Discogs expert by any means) that albums only get a "master release" once Discogs indexes a second pressing/edition of a release. So if all that's known is a single issue with a single pressing, no alternate media or regional releases, there's no need for a "master release" page, since the only release is itself the "master", and a separate "master release" page would be redundant.

I expect better results could be obtained using the API, but they have gated this behind requiring an API key, which is not suitable for an open source application.

For what it's worth, it seems they dropped the need for an API key when they went from 1.0 to 2.0. See https://www.discogs.com/developers/ for the Dev overview, and here, here, for a site dev mentioning that API keys are no longer required.

They're on OAuth now, which does require a consumer key. If AAD were my baby (and it's not, obviously - not trying to backseat drive, I'm just aimlessly burbling away like an uncle at a family reunion), I'd probably navigate this by initially setting the consumer key to a placeholder (either in source or in a .cfg file, whatever), then on runtime checking to see if the placeholder is still being used - if not, then we assume the clever user from the future saw the placeholder and generated their own consumer key and stuck it in there. If it is still the placeholder, then grab the "official" AAD consumer key from a text file hosted on Github or wherever.

But anyway, that's tangential - thanks again for the lightning-quick response!

Re: Album Art Downloader XUI

Reply #3109
they dropped the need for an API key when they went from 1.0 to 2.0
For access to image URLs it still requires a "consumer" key (as you mention). Whatever they call it, it's still a key I need in order to access the API, which has to be kept secret. Looks like an API key to me! Keeping a key secret is not an option for AAD, so I'm not going to write a script that requires it. I do take your point that users with registered discogs accounts could generate their own keys and then supply them in some sort of config file, or by editing the script, but that's not really a model I'm interested in putting much work into.

If anyone else wants to write a discogs-api script based on this principle, I'd be happy to include it in the list of scripts, though,

Re: Album Art Downloader XUI

Reply #3110
they dropped the need for an API key when they went from 1.0 to 2.0
For access to image URLs it still requires a "consumer" key (as you mention). Whatever they call it, it's still a key I need in order to access the API, which has to be kept secret. Looks like an API key to me! Keeping a key secret is not an option for AAD, so I'm not going to write a script that requires it. I do take your point that users with registered discogs accounts could generate their own keys and then supply them in some sort of config file, or by editing the script, but that's not really a model I'm interested in putting much work into.
Like Shakespeare said, "an API key by any other name..." ;)

If anyone else wants to write a discogs-api script based on this principle, I'd be happy to include it in the list of scripts, though,

Tempting, but might be a bit beyond my meager skills.

I did, however, edit Discogs.boo to be better at finding various-artist compilations. Discogs considers the artist for various-artist compilations to be "Various" and I personally index my collection as "Various Artists" (and others truncate it to "VA"). So this (crude) hack will feed Discogs "various" even if the "actual" artist per the file tags is "Various Artists" or "VA".

The edits are on lines 25-29; I could probably have just done an OR but, eh, why write two lines when you can write four. :)

Code: [Select]
# refs: System.Web.Extensions

import System
import System.Text.RegularExpressions
import System.Web.Script.Serialization
import AlbumArtDownloader.Scripts
import util

class Discogs(AlbumArtDownloader.Scripts.IScript):
def constructor():
// Discogs requires TLS 1.1 or greater
Tls12 = Enum.ToObject(typeof(System.Net.SecurityProtocolType), 3072);
Tls11 = Enum.ToObject(typeof(System.Net.SecurityProtocolType), 768);

System.Net.ServicePointManager.SecurityProtocol = Tls12 | Tls11 | System.Net.SecurityProtocolType.Tls
Name as string:
get: return "Discogs"
Author as string:
get: return "Alex Vallat"
Version as string:
get: return "0.27"
def Search(artist as string, album as string, results as IScriptResults):
//artist = StripCharacters("&.'\";:?!", artist)
//album = StripCharacters("&.'\";:?!", album)
//Discogs lists Various Artists compilations under "Various", many collections term these "Various Artists" or "VA"
if (artist = "Various Artists"):
artist="Various"
if (artist = "VA"):
artist="Various"
json = JavaScriptSerializer()

resultsInfoJson = GetDiscogsPage("https://www.discogs.com/search/ac?searchType=release&q=" + EncodeUrl("\"${artist}\" \"${album}\""))
resultsInfo = json.Deserialize[of (Result)](resultsInfoJson)

results.EstimatedCount = resultsInfo.Length;

for result in resultsInfo:
// Get the release info from api
title = result.GetString(result.artist) + " - " + result.GetString(result.title);
url = result.GetString(result.uri);
//id = url.Substring(url.LastIndexOf('/'));

releasePage = GetDiscogsPage("https://www.discogs.com" + url)

releasePageImagesMatches = Regex("\"Image:{[^{]+}\":(?<json>{.+?}})", RegexOptions.IgnoreCase | RegexOptions.Singleline).Matches(releasePage)
for match as Match in releasePageImagesMatches:
imageInfo = json.Deserialize[of ImageInfo](match.Groups["json"].Value)
if (imageInfo.fullsize != null and imageInfo.thumbnail != null):
fullInfo = json.Deserialize[of ImageRef](imageInfo.fullsize.__ref.Substring(10))
thumbInfo = json.Deserialize[of ImageRef](imageInfo.thumbnail.__ref.Substring(10))

results.Add(thumbInfo.sourceUrl, title, "https://www.discogs.com" + url + "/image/" + imageInfo.id, -1, -1, fullInfo.sourceUrl, CoverType.Unknown)

def RetrieveFullSizeImage(fullSizeCallbackParameter):
return GetPageStream(fullSizeCallbackParameter, null, true);

def GetDiscogsPage(url) as string:
request = System.Net.HttpWebRequest.Create(url) as System.Net.HttpWebRequest

request.Accept = "*/*"
request.UserAgent = "Mozilla/5.0 (AAD on " + System.Environment.MachineName + ")"

try:
response = request.GetResponse()
except ex as WebException:
exResponse = ex.Response as System.Net.HttpWebResponse
if (exResponse != null and exResponse.StatusCode == 308):
return GetDiscogsPage(exResponse.GetResponseHeader("Location"))
raise

stream = response.GetResponseStream()
try:
return GetPage(stream)
ensure:
stream.Close()

class Result:
public artist as object
public title as object
public uri as object

def GetString(value):
result = value as string;
if result is null:
result = (value as (object))[0] as string;
return result;

class ImageInfo:
public id as string
public thumbnail as ImageRefJson
public fullsize as ImageRefJson

class ImageRefJson:
public __ref as string

class ImageRef:
public sourceUrl as string

Re: Album Art Downloader XUI

Reply #3111
Thanks, I will include the "Various Artists" => "Various" thing in the next release. I'm not convinced about "VA", though, I've not encountered that before and it unlike "Various Artists" it isn't unambiguous enough that I could be certain that you would never want to search for "VA" itself.

Re: Album Art Downloader XUI

Reply #3112
Thanks, I will include the "Various Artists" => "Various" thing in the next release.

It needs one quick bit of polish - change the single-equals to double-equals, otherwise it just sets the artist to "Various" regardless of any puny human conditional:

Code: [Select]
def Search(artist as string, album as string, results as IScriptResults):
//artist = StripCharacters("&.'\";:?!", artist)
//album = StripCharacters("&.'\";:?!", album)
//Discogs lists Various Artists compilations under "Various", many collections term these "Various Artists" or "VA"
if (artist == "Various Artists"):
artist="Various"
if (artist == "VA"):
artist="Various"
json = JavaScriptSerializer()
(that's line 22-30, everything else is as-was).

I'm not convinced about "VA", though, I've not encountered that before and it unlike "Various Artists" it isn't unambiguous enough that I could be certain that you would never want to search for "VA" itself.

VA is a bit of a holdover from the Napster days. The "scene" still uses "VA" as the official standard for Various Artists (see here, section 4.2). This has resulted in a fair amount of spillover into FreeDB listings over the years. I agree that it's less common than Various Artists and Various, but it still shows up from time to time, and, imo, definitely shows up frequently enough to merit the substitution.

Also, and maybe more importantly: According to Discogs, this is the exhaustive list of artists named "VA". One of these - the primary "VA" artist, in fact - is actually a placeholder so people won't use "VA" for "Various Artists". Only two of those are actual groups named "VA", and neither one is particularly notable - one had a promo album in 2001 that apparently never got a full release, the other released a single EP on Bandcamp in 2019. The rest are either individuals who've never released a solo album (just members of bands, producers, etc) or, in at least one case (see here, are actually incorrect transcriptions for "Various".

It'd be different if this was replacing all instances of "VA" everywhere with "Various" ("ca va bien" = "ca Various bien"), but as best I can tell, it's well-behaved and only replaces the artist "VA" with "Various" - "va" can still be used in album titles and band names as Spanish or French for "goes" or an abbreviation for the state of Virginia, etc, and it won't be affected by this switch.

Also, because whoever coded AAD took a brilliantly modular approach (make sure to shake this guy's hand if you ever meet him! :D), this will only affect Discogs, and not other sites where "VA" may actually be a valid artist search term.

Re: Album Art Downloader XUI

Reply #3113
Thanks for the scenerules link, in that case I'm happy to do the VA substitution too. For VA I've made it case-sensitive so that if anyone does need to really search for an artist called "Va" that will work too. Updated discogs.boo

Re: Album Art Downloader XUI

Reply #3114
Hi,
I'm using AAD 1.05 with fb2k 64bit latest preview via run_services on Windows 11 and get crashes IF artist or album is longer than 34 chars. Dunno, if I mentioned this before, but those crashes are here for a long time.


This test-one runs nice:

Code: [Select]
".\user-components\AlbumArtDownloaderXUI\AlbumArt.exe"
 /ar "$cut(12345678901234567890123456789012345,34)"
 /al "$cut(12345678901234567890123456789012345,34)"
 /p "$replace(%_path%,%_filename_ext%,)%%artist%%%%album%%'~'%%type%%%%size%%%%source%%.%%extension%%"

When I change the cut to 35 (to send 1 more char to AAD), AAD crashes.

Code: [Select]
".\user-components\AlbumArtDownloaderXUI\AlbumArt.exe"
 /ar "$cut(12345678901234567890123456789012345,35)"
 /al "$cut(12345678901234567890123456789012345,35)"
 /p "$replace(%_path%,%_filename_ext%,)%%artist%%%%album%%'~'%%type%%%%size%%%%source%%.%%extension%%"
I'm not sure if this is a limitation of any of the above mentioned softwares, but I'm be glad to help out to get AAD work with longer artist/album as 34 chars.

Cheers!

Re: Album Art Downloader XUI

Reply #3115
Hi,
I'm using AAD 1.05 with fb2k 64bit latest preview via run_services on Windows 11 and get crashes IF artist or album is longer than 34 chars
I'm not seeing any crash when I pass parameters of more than 34 characters. What is the error message you get? Is an ".\user-components\AlbumArtDownloaderXUI\errorlog.txt" file created? Or an "%temp%\AAD_Errorlog.txt" file?

Is it possible that the full path including artist and album name ends up being more than 256 characters long? That's a windows limitation.

Re: Album Art Downloader XUI

Reply #3116
I'm not seeing any crash when I pass parameters of more than 34 characters. What is the error message you get? Is an ".\user-components\AlbumArtDownloaderXUI\errorlog.txt" file created? Or an "%temp%\AAD_Errorlog.txt" file?

Is it possible that the full path including artist and album name ends up being more than 256 characters long? That's a windows limitation.

No, there is no errorlog.txt created, but thanks for the hint,
it seems, my build path exceeds the 256 limit of windows, althouth, I think, AAD should not crash in that case, but either give a warning or just do anything intelligent ;-D
With a sortened path it seems to work nicely!
So thank you again for that hint!







Re: Album Art Downloader XUI

Reply #3117
I'd like to ask, if it would be possible to add some functionality to remove illegal chars automaticly before saving an image.
Sometimes, AAD can not save images, because windows can't handle special chars:

X
X
X

It would be nice if AAD would handle such chars and not the user has to create rules/scripts for each char which would be illegale.


Re: Album Art Downloader XUI

Reply #3118
AAD already replaces invalid characters in placeholders (like %artist% and %album%). If you expand the Options area, there's a box to say which character to replace them by ("-" by default).

Perhaps there is an invalid character in part of the path you are specifying directly? Try leaving placeholders in the path instead of having them resolved before they are sent to AAD.

Re: Album Art Downloader XUI

Reply #3119
AAD already replaces invalid characters in placeholders (like %artist% and %album%). If you expand the Options area, there's a box to say which character to replace them by ("-" by default).

That is on the default here too ("-"), so it must be this, I guess:
Perhaps there is an invalid character in part of the path you are specifying directly? Try leaving placeholders in the path instead of having them resolved before they are sent to AAD.

Unfortunately, I'm unable to understand how to do this ;-)

This is my code and
Code: [Select]
".\user-components\AlbumArtDownloaderXUI\AlbumArt.exe" 
$puts(AR,$cut($replace(%ARTIST%,' - ',+, ,+,'_',+,'&',+,'(',+,')',+,'[',+,']',+,':',+,';',+,',',+,'.',+),70))

$puts(AL,$cut($replace(%ALBUM%,' - ',+, ,+,'_',+,'&',+,'(',+,')',+,'[',+,']',+,':',+,';',+,',',+,'.',+),70))

 /ar "$replace($get(AR),++, ,+, )"

 /al "$replace($get(AL),++, ,+, )"

 /p "$replace(%_path%,%_filename_ext%,)%%type%%%%source%%%%size%%.%%extension%%"

I understand, I have to remove all my replacements and put %%album%% and %%artist%% to /al and /ar ?

If so, how would I replace all the [ ; : ... which some sites have problems with? (At least, they had before some years when I initially did the repleacements because the unrepleaced searches broke those search engines)

Atm, I can't see how to benefit from the replacement for illegal chars by AAD and get mine as well.

It is not possible I guess? I have to do all the replaces by myself, or let AAD do it?

Thank you, your help is very much appreciated!

Re: Album Art Downloader XUI

Reply #3120
You should not do any substitution in the /ar and /al parameters, but the /p one should have no invalid characters in it. Looking at your code, though, I can't see where they would be coming from, unless they are already in %path%, because you do not have album or artist in there.

Re: Album Art Downloader XUI

Reply #3121
Anyone noticing Qobuz cover art, especially newer releases, is only showing up as 600x600? I've been noticing it more and more.

Re: Album Art Downloader XUI

Reply #3122
Please add the following script for following host for finding more obscure albums ASAP

Allmusic
Bandcamp
Junodownload
Metal-Archives

Re: Album Art Downloader XUI

Reply #3123
When grouped by Local it would be great if Local was always shown first/at top because this is when I'm trying to improve crappy artwork with better so I'd like to know what I'm comparing against.

Thanks! Love this thing it has helped me SO much!

Re: Album Art Downloader XUI

Reply #3124
It looks like Discogs has killed public access again (getting 403 forbidden for the discogs script), so I've written a Discogs API alternative script: discogsAPI.boo. This will require an API key, referred to by Discogs as a Personal Access Token, which you can easily generate from https://www.discogs.com/settings/developers if you have a discogs account. Once you have one, edit the script in notepad or similar and replace YOUR_PERSONAL_ACCESS_TOKEN_HERE with the token generated, and it should work.

It only fetches what Discogs terms as being "full size" images of about 600x600; if anyone figures out how to get a proper full size original image out of Discogs do let me know, but I wasn't able to.