mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
8c9eeb028f
commit
2188514cdb
@ -125,8 +125,7 @@ class MOBIFile(object):
|
|||||||
text = self.raw_text
|
text = self.raw_text
|
||||||
self.files = []
|
self.files = []
|
||||||
for skel in self.skel_index.records:
|
for skel in self.skel_index.records:
|
||||||
sects = [x for x in self.sect_index.records if x.file_number
|
sects = [x for x in self.sect_index.records if x.file_number == skel.file_number]
|
||||||
== skel.file_number]
|
|
||||||
skeleton = text[skel.start_position:skel.start_position+skel.length]
|
skeleton = text[skel.start_position:skel.start_position+skel.length]
|
||||||
ftext = skeleton
|
ftext = skeleton
|
||||||
first_aid = sects[0].toc_text
|
first_aid = sects[0].toc_text
|
||||||
@ -199,7 +198,10 @@ class MOBIFile(object):
|
|||||||
prefix, ext = 'hd-images', q
|
prefix, ext = 'hd-images', q
|
||||||
resource_index = len(container.resources)
|
resource_index = len(container.resources)
|
||||||
elif sig == b'\xa0\xa0\xa0\xa0' and len(payload) == 4:
|
elif sig == b'\xa0\xa0\xa0\xa0' and len(payload) == 4:
|
||||||
container.resources.append(None)
|
if container is None:
|
||||||
|
print ('Found an end of container record with no container, ignoring')
|
||||||
|
else:
|
||||||
|
container.resources.append(None)
|
||||||
continue
|
continue
|
||||||
elif sig not in known_types:
|
elif sig not in known_types:
|
||||||
if container is not None and len(container.resources) == container.num_of_resource_records:
|
if container is not None and len(container.resources) == container.num_of_resource_records:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user