10-30-2014, 10:58 AM | #1096 |
Sigil Developer
Posts: 7,637
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi DiapDealer and tkeo,
I pushed the fix to both master and python2and3 branches. It will be in the next release once I get some free time to incorporate tkeo's audio and video unpacking code into both the master and python2and3 branches. tkeo if you want me to push a patch that will make using Furigana metadata under auto indicate a target of epub 3, please provide patches for both branches if possible. DiapDealer, please tell the bug reporter thanks for reporting the bug! Take care, KevinH Last edited by KevinH; 10-30-2014 at 11:25 AM. Reason: fix typo |
11-01-2014, 08:27 AM | #1097 |
Connoisseur
Posts: 94
Karma: 10
Join Date: Feb 2014
Location: Japan
Device: Kindle PaperWhite, Kobo Aura HD
|
Hi Kevin,
I have made patches that make using Furigana metadata under auto indicate a target of epub 3. But it cannot be tested in python2and3 branch because errors occur in command line mode as follows. python2 Code:
Traceback (most recent call last): File "kindleunpack.py", line 11, in <module> from .compatibility_utils import PY2, binary_type, utf8_str, unicode_str ValueError: Attempted relative import in non-package Code:
Traceback (most recent call last): File "kindleunpack.py", line 11, in <module> from .compatibility_utils import PY2, binary_type, utf8_str, unicode_str SystemError: Parent module '' not loaded, cannot perform relative import |
Advert | |
|
11-01-2014, 08:58 AM | #1098 |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
Catching up with the thread, I discovered that for some time KindleUnpack has experimentally been able to unpack dictionaries, and possibly can even unpack inflections!
Using the current release of KindleUnpack Calibre Plugin I tried it successfully on a set of dictionaries Thank you developers. But it would not work on my homebrew NADSAT dictionary and reported the following: Code:
calibre, version 2.8.0 ERREUR : KindleUnpack - The Plugin v0.77.0: 2 Traceback (most recent call last): File "calibre_plugins.kindleunpack_plugin.extraction", line 186, in unpack_ebook File "calibre_plugins.kindleunpack_plugin.utilities", line 282, in unpackMOBI File "calibre_plugins.kindleunpack_plugin.core.kindleunpack", line 870, in unpackBook File "calibre_plugins.kindleunpack_plugin.core.kindleunpack", line 793, in process_all_mobi_headers File "calibre_plugins.kindleunpack_plugin.core.kindleunpack", line 581, in processMobi7 File "calibre_plugins.kindleunpack_plugin.core.mobi_dict", line 204, in getPositionMap KeyError: 2 |
11-01-2014, 09:48 AM | #1099 | |
Sigil Developer
Posts: 7,637
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi tkeo,
I recently merged a pull request that made those changes. I will checkout the python2and3 branch and fix it to work. And thanks for your patches. I will incorporate them as well. KevinH Quote:
|
|
11-01-2014, 09:54 AM | #1100 | |
Sigil Developer
Posts: 7,637
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi Pop,
Thanks for that bug report. It says that a fileposition does not exist that should. I would really need a copy of the dictionary ( or a sample that exhibits the same issue ) so that I can figure out what might be funny. So please post a url to the problem dictionary or if you would prefer you can privately send me a url via personal messaging on this site (pm KevinH) so that I can track down the error and get it fixed. Thanks, KevinH Quote:
|
|
Advert | |
|
11-01-2014, 10:18 AM | #1101 | |
Grand Sorcerer
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
In light of this, it's probably best to just roll back that last merge entirely. Even separating the gui-helpers from the core unpacking scripts is probably not all that important at this point (and we can easily add that back in later if desired). Last edited by DiapDealer; 11-01-2014 at 10:20 AM. |
|
11-01-2014, 11:01 AM | #1102 |
Sigil Developer
Posts: 7,637
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi DiapDealer,
No need to rollback as I was able to get both to work by adding: Code:
__path__ = ["lib", ".", "kindleunpack"] So no worries. python2and3 via the command line should now work again. KevinH |
11-01-2014, 11:07 AM | #1103 | |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
Quote:
The dictionary is in the last zip attached to this post :https://www.mobileread.com/forums/sho...d.php?t=205634 |
|
11-01-2014, 11:14 AM | #1104 |
Sigil Developer
Posts: 7,637
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi tkeo,
I merged your fixes to target epub3 when Furigana metadata is present. I took the liberty of modifying your python2and3 patch to remove the .keys() since simply testing in metadata will work well with both python2 and python3. Thanks! KevinH |
11-01-2014, 11:30 AM | #1105 | |
Grand Sorcerer
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Was able to sync my fork with your master to pick up that fix, and will begin looking at converting the prefs store from ini to json. |
|
11-01-2014, 11:33 AM | #1106 | |
Sigil Developer
Posts: 7,637
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi PoP,
The error meant that one entry was missing an end position (it did not exist in the tagMap). I think this is caused by your very very last entry in the dictionary not having a proper ending </idx:entry> tag. Here is the snippet of code: Code:
<idx:entry name="word" scriptable="yes"> <h2> <idx:orth>Zvook</idx:orth><idx:key key="Zvook"> </h2> <I>fr:</I> son <I>en:</I> sound <I>ru:</I> звук, zvuk (sound) <div> <img hspace="0" vspace="0" align="middle" src="../Images/sep.gif"/> <table width="100%" bgcolor="#992211"><tr><th widht="100%" height="2px"></th></tr></table> </di\ v> </mbp:frameset> </body> </html> So please try adding the final </idx:entry> tag right before the </mbp:frameset> and recompiling. It should then unpack successfully (I hope!). Please let me know if that does not do the trick. Also, I just noticed that your use of <idx:key> does not seem to have an ending tag either (please check this all throughout your dictionary). If there is no <idx:key> content then it should be self-closed: <idx:key name="blah" /> otherwise there should be a matching ending </idx:key> tag someplace as well for each beginning tag. Take care, KevinH Quote:
Last edited by KevinH; 11-01-2014 at 11:42 AM. Reason: updated on missing ending idx:key as well |
|
11-01-2014, 03:21 PM | #1107 | |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
Quote:
I also more properly self-closed all the idx:key tags. As usual, find the updated dictionary here. |
|
11-02-2014, 07:38 AM | #1108 |
Connoisseur
Posts: 94
Karma: 10
Join Date: Feb 2014
Location: Japan
Device: Kindle PaperWhite, Kobo Aura HD
|
Hi Kevin,
I have made two patches for the python2and3 branch. 1. to unpack AUDI and VIDE sections. As same as the patch posted previously, the AUDI and VIDE sections are unpacked into HDimages. Tags in xhtmls are not linked to unpacked files. It need to change unpacking directory and to make the tags linked. 2. to use OrderedDict in DEBUG mode. Please commit these patches if acceptable. Take care, tkeo |
11-02-2014, 10:00 AM | #1109 |
Sigil Developer
Posts: 7,637
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi tkeo,
The audio video one is broken. According to Amazon publishing guidelines only Mobi 7 support Audio/Video and any audio/video files must be stored in a folder named "audiovideo". So hold off on that. It was never meant to work in the KF8 part. At least not yet, which is why the link/urls were not updated or replaced by proper internal Kindle ones in the KF8 part. BTW: I spent some time looking at audio/video and it seems that in the mobi 7 header, offset 0xe8 which we now call "unknown3" always points to the first record where extra indexes are stored. These extra INDX sections have yet to be decoded. They are related to the audio and video sections and links. Furthermore offset 0xc4 in the mobi 7 header (we refer to this as "unknown0") now seems to have a 1. So we really need to figure out what these extra INDX sections are and how to decode them, what/why the "unknown3" points to them, etc. So there is still too much reverse-engineering to be done before we can support audio/video in the older Mobi 7's. And when we do understand them, the unpacking part is easy and should go into a new folder called "audiovideo" inside the mobi7 folder when unpacked. Take care, KevinH ps. I have committed your DEBUG use of OrderedDict patch. Thank you! Last edited by KevinH; 11-02-2014 at 12:12 PM. |
12-31-2014, 08:44 PM | #1110 |
Zealot
Posts: 128
Karma: 500
Join Date: Aug 2011
Device: kindle, boox
|
Hi, KevinH,
I'm trying to decompress a dictionary generated with kindlegen, the dictionary have inflected forms but kindleunpack didn't notice them. There is a log from kindlegen and i see what's the problem, they put the inflected forms as new definitions but in the same definition, the dictionary works but kindleunpacks fails to decompress. They use somthing like this: Code:
<idx:entry> <idx:orth value="palabra"></idx:orth> <idx:orth value="inflectedform1"></idx:orth> ... <idx:orth value="inflectedform2"></idx:orth> </idx:entry> definición Code:
eu"><a id="sorraríeu"></a></idx:orth> <idx:orth value="sorrat"><a id="sorrat"></a></idx:orth> <idx:orth value="sorrats"><a id="sorrats"></a></idx:orth> <idx:orth value="sorrava"><a id="sorrava"></a></idx:orth> <idx:orth value="sorraven"><a id="sorraven"></a></idx:orth> <idx:orth value="sorraves"><a id="sorraves"></a></idx:orth> <idx:orth value="sorrem"><a id="sorrem"></a></idx:orth> <idx:orth value="sorren"><a id="sorren"></a></idx:orth> <idx:orth value="sorres"><a id="sorres"></a></idx:orth> <idx:orth value="sorressin"><a id="sorressin"></a></idx:orth> <idx:orth value="sorressis"><a id="sorressis"></a></idx:orth> <idx:orth value="sorreu"><a id="sorreu"></a></idx:orth> <idx:orth value="sorri"><a id="sorri"></a></idx:orth> <idx:orth value="sorrin"><a id="sorrin"></a></idx:orth> <idx:orth value="sorris"><a id="sorris"></a></idx:orth> <idx:orth value="sorro"><a id="sorro"></a></idx:orth> <idx:orth value="sorrà"><a id="sorrà"></a></idx:orth> <idx:orth value="sorràrem"><a id="sorràrem"></a></idx:orth> <idx:orth value="sorràreu"><a id="sorràreu"></a></idx:orth> <idx:orth value="sorràvem"><a id="sorràvem"></a></idx:orth> <idx:orth value="sorràveu"><a id="sorràveu"></a></idx:orth> <idx:orth value="sorrés"><a id="sorrés"></a></idx:orth> <idx:orth value="sorréssim"><a id="sorréssim"></a></idx:orth> <idx:orth value="sorréssiu"><a id="sorréssiu"></a></idx:orth> <idx:orth value="sorrí"><a id="sorrí"></a></idx:orth> <p class="lema"><span class="navy"><sup>■</sup></span><span class="navy"><strong>sorrar</strong></span></p><p class="dict"><a href="="= It's possible to handle this kind of dictionaries and unpack all the terms? I can provide the dictionary. Regards Last edited by elchamaco; 12-31-2014 at 08:46 PM. |
|
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 |