12-04-2010, 03:45 PM | #61 |
Connoisseur
Posts: 84
Karma: 201
Join Date: Dec 2008
Device: HX4700 + BEBOOK + HP612c
|
Hi,
Please some help for a newbe I have installed python 2.7.1 put my PRC file (same as mobi file right ?)into the same folder as mobiunpack.py and run the mobiunpack.py. but nothing happens do I have to use the cmd.exe to run this script ? how to ? thanks. |
12-04-2010, 04:29 PM | #62 |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Hi,
If you are on windows, I assume you have downloaded and installed ActiveState's ActivePython 2.X for 32 bit as was recommended in this very thread. Next, you should know there is a gui version of the program (i.e no command line needed) available called MobiUnpack.pyw which actually runs the mobiunpack.py script for you (which is hidden away in the lib directory beside MobiUnpack.pyw). To run the gui version, simply double-click on MobiUnpack.pyw To run the command line version: Yes, you need to run cmd.exe. But first thing is to create a new folder to hold the contents of the unpack operation. So create a new folder right beside mobiunpack.py and your .mobi file. Then run cmd.exe and cd to where mobiunpack.py exists Then run the following command at the prompt: python mobiunpack.py YOURMOBIFILEHERE.mobi YOURNEWOUTPUTFOLDER That should unpack any non-drm Mobi file into its pieces. If you look in YOURNEWOUTPUTFOLDER afterwards you will see the .html images/ .op files. If you run into trouble simply pm KevinH here and I can try to help. |
Advert | |
|
12-04-2010, 06:34 PM | #63 |
Connoisseur
Posts: 84
Karma: 201
Join Date: Dec 2008
Device: HX4700 + BEBOOK + HP612c
|
Hi I tried the .pyw but it did nothing
I tried the py in cmd and got an error, the file could not be found : [/URL] however, I'm sure, ther is no mistake in the name of the file. |
12-04-2010, 07:55 PM | #64 |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Hi,
What happened exactly (what error message) when you double-clicked on MobiUnpack.pyw? If you have properly installed Python on your machine, double-clicking on the MobiUnpack.pyw file should start up a gui window. To test if that would be the case, right click on the MobiUnpack.pyw file and make sure it is properly associated with the pythonw.exe executable that is part of Python 2.X. You probably have not added the Python executable path to your System PATH environment variable or you are using Python 2.7 from python.org and not the ActiveState version that was recommended. As for your command line errors, if your file exists, then your issue is one of paths. The mobiunpack.py program looked right beside itself to find the fra-eng.mobi book and could not find it (that is why there is an error message). To make things a little easier triple check that you have copied mobiunpack.py and your fra-eng.mobi to the exact same folder and that inside that folder (right beside your fra-eng.mobi book and mobiunpack.py), you create a new empty folder called "book". Then run cmd.exe and cd to the folder where mobiunpack.py, your "book" folder and fra-eng.mobi are. The type the following command: python.exe mobiunpack.py fra-eng.mobi book Once complete, you will find the pieces inside the "book" folder. If not, then there is probably something wrong with how you have installed Python. |
12-06-2010, 05:22 AM | #65 |
Connoisseur
Posts: 84
Karma: 201
Join Date: Dec 2008
Device: HX4700 + BEBOOK + HP612c
|
the probleme is I don't have any error message when I try to use the pyw
nothing just happens I may have a problem with my python installation |
Advert | |
|
12-06-2010, 05:53 AM | #66 |
Connoisseur
Posts: 84
Karma: 201
Join Date: Dec 2008
Device: HX4700 + BEBOOK + HP612c
|
It is bizar ...
I tried an old script I had in pyw (ineptpdf.pyw) and it worked well so python is well installed on my computer. I simplified the name of my file to avoid mistakes and still have the same errors with the script : [/URL] as you can see ther is no mistake in the folder or file name |
12-06-2010, 06:51 AM | #67 |
Enthusiast
Posts: 32
Karma: 2204
Join Date: Jul 2009
Device: none
|
Please change directory to I:\py then run the script or put "\py" before the ebook name (such as \py\dico.mobi.
It showed errors because there is no "dico.mobi" in the current directory (I:\) |
12-06-2010, 11:52 AM | #68 |
Connoisseur
Posts: 84
Karma: 201
Join Date: Dec 2008
Device: HX4700 + BEBOOK + HP612c
|
thanks !
changing direcotry was the trick ! I learned how to use the cd\ and it works well now. I tried with the first script and it was quick. Now with the second, it's slower but I understand it might be normal as it has to manage images. |
05-18-2011, 11:30 AM | #69 |
The Grand Mouse 高貴的老鼠
Posts: 72,497
Karma: 309060442
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
[Enhancement: Now works with some TEXtREAd early Mobipocket files]
[Enhancement: Added character set metadata to HTML file] See https://www.mobileread.com/forums/sho...36&postcount=5 |
05-31-2011, 11:08 PM | #70 | |
Enthusiast
Posts: 41
Karma: 12
Join Date: Jul 2009
Device: ppc
|
Quote:
Now the big challenge should be mobi dictionary. |
|
06-01-2011, 03:11 AM | #71 |
The Grand Mouse 高貴的老鼠
Posts: 72,497
Karma: 309060442
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
|
06-27-2011, 07:06 PM | #72 |
Developer
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
|
New mobiunpack version with dictionary support
It took me several weeks of reverse engineering and a few days of coding, but here is finally the first mobiunpack version supporting dictionaries!
I've made some shortcuts and omitted features not necessary for the dictionaries I'm interested in (e.g. unicode support, the old deprecated inflection format), so the script might not work for the dictionary you want to unpack, but feel free to improve the code A couple of other fixes and enhancements are also included, most notable some speed optimizations. A huge dictionary is now unpacked within minutes instead of hours by using temporary files. Have fun! mobiunpack.zip |
06-28-2011, 02:58 AM | #73 | |
Enthusiast
Posts: 41
Karma: 12
Join Date: Jul 2009
Device: ppc
|
Quote:
unpacking speed, inflection, unicode, all these were pain, now no more harassing! Thanks a lot, my test: mobiunpack.py PocketOxford.mobi MobiUnpack 0.26 Copyright (c) 2009 Charles M. Hannum <root@ihack.net> With Images Support and Other Additions by P. Durrant and K. Hendricks With Dictionary Support and Other Additions by S. Siebert Unpacking Book... Mobipocket version 4 Huffdic compression Unpack raw html Document contains orthographic index, handle as dictionary Info: Index doesn't contain entry length tags Read dictionary index data Warning: There are unprocessed index bytes left: 08 Warning: There are unprocessed index bytes left: af Warning: There are unprocessed index bytes left: 01 a1 Warning: There are unprocessed index bytes left: 00 18 ff Warning: There are unprocessed index bytes left: 75 70 Warning: There are unprocessed index bytes left: 76 04 8e Warning: There are unprocessed index bytes left: aa 01 c0 Warning: There are unprocessed index bytes left: 28 Warning: There are unprocessed index bytes left: 67 02 77 Warning: There are unprocessed index bytes left: c4 00 d0 Warning: There are unprocessed index bytes left: 6f 75 Warning: There are unprocessed index bytes left: 0a Decode images Find link anchors Insert data into html Insert hrefs into html Remove empty anchors from html Insert image references into html Write html Write opf Completed The Mobi HTML Markup Language File can be found at: PocketOxford\PocketOxford.html Code:
<mbp:pagebreak></mbp:pagebreak> <a></a><idx:entry> <idx:orth value="ley [1]"> </idx:entry> <div bgcolor="#FFFFDD" border="1" bordercolor="#000066"><span color="#000066"> <b>ley</b> [1] </span></div> <div align="left"> <span color="red"><i>noun</i></span> <br/><img src="images/00005.jpg" /> a piece of land temporarily put down to grass, clover, etc. </div> <br/><span color="#000066">ORIGIN</span>: Old English, «fallow»; related to <a href="" filepos="0011367107" ><b><small>LAY</small></b></a> and <a href="" filepos="0011568603" ><b><small>LIE</small></b></a>. <hr color="#000066" width="70%"/> <div align="center"><a onclick="history.back()"><img src="images/00006.jpg" border="0" align="middle"/> Back</a>***<a onclick="index_search()"><img src="images/00004.jpg" align="middle" border="0"/> New Search</a></div> <mbp:pagebreak></mbp:pagebreak> <a></a><idx:entry> <idx:orth value="ley [2]"> </idx:entry> <div bgcolor="#FFFFDD" border="1" bordercolor="#000066"><span color="#000066"> <b>ley</b> [2] </span> (also <b>ley line</b>) </div> <div align="left"> <span color="red"><i>noun</i></span> <br/><img src="images/00005.jpg" /> a supposed straight line connecting three or more ancient sites, associated by some with lines of energy and other paranormal phenomena. </div> <br/><span color="#000066">ORIGIN</span>: variant of <a href="" filepos="0011383653" ><b><small>LEA</small></b></a>. <hr color="#000066" width="70%"/> <div align="center"><a onclick="history.back()"><img src="images/00006.jpg" border="0" align="middle"/> Back</a>***<a onclick="index_search()"><img src="images/00004.jpg" align="middle" border="0"/> New Search</a></div> |
|
06-28-2011, 02:59 AM | #74 |
Enthusiast
Posts: 41
Karma: 12
Join Date: Jul 2009
Device: ppc
|
and its unpacking speed is far faster than ever.
|
07-18-2011, 06:12 PM | #75 |
Developer
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
|
New version 0.27 and github repository
Hi,
I've created a new version 0.27 with the following changes:
mobiunpack_0.27.zip To ease development I've also pushed my git repository for the mobipocket script to github. Feel free to fork it if you want to improve the script: https://github.com/siebert/mobiunpack Ciao, Steffen |
|
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 05:16 PM |
PDF to Mobi with text and images | pocketsprocket | Kindle Formats | 7 | 05-21-2012 08:06 AM |
Mobi files - images | DWC | Introduce Yourself | 5 | 07-06-2011 02:43 AM |
pdf to mobi... creating images rather than text | Dumhed | Calibre | 5 | 11-06-2010 01:08 PM |
Transfer of images on text files | anirudh215 | 2 | 06-22-2009 10:28 AM |