Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 03-08-2012, 12:39 PM   #1
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,039
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
[GUI Plugin] KindleUnpack - The Plugin

(formerly MobiUnpack - The Plugin: changed 1/29/2013)

Used to unpack/inspect the contents of DRM-free Kindle Books/MOBI files.

KindleUnpack (formerly MobiUnpack) has existed as a standalone python tool for quite some time. Its purpose is to unpack the contents of DRM-free Kindle Books or MOBI files into their source components—all the while trying to maintain as much of the original metadata as humanly possible. This is useful for tweaking existing Kindle Books or MOBIs with the intention of rebuilding with kindlegen... as well as simply being a tool for studying the internals of Kindle Books or MOBI files in general.

It has the ability to extract the data from standard MOBIs, KF8s, Joint MOBI/KF8s, Print Replicas (AZW4), and has some limited (experimental) support for processing MOBI dictionaries (Provided they are DRM-free of course).

KindleUnpack has been contributed to by numerous people over time (pdurrant, KevinH and myself among them), so I'm only claiming responsibility for building the plugin around it. The original MobileRead thread that documents the evolution of the core of this plugin can be found here. The latest versions of that stand-alone tool can be found in this post.

Main Features of KindleUnpack - The Plugin:
  • Unpack the source components of DRM-free Kindle Books or MOBI files to an external directory (configured/chosen by the user).
  • Split Kindlegen 2 produced files into separate, stand-alone MOBI and KF8 ebooks.
  • Convert DRM-free KF8 ebooks to ePubs; and add to the calibre library.
  • Extract PDFs from DRM-free Print Replica ebooks (AZW4); and add to the calibre library.

Special Notes:
  • Requires calibre v0.8.60 or higher.

Installation Steps:
  • Download the attached zip file and install the plugin... add to context menu and/or toolbar... and restart Calibre as described in the Introduction to plugins thread.

Configuration:
  • From the Configure menu or the Customize plugin button... configure a "Default Unpack Directory."
  • If you want the plugin to automatically use the Default Unpack Directory, then check the "Always use the Default Unpack Directory" box. Otherwise, you will be prompted to choose a directory each time you unpack a MOBI.

Github Repository for the plugin code/releases

Version History:
Spoiler:
  • Version 0.83.1 - 6 January 2022 - Prepare for calibre 6 (PyQt6)
  • Version 0.83.0 - 28 December 2020 - Fix incorrect mobi header type in some magazines
  • Version 0.82.3 - 26 September 2020 - Fix mobi_split breakage introduced starting with calibre 5.0
  • Version 0.82.2 - 25 September 2020 - Fix rare error condition and allow plugin to be added to toolbars when a device is connected
  • Version 0.82.1 - 18 December 2019 - Update to use the latest upstream KindleUnpack core files and accommodate upcoming Python3 version of calibre
  • Version 0.81.5 - 29 July 2017 - Update to use the latest upstream KindleUnpack core files.
  • Version 0.81.4 - 5 March 2017 - Fix AZW3s being falsely presented as being splittable in calibre plugin menus.
  • Version 0.81.3 - 29 January 2017 - Try Latin-1 encoding on extra resc data (after UTF-8) before failing. Reduced code involved to get/patch core Kindleunpack files.
  • Version 0.81.2 - 7 September 2015 - (re)Fixed unicode user directory bug on Windows platform.
  • Version 0.81.1 - 17 May 2015 - Fixed unicode path issue in splitter on Windows platform.
  • Version 0.81.0 - 11 May 2015 - updated to latest core code (v0.80+).
  • Version 0.80.0 - 11 March 2015 - updated to experimental core code (v0.80).
  • Version 0.77.0 - 29 October 2014 - updated to latest core code (v0.77).
  • Version 0.75.0 - 15 September 2014 - updated to latest core code (v0.75).
  • Version 0.73.0 - 20 July 2014 - updated to latest core code (v0.73)/ported to work with Qt5.
  • Version 0.67.0 - 13 June 2014 - updated to latest core code (v0.67).
  • Version 0.65.0 - 26 April 2014 - updated to latest core code (v0.65).
  • Version 0.62.0 - 28 April 2013 - updated to latest core code (v0.62).
  • Version 0.61.0 - 29 January 2013 - Renamed KindleUnpack - The Plugin (21,801 downloads).
  • Version 0.54.1 - 14 October 2012 (15,760 downloads).
  • Version 0.5.4 - 13 September 2012 (6,430 downloads).
  • Version 0.5.1 - 18 June 2012 (10,412 downloads).
  • Version 0.5.0 - 20 May 2012 (4733 downloads).
  • Version 0.4.7 - 24 Mar 2012 (6783 downloads).
  • Version 0.4.5 - 08 Mar 2012 Initial version (2000+ downloads).
Attached Files
File Type: zip kindle_unpack_v0831_plugin.zip (99.7 KB, 57986 views)

Last edited by DiapDealer; 01-06-2022 at 12:24 PM.
DiapDealer is offline   Reply With Quote
Old 03-08-2012, 04:21 PM   #2
thomass
Wizard
thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.
 
