epubs can be invalid

This commit is contained in:
j 2016-02-07 20:00:04 +05:30
parent 836ff68f4c
commit 4549a4be4e

View file

@ -42,7 +42,10 @@ def cover(path):
def use(filename): def use(filename):
logger.debug('using %s', filename) logger.debug('using %s', filename)
data = z.read(filename) try:
data = z.read(filename)
except:
return None
r = get_ratio(data) r = get_ratio(data)
if r < 0.3 or r > 2: if r < 0.3 or r > 2:
return None return None