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: CoverDownloader (Read 331777 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

CoverDownloader

Reply #25
How can i send the parameters for %artist% and %title% from foobar to the downloader. Ist there a plugin required?

once we get foo_openwith ported to 0.9, this will be very simple



i'd also like to suggest http://www.rateyourmusic.com/ for finding album art, it's far and away the most comprehensive collection of album art i've found, i find everything except super, super rare stuff on there.  fantastic resource.

CoverDownloader

Reply #26
i'd also like to suggest http://www.rateyourmusic.com/ for finding album art, it's far and away the most comprehensive collection of album art i've found, i find everything except super, super rare stuff on there.  fantastic resource.


Here's a script for that. Save as "Rate Your Music.py" in coversources\scripts:
Code: [Select]
import urllib
import re

def GetThumbs(artist,album):
    try:
        out = []
        query = album
        params = urllib.urlencode({'searchterm': query.encode('utf8')}) + "&type=l"
        f = urllib.urlopen("http://rateyourmusic.com/search?" + params)
        r = re.compile("<img[^>]*?alt=\"([^\"]*)\"[^>]*?src=\"/album_images[0-9]*/s([0-9]+).jpg\">",re.MULTILINE)
        text = f.read()
        iterator = r.finditer(text)
        for match in iterator:
            out.append([match.group(1),u"Unknown","http://rateyourmusic.com/album_images/s"+match.group(2)+".jpg",match.group(2)])
        return out
    except:
        return []

def GetCover(param):
    return "http://rateyourmusic.com/album_images/o"+param+".jpg"

CoverDownloader

Reply #27
Is there some readme.txt file for noobs like me too know where to place the extracted folders and how to use the program?

Edit - Ok got its only a Command line app

CoverDownloader

Reply #28
Sorry for the belated reply. Now that foo_run has been ported, the easiest way to use it is with the code I have added to the first post. Then rightclick the track for which you need art, select Run->Get Art (or whatever you called it in foo_run).

Rate Your Music is indeed an excellent source of coverart, I recommend adding the python script for it I posted above.

Edit: Everything is now on the first post, including updated scripts

CoverDownloader

Reply #29
thanks for your fantastic work 

edit: I'm having some problems downloading certain coverart.
For example I tried downloading the cover for "Macka B - Sign Of The Times" which yields one correct result on amazon. When clicking the picture to save it everything seems fine, but the picture is a 1x1 pixel white gif (as far as Irfanview goes)

This occurs using the latest version of your amazon script and the following command prompt using foo_run:
"C:\Programme\foobar2000\coverart\coverart.exe" "%artist%" "%album%" "$replace(%_path%,%_filename_ext%,)%artist% - %album% - Front.jpg"
I've also downloaded other cover images which work fine, as far as I can tell this only happens with amazon

CoverDownloader

Reply #30
Indeed!
Thank you very much!

A little question: What is done, if the specified file (i.e. folder.jpg) already exists? Is it overwritten?
A little request: What about letting the uppopping window with covers hide the command-box and put out the errors and such not to the command-box, but rather to this window in some way? But this is only eyecandy...

I saw a few times, that a coverpreview was empty, with a black border and a few horizontal lines. If I see this again I'll report you the artist and album!

CoverDownloader

Reply #31
A million thank yous for this program, and for providing RateYourMusic support.  It all makes me very very happy. 

One question: with free registration at RateYourMusic, you sometimes have access to higher-resolution images.  Is it at all possible to integrate logging in to the script to get these bigger images?

edit: another request, can you make the program close automatically when the art is saved?

CoverDownloader

Reply #32
edit: I'm having some problems downloading certain coverart.
For example I tried downloading the cover for "Macka B - Sign Of The Times" which yields one correct result on amazon. When clicking the picture to save it everything seems fine, but the picture is a 1x1 pixel white gif (as far as Irfanview goes)

This occurs using the latest version of your amazon script and the following command prompt using foo_run:
"C:\Programme\foobar2000\coverart\coverart.exe" "%artist%" "%album%" "$replace(%_path%,%_filename_ext%,)%artist% - %album% - Front.jpg"
I've also downloaded other cover images which work fine, as far as I can tell this only happens with amazon


Does that result show an image in the thumbnail? Are you using the latest version of the Amazon script (It's at the very bottom of the first post.) If the problem persists i'll have another fiddle with the script when I get home tonight (It uses the Web Services API and the URLs it gives me are, for some reason, not very reliable


Indeed!
Thank you very much!

A little question: What is done, if the specified file (i.e. folder.jpg) already exists? Is it overwritten?
A little request: What about letting the uppopping window with covers hide the command-box and put out the errors and such not to the command-box, but rather to this window in some way? But this is only eyecandy...

Hmm yes, that would be better. If i have time, I'll work on it tonight.

I saw a few times, that a coverpreview was empty, with a black border and a few horizontal lines. If I see this again I'll report you the artist and album!

Thanks, that would be very helpful.

A million thank yous for this program, and for providing RateYourMusic support.  It all makes me very very happy. 

One question: with free registration at RateYourMusic, you sometimes have access to higher-resolution images.  Is it at all possible to integrate logging in to the script to get these bigger images?

Hi, when I wrote the script I signed up for an account, and noticed that while it was necessary to login to get the link to the larger images, once you had the URL anyone could access it. I also found that the URL was very predictable, and therefore logging in wasn't necessary at all.
However out of fairness to the Rate Your Music site, please only use the script if you are a regular user who participates on the site 

edit: another request, can you make the program close automatically when the art is saved?


Sure, would it be good to have this as a commandline argument? Ie. coverart.exe --auto-close "artist"


CoverDownloader

Reply #34
when you guys say run coverart.exe from the commandline what do you mean?

I extracted it into a folder but how do i run the .exe from the "commandline"?

CoverDownloader

Reply #35
when you guys say run coverart.exe from the commandline what do you mean?

I extracted it into a folder but how do i run the .exe from the "commandline"?


start /run / write 'cmd' then enter something like "C:\Program Files\fb2k\coverart\coverart.exe" "your artist" "your album" "path where to save the cover art"

but there's a simpler way... using foo_run
add a new entry with this command line
Code: [Select]
"C:\Program Files\fb2k\coverart\coverart.exe" "%artist%" "%album%" "E:\%artist%.%album%.folder.jpg"

(modify the paths with those on your system)

CoverDownloader

Reply #36
"alert, error writing file"

thats the error message i get when i click on the cover image to save it to the folder designated

CoverDownloader

Reply #37
"alert, error writing file"

thats the error message i get when i click on the cover image to save it to the folder designated

make sure there are no characters in the intended filename that can't actually be in a filename (for example, forward slashes or question marks in an album title)


CoverDownloader

Reply #39
I should have mentioned that it is possible to right click on a thumbnail to use "Save As..." if you wish to save it elsewhere.

Also, if anyone has suggestions for sites with covers that I haven't written scripts for yet, please suggest them here.
Note while it is possible to access the art on allmusic.com, they strictly forbid this, and shut down another software programme that did this. And they only have 200x200 covers.

CoverDownloader

Reply #40
I just had the problem mit blank albumart again. The horizontal lines come out of a "repainting"-problem.
One more thing: Let the program remember it's windowsize!


Quote
"alert, error writing file"

I get this, if I don't wait long enough (all albumart is loaded) and click on one too quickly... This could be optimized?!
Perhaps a small progressbar, where you see, how far the program has gotten?

CoverDownloader

Reply #41
Hmmm, the GUI definately needs some work. The trouble is, python is way more fun than C++ 
Well I'm not really in a state to work on it now, and it's queen's birthday weekend. I might have some time sunday morning, i'll see how it goes.

CoverDownloader

Reply #42
Thank you for looking into it!

CoverDownloader

Reply #43
Hi david,

"Excrementory Grindfuckers" - "Fertig machen, Szeneputzen", there is a cover found on rate your music. However it doesn't stop [searching]. Thus I can't save it...
(I have all of the three scripts in my folder..)

CoverDownloader

Reply #44
Does that result show an image in the thumbnail? Are you using the latest version of the Amazon script (It's at the very bottom of the first post.) If the problem persists i'll have another fiddle with the script when I get home tonight (It uses the Web Services API and the URLs it gives me are, for some reason, not very reliable


The result does show an image in the thumbnail, yes.
I'm also using the latest version of the amazon script, but it seems like the picture isn't saved correctly.

Thanks for your effort

Tich

CoverDownloader

Reply #45
Hi. Sorry, I haven't worked on the problems with the Amazon script or the coverart GUI yet, but I do have an updated version of walmart (Just noticed an error in the original that means it would miss many covers), and a script for Buy.com, which has awesome 500x500px covers.

Both are attached to the first post. This means that none of the scripts in the original download archive are now up to date.

Buy.com script:

Code: [Select]
import urllib
import re

def GetThumbs(artist,album):
        out = []
        query = artist+" "+album
        params = urllib.urlencode({'qu': query.encode('utf8')}) + "&search_store=6&querytype=music&loc=109&dclksa=1"
        f = urllib.urlopen("http://www.buy.com/retail/searchresults.asp?" + params)
        r = re.compile("<img[^>]*src=\"http://ak.buy.com/db_assets/ad_images/([0-9]+)/([0-9]+).gif\">.*?<a[^>]*class=\"medBlueText\"><b>([^>]*)</b>",re.MULTILINE)
        r2 = re.compile("java script:largeIM\\(\'http://ak.buy.com/db_assets/large_images/([0-9]+)/([0-9]+).jpg\'\\)[^>]+><img[^>]*src=\"http://ak.buy.com/db_assets/prod_images/\\1/\\2.jpg\"[^>]*alt=\"([^\">]+)\"",re.MULTILINE)
        text = f.read()
        result = re.search(r2,text)
        if result!=None:
            return [[result.group(3),u"500x500","http://ak.buy.com/db_assets/prod_images/"+result.group(1)+"/"+result.group(2)+".jpg",[result.group(1),result.group(2)]]]
        iterator = r.finditer(text)
        for match in iterator:
            out.append([match.group(3),u"500x500","http://ak.buy.com/db_assets/prod_images/"+match.group(1)+"/"+match.group(2)+".jpg",[match.group(1),match.group(2)]])
        return out
def GetCover(param):
    return "http://ak.buy.com/db_assets/large_images/"+param[0]+"/"+param[1]+".jpg"

CoverDownloader

Reply #46
Thank you! Will try this out, when I'm back in my "studying-city"!

edit:
It seems that the coverdownloader has problems saving to the folder.jpg, if there's already one present in the target-directory! I get a messagebox...

CoverDownloader

Reply #47
hmm, came across a failed search...artist "asobi seksu," album "citrus" didn't retrieve the image from rateyourmusic (though the album and art exist on the site)

CoverDownloader

Reply #48
The commandline syntax is quite simple, just coverart.exe <Artist> <Album> <File to save to>
The second two parameters are optional, if a path is not specified it will prompt you with a Save As dialog.


Is it possible to have a syntax :
coverart.exe <SearchName>  <File to save to>

Because sometimes I just want to search for the album because it might be a Various Artists one. And I would like to save the cover with filename syntax I provide.

If this is impossible because the way optional parameters are structured can you have it so if you put #Ignore# in the second parameter it will function like I mentioned above?
coverart.exe <SearchName> #Ignore# <File to save to>

Also the remembering Window size will be great.

Thanks

CoverDownloader

Reply #49
if you want to search for an album only just use this command:
Code: [Select]
coverart.exe "" "%album%" "$replace(%_path%,%_filename_ext%,)front.jpg"


this will search for the album, ignoring the artist tag, and save the result to the same folder your music files are in.

Tich