Posts: 1,669
Karma: 2300001
Join Date: Mar 2011
Location: Türkiye
Device: Kindle 5.3.7
thanks for this.
works great
thomass is offline   Reply With Quote
Advert
Old 03-24-2012, 08:55 AM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,039
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Updated plugin to use the latest changes in the stand-alone mobi_unpack tool. Which included various bugfixes related to anchor placement and compressed/embedded fonts.

Now at version 0.4.7
DiapDealer is offline   Reply With Quote
Old 04-02-2012, 06:21 PM   #4
ElizabethN
reader, ebook junkie
ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.
 
ElizabethN's Avatar
 
Posts: 110
Karma: 436806
Join Date: Dec 2007
Location: western nebraska
Device: in use kindle oasis 2nd and 3rd gen, kobo forma, boox poke5
I wanted to make sure that I'm interpreting the results of mobiunpack correctly.

I'm basically using mobiunpack to tell if my imported file is mobi8 or mobi7 as I'm not able to tell by looking at the kindle content file and/or the calibre file without using something like mobi meta editor and looking at the file heading.

If mobi7, mobiunpack offers me only the unpack option.
If mobi8, then mobiunpack offers unpack and KF8 to epub options.

If the file is mobi8 and I want to send it to my e-ink kindle then I would need to either download from amazon or convert mobi to mobi. Conversion results in a mobi file (mobi7) and orig_mobi (mobi8). As long as I don't delete the orig_mobi file then I have still have access to the kf8 file if I use the restore original feature.

Ok, am I making this too hard? Is there an easier way to determine if a file is mobi7 or mobi8 then using MobiUnpack?

Thanks!
ElizabethN is offline   Reply With Quote
Old 04-03-2012, 08:38 AM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,039
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by ElizabethN View Post
I'm basically using mobiunpack to tell if my imported file is mobi8 or mobi7 as I'm not able to tell by looking at the kindle content file and/or the calibre file without using something like mobi meta editor and looking at the file heading.

If mobi7, mobiunpack offers me only the unpack option.
If mobi8, then mobiunpack offers unpack and KF8 to epub options.
That's correct.

Quote:
If the file is mobi8 and I want to send it to my e-ink kindle then I would need to either download from amazon or convert mobi to mobi. Conversion results in a mobi file (mobi7) and orig_mobi (mobi8). As long as I don't delete the orig_mobi file then I have still have access to the kf8 file if I use the restore original feature.
This is correct, too. You could also extract the ePub from the original KF8 and convert that to mobi... your choice. Since there is no separate KF8 format in calibre, your method of saving the orig_mobi may be the best way to keep track of the original KF8 for now.

Quote:
Ok, am I making this too hard? Is there an easier way to determine if a file is mobi7 or mobi8 then using MobiUnpack?
There is no "easy and quick" way to determine a file's KF8-ness. Your way works as well as another. There are some scripts you could run to dump the mobi headers... you could also open the ebook in the Kindle App (PC/Mac). For the time being, KF8 books can only be read in single column view with the apps; so multi-column mode just won't change anything—telling you it's a KF8. But I don't know how long that might be relied on.
DiapDealer is offline   Reply With Quote
Advert
Old 05-11-2012, 04:39 PM   #6
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,748
Karma: 86234863
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
Would you please update the plugin to reflect the newer version of
Mobi_Unpack (050)?

Also, since Calibre now supports the extension AZW3 for KF8 files it would be nice if the plugin did also.
jhowell is offline   Reply With Quote
Old 05-15-2012, 04:17 PM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,039
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I hope to do so very shortly.
DiapDealer is offline   Reply With Quote
Old 05-19-2012, 09:21 PM   #8
ElizabethN
reader, ebook junkie
ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.
 
ElizabethN's Avatar
 
Posts: 110
Karma: 436806
Join Date: Dec 2007
Location: western nebraska
Device: in use kindle oasis 2nd and 3rd gen, kobo forma, boox poke5
Is there a way to use "kf8 to epub" on more than 1 file at a time? I've tried selecting 2 to 3 files but the plugin only works on the last file selected in the group and ignores the others.

Thanks
ElizabethN is offline   Reply With Quote
Old 05-20-2012, 03:10 PM   #9
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,039
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by ElizabethN View Post
Is there a way to use "kf8 to epub" on more than 1 file at a time? I've tried selecting 2 to 3 files but the plugin only works on the last file selected in the group and ignores the others.

Thanks
That's just not going to be possible with the current structure of the plugin. Maybe if I get off my duff and learn how to submit jobs to calibre's scheduler via an interface plugin, I can overhaul the plugin. But until then, it's one at a time. Sorry.

Last edited by DiapDealer; 05-20-2012 at 03:30 PM.
DiapDealer is offline   Reply With Quote
Old 05-20-2012, 03:17 PM   #10
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,039
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Updated plugin to use the latest changes in the stand-alone mobi_unpack tool. Updated the plugin to recognize AW3 files as valid input. Also changed the splitter feature so the KF8-only file is created with an AZW3 extension.

