Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 12-04-2010, 02:45 PM   #61
discusaigon
Connoisseur
discusaigon doesn't litterdiscusaigon doesn't litterdiscusaigon doesn't litter
 
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.
discusaigon is offline   Reply With Quote
Old 12-04-2010, 03:29 PM   #62
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,469
Karma: 5432724
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.
KevinH is offline   Reply With Quote
Advert
Old 12-04-2010, 05:34 PM   #63
discusaigon
Connoisseur
discusaigon doesn't litterdiscusaigon doesn't litterdiscusaigon doesn't litter
 
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.
discusaigon is offline   Reply With Quote
Old 12-04-2010, 06:55 PM   #64
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,469
Karma: 5432724
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.
KevinH is offline   Reply With Quote
Old 12-06-2010, 04:22 AM   #65
discusaigon
Connoisseur
discusaigon doesn't litterdiscusaigon doesn't litterdiscusaigon doesn't litter
 
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
discusaigon is offline   Reply With Quote
Advert
Old 12-06-2010, 04:53 AM   #66
discusaigon
Connoisseur
discusaigon doesn't litterdiscusaigon doesn't litterdiscusaigon doesn't litter
 
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
discusaigon is offline   Reply With Quote
Old 12-06-2010, 05:51 AM   #67
quocsan
Enthusiast
quocsan began at the beginning.
 
Posts: 26
Karma: 10
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:\)
quocsan is offline   Reply With Quote
Old 12-06-2010, 10:52 AM   #68
discusaigon
Connoisseur
discusaigon doesn't litterdiscusaigon doesn't litterdiscusaigon doesn't litter
 
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.
discusaigon is offline   Reply With Quote
Old 05-18-2011, 10:30 AM   #69
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,366
Karma: 305065800
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
pdurrant is offline   Reply With Quote
Old 05-31-2011, 10:08 PM   #70
naisren
Enthusiast
naisren began at the beginning.
 
Posts: 41
Karma: 12
Join Date: Jul 2009
Device: ppc
Quote:
Originally Posted by pdurrant View Post
[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
Thanks for your improvement.
Now the big challenge should be mobi dictionary.
naisren is offline   Reply With Quote
Old 06-01-2011, 02:11 AM   #71
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,366
Karma: 305065800
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Quote:
Originally Posted by naisren View Post
Thanks for your improvement.
Now the big challenge should be mobi dictionary.
My next big challenge is to handle multiple authors correctly, which requires big internal changes.

But feel free to have a go at handling dictionaries yourself...
pdurrant is offline   Reply With Quote
Old 06-27-2011, 06:06 PM   #72
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
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

Quote:
Originally Posted by naisren View Post
Now the big challenge should be mobi dictionary.
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
siebert is offline   Reply With Quote
Old 06-28-2011, 01:58 AM   #73
naisren
Enthusiast
naisren began at the beginning.
 
Posts: 41
Karma: 12
Join Date: Jul 2009
Device: ppc
Quote:
Originally Posted by siebert View Post
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!

Attachment 73437
My god, I could not believe where I am now. You make my dream come true.
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>
naisren is offline   Reply With Quote
Old 06-28-2011, 01:59 AM   #74
naisren
Enthusiast
naisren began at the beginning.
 
Posts: 41
Karma: 12
Join Date: Jul 2009
Device: ppc
and its unpacking speed is far faster than ever.
naisren is offline   Reply With Quote
Old 07-18-2011, 05:12 PM   #75
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
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:
  • NEW: Extract and save source zip files included by kindlegen as kindlegensrc.zip.
  • FIXED: idx:entry attribute "scriptable" must be present to create entry length tags.
  • FIXED: Don't save non-image sections as images.

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
siebert is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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 PDF 2 06-22-2009 09:28 AM


All times are GMT -4. The time now is 11:30 PM.


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