ignore default poster

This commit is contained in:
j 2014-05-25 23:27:03 +02:00
parent 013598af22
commit 4521f5b14b

View file

@ -5,6 +5,7 @@ from __future__ import division
from ox.cache import read_url from ox.cache import read_url
import lxml.html import lxml.html
import re import re
import hashlib
from utils import normalize_isbn from utils import normalize_isbn
import stdnum.isbn import stdnum.isbn
@ -67,6 +68,9 @@ def lookup(id):
data['cover'] = cover[0].attrib['src'] data['cover'] = cover[0].attrib['src']
if data['cover'].startswith('//'): if data['cover'].startswith('//'):
data['cover'] = 'http:' + data['cover'] data['cover'] = 'http:' + data['cover']
cdata = read_url(data['cover'])
if hashlib.sha1(cdata).hexdigest() == '70f16d3e077cdd47ef6b331001dbb1963677fa04':
del data['cover']
if 'author' in data: if 'author' in data:
data['author'] = [data['author']] data['author'] = [data['author']]