Now at version 0.5.0
DiapDealer is offline   Reply With Quote
Old 05-20-2012, 04:17 PM   #11
ElizabethN
reader, ebook junkie
ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.ElizabethN ought to be getting tired of karma fortunes by now.
 
ElizabethN's Avatar
 
Posts: 110
Karma: 436806
Join Date: Dec 2007
Location: western nebraska
Device: in use kindle oasis 2nd and 3rd gen, kobo forma, boox poke5
thanks for updating the plug-in.

no problem with the single job interface, I'm just happy to have mobiunpack as a plugin.
ElizabethN is offline   Reply With Quote
Old 06-11-2012, 12:47 PM   #12
DMee
Zealot
DMee began at the beginning.
 
Posts: 116
Karma: 10
Join Date: Jun 2011
Location: Stockport, UK
Device: ipad, iphone, kindle
Got some MOBI files that Calibre just can't convert - thought your plugin might be the trick.

MUst say its a bit weird on first use - I right click the file, plugin is there, only option was to Customise Plugin - only by clicking other files did I realise it only offered options when it found a suitable MOBI file.....

Maybe a note "Unable to unpack this file"??

So, I still have some files that are supposed to be MOBI and even your plugin won't touch - there is SOMETHING in them as opening in Notepad produces gibberish text.

Not a biggie now as I am not interested in reading these downloads - just curiosity piqued as to why they can't be tweaked (and they're not DRM'd)

(Even the eReader in Calibre won't deal with them!)
DMee is offline   Reply With Quote
Old 06-15-2012, 05:44 AM   #13
mwyoung
MWYoung
mwyoung began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2012
Device: none
Hi folks,

Total noob to calibre and python and just about everything these days. Been at war for 20 years and just got back and discovered calibre for the thousands (I'm NOT kidding) of books on my various computers (9).

Now, I'm attempting(!) to put all my books in one place and get them all in the same format--I don't care which format...(Oh, ya, that's gonna happen)

However, I attempted to install your plugin (Mobi_Unpack_v050.zip) to calibre v0.8.56 (current version and by the usual install method) and got back the following:

(open quote)
calibre, version 0.8.56
ERROR: Unhandled exception: <b>InvalidPlugin</b>:The plugin in u'C:/Program Files/Calibre2/plugins2/Mobi_Unpack_v050.zip' is invalid. It does not contain a top-level __init__.py file

Traceback (most recent call last):
File "site-packages\calibre\gui2\preferences\plugins.py", line 306, in add_plugin
File "site-packages\calibre\customize\ui.py", line 339, in add_plugin
File "site-packages\calibre\customize\ui.py", line 54, in load_plugin
File "site-packages\calibre\customize\zipplugin.py", line 160, in load
File "site-packages\calibre\customize\zipplugin.py", line 255, in _locate_code
InvalidPlugin: The plugin in u'C:/Program Files/Calibre2/plugins2/Mobi_Unpack_v050.zip' is invalid. It does not contain a top-level __init__.py file
(close quote)

I'm pretty sure calibre had me in mind when it generated this error...you know, book library trials and tribulations and all that (ISBN or LOCCN ordering?).

Please relate to me what I've done wrong (this time!) and correct my bad behavior, please...

TIA
Mwyoung
mwyoung is offline   Reply With Quote
Old 06-15-2012, 05:55 AM   #14
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,682
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@mwyoung - welcome to MobileRead.

These sorts of errors happen when people forget to restart calibre after installing plugins. Make sure you restart it, then try the install again, restart calibre again and then try the plugin.

If you still have issues it could be your calibre installation has an issue. Uninstall calibre (you will not lose your library), reinstall it, install the plugin and restart.

Any time you install or update a plugin you must restart calibre - stick to that and you shouldn't have any issues like the above.

@Kovid - I haven't tried calibre's plugin load option/plugin updater option lately, but if you haven't already done so already I wonder if we should fiddle things so users are given the "Restart now" dialog like they get if they make changes elsewhere in Preferences?
kiwidude is offline   Reply With Quote
Old 06-15-2012, 06:34 AM   #15
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,532
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Not all plugin types require calibre restarts. For example file type and conversion plugins do not. But I'm fine with having a restart prompt on the general principle that restarting after installing plugins is a good idea, to ensure everything is initialized properly.
kovidgoyal is offline   Reply With Quote
Reply

Tags
mobi2mobi


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] EpubMerge JimmXinu Plugins 542 10-28-2024 02:40 PM
[GUI Plugin] EpubSplit JimmXinu Plugins 443 08-13-2024 04:20 PM
[GUI Plugin] Open With kiwidude Plugins 403 04-01-2024 09:39 AM
[GUI Plugin] Ex Libris AlPe Plugins 87 10-10-2020 04:10 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 01:27 PM


All times are GMT -4. The time now is 08:21 PM.


MobileRead.com is a privately owned, operated and funded community.