1.0.5 • Published 3 years ago
kindleunpack v1.0.5
node-kindleunpack
Simple Node.js wrapper of KindleUnpack to unpack Amazon / Kindlegen generated ebooks:
- Kindle Mobi eBook File (
*.mobi) - Kindle PRC eBook File (
*.prc) - Kindle AZW eBook File (
*.azw) - Kindle Version 8 (
*.azw3) - Kindle AZW4 Print Replica (
*.azw4)
Install
npm install kindleunpackUsage
const { unpack } = require("kindleunpack");
unpack("test.mobi", "output/ebook1");
unpack("test.azw3", "output/ebook2", {
use_hd: false,
split_combos: false,
apnx_file: "",
epub_version: "2",
write_raw: false,
dump: false,
});unpack(ebookFile, outputDir): Promise
ebookFilestring - path to the desired Kindle/MobiPocket ebookoutputDirstring (optional) - output directory (default: ".")optionsobject (optional)use_hdboolean (optional) - use HDImages to overwrite lower resolution versions, if presentsplit_combosboolean (optional) - split combination mobis into older mobi and mobi KF8 ebooksapnx_filestring (optional) - path to a.apnxfile that contains real page numbers associated with an azw3 ebookepub_version2|3|A|F(optional) - pecify EPUB version to unpack to:2,3orA(for automatic) orFfor Force to EPUB2, default is2write_rawboolean (optional) - write raw data to the output folderdumpboolean (optional) - dump headers and other debug info to output and extra files
Returns Promise<{ stdout: string; stderr: string }>
CLI
kindleunpack [-r -s -d -h -i] [-p APNX_FILE] ebookFile outputDirArguments
ebookFile- path to the desired Kindle/MobiPocket ebookoutputDir- output directory
Options
-i- use HDImages to overwrite lower resolution versions, if present-s- split combination mobis into older mobi and mobi KF8 ebooks-r- write raw data to the output folder-d- dump headers and other debug info to output and extra files--epub_version=- specify EPUB version to unpack to:2,3orA(for automatic) orFfor Force to EPUB2, default is2-p APNX_FILE- path to a.apnxfile that contains real page numbers associated with an azw3 ebook (optional). Note: many apnx files have arbitrarily assigned page offsets that will confuse KindleUnpack if used
Development
Build kindleunpack executable file
pip3 install -i https://mirrors.aliyun.com/pypi/simple/ pyinstaller
pyinstaller -F "kindleunpack.py"