View Single Post
Old 02-05-2018, 09:11 PM   #405
democrite
Evangelist
democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.
 
Posts: 441
Karma: 77256
Join Date: Sep 2011
Device: none
Hello,

I've been using this for a long time without issues. Got a azw3 recently that errors:

Code:
Processing ncx / toc
Traceback (most recent call last):
  File "kindleunpack.py", line 1016, in <module>
    sys.exit(main())
  File "kindleunpack.py", line 1004, in main
    unpackBook(infile, outdir, apnxfile, epubver, use_hd)
  File "kindleunpack.py", line 919, in unpackBook
    process_all_mobi_headers(files, apnxfile, sect, mhlst, K8Boundary, False, epubver, use_hd)
  File "kindleunpack.py", line 836, in process_all_mobi_headers
    processMobi8(mh, metadata, sect, files, rscnames, pagemapproc, k8resc, obfuscate_data, apnxfile, epubver)
  File "kindleunpack.py", line 522, in processMobi8
    ncx_data = ncx.parseNCX()
  File "./mobi_ncx.py", line 45, in parseNCX
    outtbl, ctoc_text = self.mi.getIndexData(self.ncxidx, "NCX")
  File "./mobi_index.py", line 38, in getIndexData
    ctocdict = self.readCTOC(cdata)
  File "./mobi_index.py", line 131, in readCTOC
    pos, ilen = getVariableWidthValue(txtdata, offset)
  File "./mobi_index.py", line 157, in getVariableWidthValue
    if ord(v) & 0x80:
TypeError: ord() expected a character, but string of length 0 found
I didn't really try to figure out the code though adding if len(v) is 0, finished = True at least made it complete though I'm not sure if there's anything missing from the output.
democrite is offline   Reply With Quote