CoverDownloader, Walmart+Amazon so far |
![]() ![]() |
CoverDownloader, Walmart+Amazon so far |
Apr 8 2006, 06:30
Post
#1
|
|
|
Group: Members Posts: 604 Joined: 17-December 05 From: New Zealand Member No.: 26461 |
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:
coverdownloader_4_0b.zip ( 454.41K )
Number of downloads: 74379Source (GPL):
0_4_source.zip ( 124.37K )
Number of downloads: 4232If 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:
![]() ---------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 "C:\Program Files\foobar2000\coverart\coverart.exe" "%artist%" "%album%" "$replace(%_path%,%_filename_ext%,)folder.jpg" Screenshot: This post has been edited by david_dl: Sep 23 2006, 01:02
Attached File(s)
coverdownloader2_0.1b.zip ( 369.66K )
Number of downloads: 2000
coverdownloader2_1.0c.zip ( 370.13K )
Number of downloads: 2233
coverdownloader2_0.2.zip ( 375.44K )
Number of downloads: 1857
coverdownloader_0_3.zip ( 350.45K )
Number of downloads: 7393 |
|
|
|
Apr 8 2006, 11:14
Post
#2
|
|
|
Group: Members Posts: 604 Joined: 17-December 05 From: New Zealand Member No.: 26461 |
And it won't work on Windows 98/95/ME 'cos it's unicode.
|
|
|
|
Apr 8 2006, 12:16
Post
#3
|
|
![]() Group: Members Posts: 658 Joined: 27-November 02 Member No.: 3911 |
The Amazon.dll doesn't seem to work. I only get Walmart results. Disabling Walmart.dll gives no results at all.
|
|
|
|
Apr 8 2006, 18:03
Post
#4
|
|
|
Group: Members Posts: 11 Joined: 19-January 06 Member No.: 27208 |
Thanks! Works great so far!
|
|
|
|
Apr 8 2006, 20:24
Post
#5
|
|
![]() Group: Members Posts: 496 Joined: 22-October 04 From: Southern NJ Member No.: 17776 |
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" |
|
|
|
Apr 8 2006, 21:51
Post
#6
|
|
|
Group: Members Posts: 604 Joined: 17-December 05 From: New Zealand Member No.: 26461 |
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. |
|
|
|
Apr 8 2006, 22:06
Post
#7
|
|
![]() Group: Members Posts: 658 Joined: 27-November 02 Member No.: 3911 |
Your link gives results here using IE but coverart still doesn't give me any amazon results after that (only Walmart works).
|
|
|
|
Apr 8 2006, 23:01
Post
#8
|
|
|
Group: Members Posts: 604 Joined: 17-December 05 From: New Zealand Member No.: 26461 |
Could you send me the HTML source of that results page?
Thanks for your help. |
|
|
|
Apr 8 2006, 23:11
Post
#9
|
|
![]() Group: Members Posts: 959 Joined: 27-May 05 Member No.: 22329 |
Ah, been waiting for something like this.
However, Amazon doesnt work, and the wallmart searching is rubbish. -------------------- hi
|
|
|
|
Apr 8 2006, 23:11
Post
#10
|
|
![]() Group: Members Posts: 658 Joined: 27-November 02 Member No.: 3911 |
|
|
|
|
Apr 8 2006, 23:47
Post
#11
|
|
|
Group: Members Posts: 604 Joined: 17-December 05 From: New Zealand Member No.: 26461 |
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 |
|
|
|
Apr 9 2006, 00:36
Post
#12
|
|
|
Group: Members Posts: 73 Joined: 3-February 06 Member No.: 27524 |
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
|
|
|
|
Apr 9 2006, 00:47
Post
#13
|
|
|
Group: Members Posts: 604 Joined: 17-December 05 From: New Zealand Member No.: 26461 |
|
|
|
|
Apr 9 2006, 15:48
Post
#14
|
|
|
Group: Members Posts: 177 Joined: 13-December 02 From: USA Member No.: 4068 |
|
|
|
|
Apr 11 2006, 19:53
Post
#15
|
|
|
Group: Members Posts: 73 Joined: 3-February 06 Member No.: 27524 |
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
|
|
|
|
Apr 13 2006, 10:57
Post
#16
|
|
![]() Group: Members Posts: 369 Joined: 28-January 06 Member No.: 27378 |
does it work with foobar 0.8.3
because to me it does not work |
|
|
|
Apr 13 2006, 11:29
Post
#17
|
|
![]() Group: Members Posts: 599 Joined: 9-October 03 From: ZZ 9 Plural Z Alpha Member No.: 9230 |
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 :) ) |
|
|
|
Apr 16 2006, 20:09
Post
#18
|
|
|
Group: Members Posts: 1 Joined: 16-April 06 Member No.: 29638 |
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. |
|
|
|
Apr 16 2006, 20:31
Post
#19
|
|
![]() Group: Members Posts: 31 Joined: 14-December 05 From: LA, CA Member No.: 26412 |
coconuts.com has 500x500 covers
-------------------- hate of radio : http://last.fm/user/xran
|
|
|
|
Apr 16 2006, 21:32
Post
#20
|
|
|
Group: Members Posts: 36 Joined: 25-January 06 Member No.: 27332 |
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 |
|
|
|
Apr 16 2006, 22:09
Post
#21
|
|
![]() Group: Members Posts: 680 Joined: 11-July 03 From: Brno, Czech Rep. Member No.: 7705 |
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 |
|
|
|
Apr 20 2006, 02:52
Post
#22
|
|
|
Group: Members Posts: 604 Joined: 17-December 05 From: New Zealand Member No.: 26461 |
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 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" moderation: Converted code to codebox to preserve forum layout. This post has been edited by foosion: Apr 23 2006, 22:00 |
|
|
|
Apr 23 2006, 20:48
Post
#23
|
|
|
Group: Members Posts: 39 Joined: 25-September 05 Member No.: 24706 |
How can i send the parameters for %artist% and %title% from foobar to the downloader. Ist there a plugin required?
|
|
|
|
Apr 23 2006, 21:38
Post
#24
|
|
|
Group: Members Posts: 177 Joined: 13-December 02 From: USA Member No.: 4068 |
Cannot wait until this is turned into an actual plug-in or merged with the other album art plugin!!!
|
|
|
|
May 14 2006, 00:45
Post
#25
|
|
|
Group: Members Posts: 604 Joined: 17-December 05 From: New Zealand Member No.: 26461 |
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. |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 20th June 2013 - 07:50 |