From 4521f5b14b175b450ba94f7d133bf53d6abbaf4a Mon Sep 17 00:00:00 2001 From: j Date: Sun, 25 May 2014 23:27:03 +0200 Subject: [PATCH] ignore default poster --- oml/meta/worldcat.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/oml/meta/worldcat.py b/oml/meta/worldcat.py index 0da4403..141ad82 100644 --- a/oml/meta/worldcat.py +++ b/oml/meta/worldcat.py @@ -5,6 +5,7 @@ from __future__ import division from ox.cache import read_url import lxml.html import re +import hashlib from utils import normalize_isbn import stdnum.isbn @@ -67,6 +68,9 @@ def lookup(id): data['cover'] = cover[0].attrib['src'] if data['cover'].startswith('//'): data['cover'] = 'http:' + data['cover'] + cdata = read_url(data['cover']) + if hashlib.sha1(cdata).hexdigest() == '70f16d3e077cdd47ef6b331001dbb1963677fa04': + del data['cover'] if 'author' in data: data['author'] = [data['author']]