- Search engine now supports category-based requests (only Mininova engine for now but the rest is coming soon)

- Updated "buy it" icon
This commit is contained in:
Christophe Dumez 2009-08-25 02:31:36 +00:00
parent b8d8862562
commit 4a1c8a7279
19 changed files with 628 additions and 532 deletions

View file

@ -64,15 +64,15 @@ def retrieve_url(url):
return dat.encode('utf-8', 'replace')
def download_file(url):
""" Download file at url and write it to a file, return the path to the file and the url """
file, path = tempfile.mkstemp()
file = os.fdopen(file, "wb")
# Download url
req = urllib2.Request(url)
response = urllib2.urlopen(req)
dat = response.read()
# Write it to a file
file.write(dat)
file.close()
# return file path
return path+" "+url
""" Download file at url and write it to a file, return the path to the file and the url """
file, path = tempfile.mkstemp()
file = os.fdopen(file, "wb")
# Download url
req = urllib2.Request(url)
response = urllib2.urlopen(req)
dat = response.read()
# Write it to a file
file.write(dat)
file.close()
# return file path
return path+" "+url