Skip to main content

Topic: CoverDownloader (Read 283301 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • david_dl
  • [*][*][*][*][*]
CoverDownloader
New Version (Experimental):
Here's a new version I've been working on. For this you'll require .NET framework 2.0 installed.

Please report any bugs/glitches.

Latest version (Supports iTMS)
Download: [ Specified attachment is not available ]
Source (GPL): [ Specified attachment is not available ]

If you create anything useful with the source, it would be a good idea to upload it here for everyone to benefit. Note that I probably won't be updating this project again, except maybe to add scripts.
The license requires that you include full sourcecode with any modified version distributed.
It's messy code, and the first and only time I've used C#, so I hope it's of use to someone.

Included site scripts:
  • Walmart.com
  • Buy.com
  • Amazon.com
  • RateYourMusic.com
  • iTunes Music Store
Screenshot:


---------Old Version-----------

This version uses Python scripts to specify sources for cover art. Look in the CoverSources\Scripts folder for more details. Walmart.py is a good template if you wish to write your own (Amazon.py is a mess)

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.

You shouldn't require any VC8 runtimes; it's linked statically.

Extract the entire archive into one folder, there is no need to unzip or do anything with Python24.zip, this is the library for the built-in interpreter and can be read from the zip file.

Note: The scripts in this download file are NOT up to date. Use the scripts attached to this post. Put them in coversources\scripts
Download links:
Download here
Download source here

Updated Scripts for Rate Your Music and Amazon are attached (these are recommended over the ones included in the download archive, for example the Amazon script no longer returns results that don't have valid thumbnails)

Commandline for foo_run:
Code: [Select]
"C:\Program Files\foobar2000\coverart\coverart.exe" "%artist%" "%album%" "$replace(%_path%,%_filename_ext%,)folder.jpg"

Screenshot:

[/s]
  • Last Edit: 22 September, 2006, 08:02:25 PM by david_dl

  • david_dl
  • [*][*][*][*][*]
CoverDownloader
Reply #1
And it won't work on Windows 98/95/ME 'cos it's unicode.

  • The Link
  • [*][*][*][*][*]
CoverDownloader
Reply #2
The Amazon.dll doesn't seem to work. I only get Walmart results. Disabling Walmart.dll gives no results at all.

  • SpaceChief
  • [*]
CoverDownloader
Reply #3
Thanks! Works great so far!

  • drbeachboy
  • [*][*][*][*][*]
CoverDownloader
Reply #4
With Amazon, I get a window panel that says "Done", but blank inside. Walmart works like a champ!

On the Walmart side, is this better or the same as the gui "albumart.exe" that you wrote back in January?



Regards,
Dirk
Surf's Up!
"Columnated Ruins Domino"

  • david_dl
  • [*][*][*][*][*]
CoverDownloader
Reply #5
Hmm, it would seem that the Amazon site's behaviour varies wildly depending on cookies you have set and possibly geographical location. What happens if you visit http://www.amazon.com/exec/obidos/search-h...ece%20of%20mind
using Internet Explorer (not firefox). Do you get results? And does coverdownloader work after that?

Quote
On the Walmart side, is this better or the same as the gui "albumart.exe" that you wrote back in January?


If you mean the .NET one, its almost the same except written in C++ so you don't require the .NET framework. You should get identical results.

  • The Link
  • [*][*][*][*][*]
CoverDownloader
Reply #6
Your link gives results here using IE but coverart still doesn't give me any amazon results after that (only Walmart works).

  • david_dl
  • [*][*][*][*][*]
CoverDownloader
Reply #7
Could you send me the HTML source of that results page?
Thanks for your help.

  • tool++
  • [*][*][*][*][*]
CoverDownloader
Reply #8
Ah, been waiting for something like this.

However, Amazon doesnt work, and the wallmart searching is rubbish.
hi

  • The Link
  • [*][*][*][*][*]
CoverDownloader
Reply #9
Could you send me the HTML source of that results page?
Thanks for your help.

See PM.

  • david_dl
  • [*][*][*][*][*]
CoverDownloader
Reply #10
Thanks for that. I've had a look at the page Amazon.com served you, and I'm unable to get it to serve me one that looks anything like that. As these pages tend to change quite frequently anyway, I think it would be best to implement some sort of scripting instead of using compiled DLLs. What scripting languages would you like me to try to support? Anything that supports regular expressions should work well for parsing the pages, and as long as the integration into a C/C++ application isn't too difficult I'm willing to support it. I can provide the HTTP and  file IO services needed if the scripting language doesn't support them.

ATM I'm thinking python and/or lua, however I don't actually know how to write script in either of these languages

  • fluffy
  • [*][*]
CoverDownloader
Reply #11
How am I supposed to install this?  I copied everything that was in the rar into my components directroy, and I don't get any errors when foobar starts up.  But, what do I do now?  There is no mention of this component in my preferences now, when I right-click on the albumart panel there is no option to download art...
Is over the of = % over 100

  • david_dl
  • [*][*][*][*][*]
CoverDownloader
Reply #12
It's not a foobar component... yet. Run coverart.exe from the commandline.

the wallmart searching is rubbish.


I know what you mean. If you know of any better sites, please post them here.

  • Skates
  • [*][*][*]
CoverDownloader
Reply #13
Another source of info:

http://www.allmusic.com/

  • fluffy
  • [*][*]
CoverDownloader
Reply #14
Not sure if this could be added, but hi-res and easy (for a human) to use: http://www.thejosher.net/iTunes/search.php
Is over the of = % over 100

  • francesco
  • [*][*][*][*]
CoverDownloader
Reply #15
does it work with foobar 0.8.3
because to me it does not work

  • kalmark
  • [*][*][*][*][*]
CoverDownloader
Reply #16
does it work with foobar 0.8.3
because to me it does not work

It's not a foobar component... yet. Run coverart.exe from the commandline.
Life is Real...
(But not in audio :) )

CoverDownloader
Reply #17
Thanks for that. I've had a look at the page Amazon.com served you, and I'm unable to get it to serve me one that looks anything like that. As these pages tend to change quite frequently anyway, I think it would be best to implement some sort of scripting instead of using compiled DLLs. What scripting languages would you like me to try to support? Anything that supports regular expressions should work well for parsing the pages, and as long as the integration into a C/C++ application isn't too difficult I'm willing to support it. I can provide the HTTP and  file IO services needed if the scripting language doesn't support them.


Okay, wait.  Are you trying to screen-scrape Amazon pages?  Why?!  They have an API specifically for querying their database, and it is very easy to download cover art with it.

http://www.amazon.com/gp/aws/landing.html

There are a number of examples out on the web.  You can write a reasonably okay version in an hour or so, including the time it takes to register with Amazon.

  • hexonn
  • [*]
CoverDownloader
Reply #18
It's not a foobar component... yet. Run coverart.exe from the commandline.


the wallmart searching is rubbish.


I know what you mean. If you know of any better sites, please post them here.
coconuts.com has 500x500 covers
hate of radio : http://last.fm/user/xran

  • karit
  • [*]
CoverDownloader
Reply #19
Not sure if this could be added, but hi-res and easy (for a human) to use: http://www.thejosher.net/iTunes/search.php

http://www.hydrogenaudio.org/forums/index....showtopic=40067
HAs commandline. And also a gui but haven't used the gui

  • mazy
  • [*][*][*][*][*]
CoverDownloader
Reply #20
david_dl, please, would you consider using lua language for scripting? it has good support for regular expressions - and foosion did quite some work on his foo_lua component to implement unicode support to them.

on a sidenote, it would be great if you could port his old foo_lua sources to foobar 0.9. i really miss it, it could be used for so many useful things (and maybe one could even implement some sort of service so other plugins could use that lua core too).
info about my tag guesser script for foo_lua (preview version available):
http://www.hydrogenaudio.org/index.php?showtopic=16987

  • david_dl
  • [*][*][*][*][*]
CoverDownloader
Reply #21
Thanks for all the suggestions of cover sources.
I'm just posting to let you know I haven't abandoned this, just been busy with other stuff. I had some time today so I started playing with scripting. I thought python looked quite good, so I've created a coversource DLL that uses a python script to retrieve covers. It needs a bit of work before I can release it, but that will happen sometime soon.
I don't actually know python, but after a bit of playing around I found it to be quite a fun language, and very intuitive to use. Just to show you how easy it is, this script, when run by the python coversource provides all the functionality of Walmart.dll in a few lines:
Code: [Select]
import urllib
import re

# GetThumbs(): 'artist' & 'album' are unicode strings
# must return a list of elements in this format:
# (all returned strings can be standard or unicode)
# [string: name,string: url to thumbnail OR buffer containing image data (prefixed with 'data://'): thumbnail data,anything: callback data]
# The callback data will be passed to DownloadArt if/when it is called

def GetThumbs(artist,album):
out=[]
params = urllib.urlencode({'search_query': artist + "+" + album})
f = urllib.urlopen("http://www.walmart.com/catalog/search-ng.gsp?Continue.x=0&Continue.y=0&Continue=Find&ics=20&ico=0&search_constraint=4104&" + params)
rfirst = re.compile("<a\\shref=\"/catalog/product\\.do\\?product_id=[0-9]+\"><img\\ssrc=\"([^\"]+)60X60.gif\"[^>]+alt=\"([^\"]*)\"[^>]*>",re.MULTILINE)
text = buffer(f.read())
iterator = rfirst.finditer(text)
for match in iterator:
out.append([match.group(2),u"150x150",match.group(1)+"150X150.jpg",match.group(1)])
return out

# alternate 'for' loop contents:
# f = urllib.urlopen(match.group(1)+"150X150.jpg")
# out.append([match.group(2),u"150x150","data://"+f.read(),match.group(1)])

# GetCover(): 'userdata' is the last item in the array representing
# the desired thumbnail in the list you returned in GetThumbs()
# must return either the URL of the full-size art
# or, the actual image data (prefixed with 'data://') as before

def GetCover(param):
return param + "500X500.jpg"

[!--sizeo:1--][span style=\"font-size:8pt;line-height:100%\"][!--/sizeo--]moderation: Converted code to codebox to preserve forum layout.[/size]
  • Last Edit: 23 April, 2006, 05:00:05 PM by foosion

  • DoXer
  • [*]
CoverDownloader
Reply #22
How can i send the parameters for %artist% and %title% from foobar to the downloader. Ist there a plugin required?

  • Skates
  • [*][*][*]
CoverDownloader
Reply #23
Cannot wait until this is turned into an actual plug-in or merged with the other album art plugin!!!

  • david_dl
  • [*][*][*][*][*]
CoverDownloader
Reply #24
Well, the python scripting kinda works. But I no longer can work on this, and its become kind of a mess.
Here's a binary and the source code, use parts of it in your own project if you want.

To use, run coverart.exe from the commandline. The zip file python24.zip contains python libraries, there is no need to unzip it, as it can be read from as is.

If you want to write your own script, see coversources\scripts\walmart.py for details. The amazon script is a mess.