IPB

Welcome Guest ( Log In | Register )

12 Pages V   1 2 3 > »   
Reply to this topicStart new topic
CoverDownloader, Walmart+Amazon so far
david_dl
post 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: Attached File  coverdownloader_4_0b.zip ( 454.41K ) Number of downloads: 75146

Source (GPL): Attached File  0_4_source.zip ( 124.37K ) Number of downloads: 4357


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
"C:\Program Files\foobar2000\coverart\coverart.exe" "%artist%" "%album%" "$replace(%_path%,%_filename_ext%,)folder.jpg"


Screenshot:

[/s]

This post has been edited by david_dl: Sep 23 2006, 01:02
Attached File(s)
Attached File  coverdownloader2_0.1b.zip ( 369.66K ) Number of downloads: 2113
Attached File  coverdownloader2_1.0c.zip ( 370.13K ) Number of downloads: 2363
Attached File  coverdownloader2_0.2.zip ( 375.44K ) Number of downloads: 1953
Attached File  coverdownloader_0_3.zip ( 350.45K ) Number of downloads: 7527
 
Go to the top of the page
+Quote Post
david_dl
post 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.
Go to the top of the page
+Quote Post
The Link
post Apr 8 2006, 12:16
Post #3





Group: Members
Posts: 665
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.
Go to the top of the page
+Quote Post
SpaceChief
post Apr 8 2006, 18:03
Post #4





Group: Members
Posts: 11
Joined: 19-January 06
Member No.: 27208



Thanks! Works great so far!
Go to the top of the page
+Quote Post
drbeachboy
post Apr 8 2006, 20:24
Post #5





Group: Members
Posts: 500
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"
Go to the top of the page
+Quote Post
david_dl
post 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.
Go to the top of the page
+Quote Post
The Link
post Apr 8 2006, 22:06
Post #7





Group: Members
Posts: 665
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).
Go to the top of the page
+Quote Post
david_dl
post 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.
Go to the top of the page
+Quote Post
tool++
post 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
Go to the top of the page
+Quote Post
The Link
post Apr 8 2006, 23:11
Post #10





Group: Members
Posts: 665
Joined: 27-November 02
Member No.: 3911



QUOTE (david_dl @ Apr 9 2006, 12:01 AM) *
Could you send me the HTML source of that results page?
Thanks for your help.

See PM.
Go to the top of the page
+Quote Post
david_dl
post 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 biggrin.gif
Go to the top of the page
+Quote Post
fluffy
post 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
Go to the top of the page
+Quote Post
david_dl
post Apr 9 2006, 00:47
Post #13





Group: Members
Posts: 604
Joined: 17-December 05
From: New Zealand
Member No.: 26461



It's not a foobar component... yet. Run coverart.exe from the commandline.

QUOTE (tool++ @ Apr 9 2006, 11:11 AM) *
the wallmart searching is rubbish.


I know what you mean. If you know of any better sites, please post them here.
Go to the top of the page
+Quote Post
Skates
post Apr 9 2006, 15:48
Post #14





Group: Members
Posts: 177
Joined: 13-December 02
From: USA
Member No.: 4068



Another source of info:

http://www.allmusic.com/
Go to the top of the page
+Quote Post
fluffy
post 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
Go to the top of the page
+Quote Post
francesco
post Apr 13 2006, 10:57
Post #16





Group: Members
Posts: 373
Joined: 28-January 06
Member No.: 27378



does it work with foobar 0.8.3
because to me it does not work mad.gif
Go to the top of the page
+Quote Post
kalmark
post Apr 13 2006, 11:29
Post #17





Group: Members
Posts: 599
Joined: 9-October 03
From: ZZ 9 Plural Z Alpha
Member No.: 9230



QUOTE (francesco @ Apr 13 2006, 10:57 AM) *
does it work with foobar 0.8.3
because to me it does not work mad.gif

QUOTE (david_dl @ Apr 9 2006, 12:47 AM) *
It's not a foobar component... yet. Run coverart.exe from the commandline.


--------------------
Life is Real...
(But not in audio :) )
Go to the top of the page
+Quote Post
reprehensible
post Apr 16 2006, 20:09
Post #18





Group: Members
Posts: 1
Joined: 16-April 06
Member No.: 29638



QUOTE (david_dl @ Apr 8 2006, 04:47 PM) *
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.
Go to the top of the page
+Quote Post
hexonn
post Apr 16 2006, 20:31
Post #19





Group: Members
Posts: 31
Joined: 14-December 05
From: LA, CA
Member No.: 26412



QUOTE (david_dl @ Apr 8 2006, 04:47 PM) *
It's not a foobar component... yet. Run coverart.exe from the commandline.

QUOTE (tool++ @ Apr 9 2006, 11:11 AM) *

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
Go to the top of the page
+Quote Post
karit
post Apr 16 2006, 21:32
Post #20





Group: Members
Posts: 36
Joined: 25-January 06
Member No.: 27332



QUOTE (fluffy @ Apr 12 2006, 06:53 AM) *
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
Go to the top of the page
+Quote Post
mazy
post 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
Go to the top of the page
+Quote Post
david_dl
post 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
Go to the top of the page
+Quote Post
DoXer
post 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?
Go to the top of the page
+Quote Post
Skates
post 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!!!
Go to the top of the page
+Quote Post
david_dl
post 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.
Go to the top of the page
+Quote Post

12 Pages V   1 2 3 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 31st July 2014 - 09:46