Hi Kevin,
I have tested the new one.
Both
1. HDimage_test.mobi
and
2. test2.azw3
are successfully unpacked; however, warnings are gotten on python 3:
Warning: There are unprocessed index bytes left: b'0000'
Warning: There are unprocessed index bytes left: b'000000'
Warning: There are unprocessed index bytes left: b'0000'
But, 3. the rtl reflowable ebook in Japanese is still unpacked as an epub2.
I attach the mobi.
And I have tested other files and get errors.
4. test1.azw3 (a fixed layout rtl eBook)
python 2:
Spoiler:
Unpacking Book...
Palm DB type: BOOKMOBI, 224 sections.
Warning: Bad key, size, value combination detected in EXTH 406 16 0000000000000
000
Unpacking a KF8 book...
Processing K8 section of book...
Mobi Version: 8
Codec: utf-8
Title: XXXX
EXTH Title: XXXX
Huffdic compression
Unpacking images, resources, fonts, etc
Extracting image: cover00046.jpeg from section 46
.
.
.
Extracting image: image00213.jpeg from section 213
Warning: RESC section length(14486bytes) does not match its size(14434bytes).
Extracting image: image00215.jpeg from section 215
Warning: Section 218 does not contain a recognised resource
Warning: Section 219 does not contain a recognised resource
Unpacking raw markup language
Processing ncx / toc
Building an epub-like structure
Building proper xhtml for each file
Error: 'ascii' codec can't decode byte 0xe3 in position 0: ordinal not in range(
128)
Traceback (most recent call last):
File "kindleunpack.py", line 996, in main
unpackBook(infile, outdir, apnxfile, epubver, use_hd)
File "kindleunpack.py", line 910, in unpackBook
process_all_mobi_headers(files, apnxfile, sect, mhlst, K8Boundary, False, ep
ubver, use_hd)
File "kindleunpack.py", line 827, in process_all_mobi_headers
processMobi8(mh, metadata, sect, files, imgnames, pagemapproc, k8resc, obfus
cate_data, apnxfile, epubver)
File "kindleunpack.py", line 523, in processMobi8
usedmap = htmlproc.buildXHTML()
File "mobi_html.py", line 343, in bu
ildXHTML
part = b"".join(srcpieces)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 0: ordinal
not in range(128)
python 3:
Spoiler:
Unpacking Book...
Palm DB type: BOOKMOBI, 224 sections.
Warning: Bad key, size, value combination detected in EXTH 406 16 0000000000000
000
Unpacking a KF8 book...
Processing K8 section of book...
Mobi Version: 8
Codec: utf-8
Title: XXXX
EXTH Title: XXXX
Huffdic compression
Unpacking images, resources, fonts, etc
Extracting image: cover00046.jpeg from section 46
.
.
.
Extracting image: image00213.jpeg from section 213
Warning: RESC section length(14486bytes) does not match its size(14434bytes).
Extracting image: image00215.jpeg from section 215
Warning: Section 218 does not contain a recognised resource
Traceback (most recent call last):
File "kindleunpack.py", line 1008, in <module>
sys.exit(main())
File "kindleunpack.py", line 996, in main
unpackBook(infile, outdir, apnxfile, epubver, use_hd)
File "kindleunpack.py", line 910, in unpackBook
process_all_mobi_headers(files, apnxfile, sect, mhlst, K8Boundary, False, ep
ubver, use_hd)
File "kindleunpack.py", line 817, in process_all_mobi_headers
imgnames, image_ptr = processImage(i, files, imgnames, sect, data, beg, ima
ge_ptr, cover_offset)
File "kindleunpack.py", line 387, in processImage
sect.setsectiondescription(i,"Mysterious Section, first four bytes %s" % des
cribe(data[0:4]))
File "mobi_sectioner.py", line 37, i
n describe
txtans += i
TypeError: Can't convert 'int' object to str implicitly
5. test4.azw3 (an epub2 eBook which has several images in English)
Successfully unpacked with python 2.
With python3:
Spoiler:
Unpacking Book...
Palm DB type: BOOKMOBI, 363 sections.
Warning: Bad key, size, value combination detected in EXTH 406 16 0000000000000
000
Unpacking a KF8 book...
Processing K8 section of book...
Mobi Version: 8
Codec: utf-8
Title: XXXX
EXTH Title: XXXX
Huffdic compression
Unpacking images, resources, fonts, etc
Extracting image: image00341.jpeg from section 341
Extracting image: image00342.jpeg from section 342
Extracting image: image00343.jpeg from section 343
Extracting image: image00344.jpeg from section 344
Extracting image: image00345.jpeg from section 345
Extracting image: image00346.jpeg from section 346
Extracting image: image00347.jpeg from section 347
Extracting image: image00348.jpeg from section 348
Extracting image: image00349.jpeg from section 349
Extracting image: image00350.jpeg from section 350
Extracting image: image00351.jpeg from section 351
Extracting image: image00352.jpeg from section 352
Extracting image: image00353.jpeg from section 353
Extracting image: cover00354.jpeg from section 354
Extracting image: image00356.jpeg from section 356
Unpacking raw markup language
Warning: There are unprocessed index bytes left: b'0000'
Warning: There are unprocessed index bytes left: b'0000'
Warning: There are unprocessed index bytes left: b'000000'
Processing ncx / toc
Warning: There are unprocessed index bytes left: b'00'
Building an epub-like structure
Building proper xhtml for each file
Traceback (most recent call last):
File "kindleunpack.py", line 1008, in <module>
sys.exit(main())
File "kindleunpack.py", line 996, in main
unpackBook(infile, outdir, apnxfile, epubver, use_hd)
File "kindleunpack.py", line 910, in unpackBook
process_all_mobi_headers(files, apnxfile, sect, mhlst, K8Boundary, False, ep
ubver, use_hd)
File "kindleunpack.py", line 827, in process_all_mobi_headers
processMobi8(mh, metadata, sect, files, imgnames, pagemapproc, k8resc, obfus
cate_data, apnxfile, epubver)
File "kindleunpack.py", line 523, in processMobi8
usedmap = htmlproc.buildXHTML()
File "mobi_html.py", line 195, in bu
ildXHTML
lambda m:b' style="page-break-after:%s"'%m.group(1), tag)
File "mobi_html.py", line 195, in <l
ambda>
lambda m:b' style="page-break-after:%s"'%m.group(1), tag)
TypeError: unsupported operand type(s) for %: 'bytes' and 'bytes'
Take care,