ignore osx resource forks

This commit is contained in:
j 2014-11-15 01:05:33 +00:00
parent d722ae004b
commit 121a2c9ac3

View file

@ -85,11 +85,13 @@ def info(epub):
return data return data
def extract_text(path): def extract_text(path):
data = b'' data = ''
z = zipfile.ZipFile(path) z = zipfile.ZipFile(path)
for f in z.filelist: for f in z.filelist:
if '/._' in f.filename or f.filename.startswith('._'):
continue
if f.filename.endswith('html'): if f.filename.endswith('html'):
data += z.read(f.filename) data += z.read(f.filename).decode()
return data return data
def extract_isbn(data): def extract_isbn(data):