04-29-2012, 02:33 PM | #361 |
Enthusiast
Posts: 27
Karma: 110
Join Date: Dec 2010
Location: Chicago, IL
Device: iPad, Kindle
|
I'm sorry, came in on this very late.
How do I run the mobiunpacker python script from OS X? From windows? Is there an applescript version? (spoiled by other .apps found here ... ) I read that I could run python scripts from TextWrangler. So I opened the script in Text Wrangler and chose Run from its #! menu. I got a processing alert that churned for a little while until I cancelled it since I had no idea what I was doing LOL (checked my hard drive ... yes, still there). I guess I thought I'd get asked to locate the .mobi file I wanted to unpack. Thanks for any help AM |
04-29-2012, 02:48 PM | #362 |
Wizzard
Posts: 11,517
Karma: 33048258
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International, Sony PRS-T1, BlackBerry PlayBook, Acer Iconia
|
From Mac OS X you've got two choices, you can associate the .pyw file with the Python Launcher (it's somewhere under /System/Library/Frameworks/Python.framework/Current Version/Resources, IIRC; I'm on the Windows netbook so I can't go check my Mac right now) so you can double-click and get a GUI window from which you select and process your Mobi files one at a time.
This is actually kind of tedious, and what I prefer to do is use the Python version of the script directly (in the unpacked "lib" folder as mobi_unpack.py) and alias it in my .profile so I can just call it with a simple command in the Terminal. If you just want to run it to see how it works, open up a Terminal window and then type "python " and drag and drop the mobi_unpack.py onto the Terminal window and press enter, and then you can see the options. After that, just repeat as above with your selected option and drag and drop your Mobi file from the Finder to process. Hope this helps. |
Advert | |
|
04-29-2012, 03:13 PM | #363 |
Enthusiast
Posts: 27
Karma: 110
Join Date: Dec 2010
Location: Chicago, IL
Device: iPad, Kindle
|
Thanks ATDrake, that worked fine.
Do Windows users have something similar to Python Launcher? (I need to show non-techie Windows users how to use this.) |
04-29-2012, 03:22 PM | #364 |
Wizzard
Posts: 11,517
Karma: 33048258
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International, Sony PRS-T1, BlackBerry PlayBook, Acer Iconia
|
I think so, if the ActiveState python package is installed you can double-click to launch a .pyw, but I really have no idea, since I rarely use Windows for anything serious (this netbook is a hand-me-down which I basically use for portable surfing while doing-other-stuff-I-should-really-concentrate-on-more).
|
04-29-2012, 03:33 PM | #365 |
Resident Curmudgeon
Posts: 75,892
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
All I did was install Python and it associated .py and .pyw with it automatically. No need to do anything extra.
|
Advert | |
|
04-30-2012, 04:03 AM | #366 |
Connoisseur
Posts: 99
Karma: 10
Join Date: Nov 2011
Device: Kobo Touch
|
I have a question about how to use this script...
So, let me explain. I have an ePub I want to convert to Mobi. I could have used Calibre to do so, but I'm not sure Calibre handles the KF8 format. But, at the same time, is there any use of converting an ePub to a KF8? Will I gain something? So, I have converted the ePub using Kindle Previewer. And the Mobi was twice the size as the ePub. I have read this is because kindlegen put the original ePub in the Mobi as well (why? This is kinda stupid to me) So I have extracted the Mobi using this script, then delete the kindlegensrc.zip file, then what? Should I recompile the Mobi using Kindle Previewer as well, using the opf file? When I do that often I get warnings, and the resulting Mobi file lose a part of formatting the Mobi file has kept at first. Thanks |
04-30-2012, 04:27 AM | #367 |
Wizzard
Posts: 11,517
Karma: 33048258
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International, Sony PRS-T1, BlackBerry PlayBook, Acer Iconia
|
Create your Mobi from the ePub in the regular way, and just use the split option of MobiUnpack to divide the Mobi7 Mobipocket file from the Mobi8 KF8 file and discard whichever one you don't need.
No need to extract the entire thing, much less recompile after that. As for the benefits, if the ePub happens to have nicer-than-usual formatting and your Kindle Touch is updated to display the KF8 format, then you can enjoy stuff like drop caps and proper right-hand margins and other things Mobi users don't see. |
04-30-2012, 04:35 AM | #368 |
Connoisseur
Posts: 99
Karma: 10
Join Date: Nov 2011
Device: Kobo Touch
|
Thanks. I'm afraid I still don't understand something. I have no option in the MobiUnpack. I drag and drop the mobi file to the OS X .app file, and it extracts me all in a folder. So I have no real choice than extracting all. Except if you can find me a way to use this on a Mac without extracting all.
In fact I convert the ePub to Mobi using Kindle Previewer, then extract the Mobi using the python script through the .app file I found in this thread, if I remember well I have one html file (seems Mobi use just one html whereas ePub use one html per chapter), one ncx file or something like that, one opf file, and the kindlegensrc file. Oh and an image folder as well. My goal would be mostly to delete the kindlegensrc.zip file from the Mobi as it is not needed for the Mobi and it doubles the size of the Mobi. And why not as you said to drop the Mobi7 stuff if needed but no idea how to do this as the converted Mobi just has the files I told you about. I'm surprised as well as I've heard the KF8 format use a css file as well. Last edited by Julien Pham; 04-30-2012 at 04:50 AM. |
04-30-2012, 04:55 AM | #369 |
Wizzard
Posts: 11,517
Karma: 33048258
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International, Sony PRS-T1, BlackBerry PlayBook, Acer Iconia
|
I wrote up a thing on how to use it on the Mac in post #362 upthread.
When using the .pyw GUI, double-click to open the app instead of dragging and dropping, and check the split option in the dialogue box, and that IIRC should give you a .mobi7, a .mobi8, and a kindlegensrc.zip output. For using from the command line, you want the -s option. It's possible that it auto-splits and also extracts the Mobi files (been a while since I bothered to use it, as I only have a K2 and use an older version of KindleGen which creates Mobi-only), but you can ignore those pieces and only bother keeping whichever version of the .mobiX you need. If it still seems bloated afterwards, you can run Kindlestrip on it to make sure the source files are no longer there. |
04-30-2012, 04:59 AM | #370 |
Connoisseur
Posts: 99
Karma: 10
Join Date: Nov 2011
Device: Kobo Touch
|
When you are talking about the .pyw GUI, are you talking about the Mobipocket Unpacker.app file I found somewhere in this thread?
Thanks |
04-30-2012, 05:05 AM | #371 |
Wizzard
Posts: 11,517
Karma: 33048258
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International, Sony PRS-T1, BlackBerry PlayBook, Acer Iconia
|
No, I'm talking about the Mobi_Unpack python script & widget, of which version 050 can be found in this post here.
|
04-30-2012, 05:11 AM | #372 |
Connoisseur
Posts: 99
Karma: 10
Join Date: Nov 2011
Device: Kobo Touch
|
Thanks a lot, it looks like a fine script
I'll first though try to correct all the warnings I get from this ePub to Mobi conversion to have a clean Mobi. Edit : though I have a problem, I cannot send the .azw3 file on my Kindle personal space, it says the format is not recon. Can I safely just change the .azw3 extension to .mobi to send there? And so use this .mobi extension in Calibre too? Edit 2 : ok I found I just renamed the azw3 to azw and it worked Last edited by Julien Pham; 04-30-2012 at 07:11 AM. |
04-30-2012, 12:40 PM | #373 |
Connoisseur
Posts: 99
Karma: 10
Join Date: Nov 2011
Device: Kobo Touch
|
Unfortunately it seems the iPhone Kindle app does not support the KF8 format... yet... the KF8 (AZW3 files renamed as AZW) cannot be downloaded on my iPhone, the download stops at about 97%...
So either I'll have to forget about the iPhone (I'll probably do this, when my touch will arrive I'll never read again on the iPhone anyway) or I'll have to find a way to have a combined KF7/KF8 file but without the kindlegensrc.zip file |
04-30-2012, 01:00 PM | #374 | |
Wizzard
Posts: 11,517
Karma: 33048258
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International, Sony PRS-T1, BlackBerry PlayBook, Acer Iconia
|
Quote:
|
|
04-30-2012, 01:45 PM | #375 | |
Sigil Developer
Posts: 8,098
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Only the latest version works with the latest version of Kindlegen so look for kindlestrip_v133.py. All earlier versions leave pointers in the mobi header to non-existant src archives that can come back to bite you.
KevinH Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can i rotate text and insert images in Mobi and EPUB? | JanGLi | Kindle Formats | 5 | 02-02-2013 04:16 PM |
PDF to Mobi with text and images | pocketsprocket | Kindle Formats | 7 | 05-21-2012 07:06 AM |
Mobi files - images | DWC | Introduce Yourself | 5 | 07-06-2011 01:43 AM |
pdf to mobi... creating images rather than text | Dumhed | Calibre | 5 | 11-06-2010 12:08 PM |
Transfer of images on text files | anirudh215 | 2 | 06-22-2009 09:28 AM |