View Single Post
Old 11-12-2009, 01:50 PM   #1
adamselene
Enthusiast
adamselene can tame squirrels without the assistance of a chair or a whip.adamselene can tame squirrels without the assistance of a chair or a whip.adamselene can tame squirrels without the assistance of a chair or a whip.adamselene can tame squirrels without the assistance of a chair or a whip.adamselene can tame squirrels without the assistance of a chair or a whip.adamselene can tame squirrels without the assistance of a chair or a whip.adamselene can tame squirrels without the assistance of a chair or a whip.adamselene can tame squirrels without the assistance of a chair or a whip.adamselene can tame squirrels without the assistance of a chair or a whip.adamselene can tame squirrels without the assistance of a chair or a whip.adamselene can tame squirrels without the assistance of a chair or a whip.
 
Posts: 39
Karma: 11036
Join Date: Nov 2009
Device: Kindle Paperwhite, Kindle Touch, Kindle 2
KindleUnpack (MobiUnpack): Extracts text, images and metadata from Kindle/Mobi files

Most of this post now by pdurrant.

KindleUnpack is a set of python script that takes a Kindle/Mobipocket ebook and extracts the HTML, images and metadata contained in the ebook, and puts them in a form suitable for passing to KindleGen.

For KF8 files and combined Mobipocket and KF8 files, it also can produce separated mobipocket and KF8 files, and also the original source files if those are included in the ebook. In addition, for KF8 files it can produce an 'ePub', although if the HTML isn't compliant with ePub standards, the 'ePub' won't be either.

For Amazon's .azw4 files, it will extract the PDF that's been wrapped up in Amazon's .azw4 file format.

Downloads available:
Version 0.73 of the python scripts (including .pyw graphics front end)
Version 0.67 of a drag&drop AppleScript version.
A calibre plugin version of the scripts is available in this thread.

For anyone not interested in KindeGen and KF8, there's a copy of the last version of the single-file script, mobiunpack 0.32.

The name of the script was changed to KindleUnpack with version 0.6.1.

The Python scripts are released under GPLv3. The AppleScript Wrapper is released with unlicense.

Many thanks to adamselene for the base code which has been built on by many of the participants of this thread.

pdurrant



[Original Post:]
I reimplemented huff/cdic compression in Python, and did a few other things while I was at it. The new script:

* decompresses about 25x faster than mobihuff.py
* uses much less memory (about 16x on my largest test file)
* implements conversion of uncompressed and Palmdoc-compressed files
* handles trailing data correctly in all cases

Check it out: http://www.mit.edu/afs/athena/user/m.../mobiunpack.py

PLEASE NOTE that this tool is only for decompressing unencrypted Mobipocket files. It does not decrypt DRMed files. Do not ask me for help breaking DRM.
Attached Files
File Type: zip mobiunpack 32.py.zip (18.4 KB, 5903 views)
File Type: zip KindleUnpack v0.67.app.zip (406.5 KB, 417 views)
File Type: zip KindleUnpack_v073.zip (85.4 KB, 509 views)

Last edited by pdurrant; 07-16-2014 at 01:00 PM. Reason: Updated scripts to v0.73
adamselene is offline   Reply With Quote