dont download available books, parse worldcat covers

This commit is contained in:
j 2014-05-24 23:21:03 +02:00
commit d96d4300c2
2 changed files with 7 additions and 3 deletions

View file

@ -62,6 +62,12 @@ def lookup(id):
data['isbn'] = []
if isbn not in data['isbn']:
data['isbn'].append(isbn)
cover = doc.xpath('//img[@class="cover"]')
if cover:
data['cover'] = cover[0].attrib['src']
if data['cover'].startswith('//'):
data['cover'] = 'http:' + data['cover']
if 'author' in data:
data['author'] = [data['author']]
if 'title' in data: