mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix bug #3567: Limit text length used for TXT metadata.
This commit is contained in:
parent
0956c683f0
commit
72fd1a1d59
@ -22,6 +22,8 @@ def get_metadata(stream, extract_cover=True):
|
||||
else:
|
||||
mdata += line
|
||||
|
||||
mdata = mdata[:100]
|
||||
|
||||
mo = re.search('(?u)^[ ]*(?P<title>.+)[ ]*(\n{3}|(\r\n){3}|\r{3})[ ]*(?P<author>.+)[ ]*(\n|\r\n|\r)$', mdata)
|
||||
if mo != None:
|
||||
mi.title = mo.group('title')
|
||||
|
Loading…
x
Reference in New Issue
Block a user