mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-10-31 10:37:00 -04:00 
			
		
		
		
	Fix #5441 (PDB created in Dropbook not convertable by Calibre)
This commit is contained in:
		
						commit
						8c80d91ae9
					
				| @ -8,6 +8,7 @@ __license__   = 'GPL v3' | ||||
| __copyright__ = '2009, John Schember <john@nachtimwald.com>' | ||||
| __docformat__ = 'restructuredtext en' | ||||
| 
 | ||||
| import re | ||||
| import struct | ||||
| 
 | ||||
| from calibre.ebooks.metadata import MetaInformation | ||||
| @ -46,10 +47,10 @@ def get_metadata(stream, extract_cover=True): | ||||
|                 mdata = pheader.section_data(hr.metadata_offset) | ||||
|      | ||||
|                 mdata = mdata.split('\x00') | ||||
|                 mi.title = mdata[0] | ||||
|                 mi.authors = [mdata[1]] | ||||
|                 mi.publisher = mdata[3] | ||||
|                 mi.isbn = mdata[4] | ||||
|                 mi.title = re.sub(r'[^a-zA-Z0-9 \._=\+\-!\?,\'\"]', '', mdata[0]) | ||||
|                 mi.authors = [re.sub(r'[^a-zA-Z0-9 \._=\+\-!\?,\'\"]', '', mdata[1])] | ||||
|                 mi.publisher = re.sub(r'[^a-zA-Z0-9 \._=\+\-!\?,\'\"]', '', mdata[3]) | ||||
|                 mi.isbn = re.sub(r'[^a-zA-Z0-9 \._=\+\-!\?,\'\"]', '', mdata[4]) | ||||
|             except: | ||||
|                 pass | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user