mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix reading metadata from HTML files.
This commit is contained in:
parent
6e8f39d669
commit
1bc13335a2
@ -45,7 +45,7 @@ def get_metadata(stream):
|
|||||||
if match:
|
if match:
|
||||||
author = match.group(1).replace(',', ';')
|
author = match.group(1).replace(',', ';')
|
||||||
|
|
||||||
mi = MetaInformation(title, [author])
|
mi = MetaInformation(title, [author] if author else None)
|
||||||
|
|
||||||
# Publisher
|
# Publisher
|
||||||
pat = re.compile(r'<!--.*?PUBLISHER=[\'"]([^"\']+)[\'"].*?-->', re.DOTALL)
|
pat = re.compile(r'<!--.*?PUBLISHER=[\'"]([^"\']+)[\'"].*?-->', re.DOTALL)
|
||||||
@ -60,8 +60,6 @@ def get_metadata(stream):
|
|||||||
isbn = match.group(1)
|
isbn = match.group(1)
|
||||||
mi.isbn = re.sub(r'[^0-9xX]', '', isbn)
|
mi.isbn = re.sub(r'[^0-9xX]', '', isbn)
|
||||||
|
|
||||||
print mi
|
|
||||||
|
|
||||||
return mi
|
return mi
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user