Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on unpacking dictionary #11

Open
wjdp opened this issue Jan 2, 2016 · 6 comments
Open

Error on unpacking dictionary #11

wjdp opened this issue Jan 2, 2016 · 6 comments

Comments

@wjdp
Copy link

wjdp commented Jan 2, 2016

Attempting to unpack GOTDict.mobi from http://keckrew.blogspot.co.uk/2013/06/game-of-thrones-kindle-dictionary.html yields:

Conversion Log 

Input Path = "/home/will/Downloads/GOTDict.mobi"
Output Path = "/home/will/local/KindleUnpack/got"
Epub Output Type Set To: ePub 2


Please Wait ...

Palm DB type: BOOKMOBI, 395 sections.
Unpacking a Mobipocket 6 book...
Processing Mobipocket 6 section of book...
Mobi Version: 6
Codec: windows-1252
Title: Game of Thrones Dictionary
Palmdoc compression
Unpacking images, resources, fonts, etc
Extracting image: image00267.jpeg from section 267
Extracting image: image00268.jpeg from section 268
Extracting image: image00269.jpeg from section 269
Extracting image: image00270.jpeg from section 270
Extracting image: image00271.jpeg from section 271
Extracting image: image00272.jpeg from section 272
Extracting image: image00273.jpeg from section 273
Extracting image: image00274.jpeg from section 274
Extracting image: image00275.jpeg from section 275
Extracting image: image00276.jpeg from section 276
Extracting image: image00277.jpeg from section 277
Extracting image: image00278.jpeg from section 278
Extracting image: image00279.jpeg from section 279
Extracting image: image00280.jpeg from section 280
Extracting image: image00281.jpeg from section 281
Extracting image: image00282.jpeg from section 282
Extracting image: image00283.jpeg from section 283
Extracting image: image00284.jpeg from section 284
Extracting image: image00285.jpeg from section 285
Extracting image: image00286.jpeg from section 286
Extracting image: image00287.jpeg from section 287
Extracting image: image00288.jpeg from section 288
Extracting image: image00289.jpeg from section 289
Extracting image: image00290.jpeg from section 290
Extracting image: image00291.jpeg from section 291
Extracting image: image00292.jpeg from section 292
Extracting image: image00293.jpeg from section 293
Extracting image: image00294.jpeg from section 294
Extracting image: image00295.jpeg from section 295
Extracting image: image00296.jpeg from section 296
Extracting image: image00297.jpeg from section 297
Extracting image: image00298.jpeg from section 298
Extracting image: image00299.jpeg from section 299
Extracting image: image00300.jpeg from section 300
Extracting image: image00301.jpeg from section 301
Extracting image: image00302.jpeg from section 302
Extracting image: image00303.jpeg from section 303
Extracting image: image00304.jpeg from section 304
Extracting image: image00305.jpeg from section 305
Extracting image: image00306.jpeg from section 306
Extracting image: image00307.jpeg from section 307
Extracting image: image00308.jpeg from section 308
Extracting image: image00309.jpeg from section 309
Extracting image: image00310.jpeg from section 310
Extracting image: image00311.jpeg from section 311
Extracting image: image00312.jpeg from section 312
Extracting image: image00313.jpeg from section 313
Extracting image: image00314.jpeg from section 314
Extracting image: image00315.jpeg from section 315
Extracting image: image00316.jpeg from section 316
Extracting image: image00317.jpeg from section 317
Extracting image: image00318.jpeg from section 318
Extracting image: image00319.jpeg from section 319
Extracting image: image00320.jpeg from section 320
Extracting image: image00321.jpeg from section 321
Extracting image: image00322.jpeg from section 322
Extracting image: image00323.jpeg from section 323
Extracting image: image00324.jpeg from section 324
Extracting image: image00325.jpeg from section 325
Extracting image: image00326.jpeg from section 326
Extracting image: image00327.jpeg from section 327
Extracting image: image00328.jpeg from section 328
Extracting image: image00329.jpeg from section 329
Extracting image: image00330.jpeg from section 330
Extracting image: image00331.jpeg from section 331
Extracting image: image00332.jpeg from section 332
Extracting image: image00333.jpeg from section 333
Extracting image: image00334.jpeg from section 334
Extracting image: image00335.jpeg from section 335
Extracting image: image00336.jpeg from section 336
Extracting image: image00337.jpeg from section 337
Extracting image: image00338.jpeg from section 338
Extracting image: image00339.jpeg from section 339
Extracting image: image00340.jpeg from section 340
Extracting image: image00341.jpeg from section 341
Extracting image: image00342.jpeg from section 342
Extracting image: image00343.jpeg from section 343
Extracting image: image00344.jpeg from section 344
Extracting image: image00345.jpeg from section 345
Extracting image: image00346.jpeg from section 346
Extracting image: image00347.jpeg from section 347
Extracting image: image00348.jpeg from section 348
Extracting image: image00349.jpeg from section 349
Extracting image: image00350.jpeg from section 350
Extracting image: image00351.jpeg from section 351
Extracting image: image00352.jpeg from section 352
Extracting image: image00353.jpeg from section 353
Extracting image: image00354.jpeg from section 354
Extracting image: image00355.jpeg from section 355
Extracting image: image00356.jpeg from section 356
Extracting image: image00357.jpeg from section 357
Extracting image: image00358.jpeg from section 358
Extracting image: image00359.jpeg from section 359
Extracting image: image00360.jpeg from section 360
Extracting image: image00361.jpeg from section 361
Extracting image: image00362.jpeg from section 362
Extracting image: image00363.jpeg from section 363
Extracting image: image00364.jpeg from section 364
Extracting image: image00365.jpeg from section 365
Extracting image: image00366.jpeg from section 366
Extracting image: image00367.jpeg from section 367
Extracting image: image00368.jpeg from section 368
Extracting image: image00369.jpeg from section 369
Extracting image: image00370.jpeg from section 370
Extracting image: image00371.jpeg from section 371
Extracting image: image00372.jpeg from section 372
Extracting image: image00373.jpeg from section 373
Extracting image: image00374.jpeg from section 374
Extracting image: image00375.jpeg from section 375
Extracting image: image00376.jpeg from section 376
Extracting image: image00377.jpeg from section 377
Extracting image: image00378.jpeg from section 378
Extracting image: image00379.jpeg from section 379
Extracting image: image00380.jpeg from section 380
Extracting image: image00381.jpeg from section 381
Extracting image: image00382.jpeg from section 382
Extracting image: image00383.jpeg from section 383
Extracting image: image00384.jpeg from section 384
Extracting image: image00385.jpeg from section 385
Extracting image: image00386.jpeg from section 386
Extracting image: image00387.jpeg from section 387
Extracting image: image00388.jpeg from section 388
Extracting image: image00389.jpeg from section 389
Extracting image: image00390.jpeg from section 390
Unpacking raw markup language
Write ncx
Info: Document contains orthographic index, handle as dictionary

Parsing metaOrthIndex
orthIndexCount is 2
Read dictionary index data
Error: 2
Traceback (most recent call last):
  File "KindleUnpack.pyw", line 370, in unpackEbook
    kindleunpack.unpackBook(infile, outdir, apnxfile, epubversion, use_hd, dodump=dump, dowriteraw=writeraw, dosplitcombos=splitcombos)
  File "/home/will/local/KindleUnpack/lib/kindleunpack.py", line 919, in unpackBook
    process_all_mobi_headers(files, apnxfile, sect, mhlst, K8Boundary, False, epubver, use_hd)
  File "/home/will/local/KindleUnpack/lib/kindleunpack.py", line 840, in process_all_mobi_headers
    processMobi7(mh, metadata, sect, files, rscnames)
  File "/home/will/local/KindleUnpack/lib/kindleunpack.py", line 623, in processMobi7
    positionMap = dictSupport(mh, sect).getPositionMap()
  File "lib/mobi_dict.py", line 218, in getPositionMap
    assert len(tagMap[0x02]) == 1
KeyError: 2



Error: Unpacking Failed
@Yao-DY
Copy link

Yao-DY commented Dec 3, 2020

Have you solved this problem? I have encountered a similar problem to yours. Reported errors when unpacking an dictionary.
The following is the error message.

Palm DB type: BOOKMOBI, 38548 sections.
Unpacking a Mobipocket 7 book...
Processing Mobipocket 7 section of book...
Mobi Version: 7
Codec: utf-8
Title: 汉典
Palmdoc compression
Unpacking images, resources, fonts, etc
Extracting image: cover38542.gif from section 38542
Extracting image: image38543.jpeg from section 38543
Unpacking raw markup language
Write ncx
Info: Document contains orthographic index, handle as dictionary

Parsing metaOrthIndex
orthIndexCount is 106
orth entry uses ordt2 lookup table of type 0
Read dictionary index data
Error: 2
Traceback (most recent call last):
File "F:\kindle\KindleUnpack\KindleUnpack.pyw", line 370, in unpackEbook
kindleunpack.unpackBook(infile, outdir, apnxfile, epubversion, use_hd, dodump=dump, dowriteraw=writeraw, dosplitcombos=splitcombos)
File "F:\kindle\KindleUnpack\lib\kindleunpack.py", line 923, in unpackBook
process_all_mobi_headers(files, apnxfile, sect, mhlst, K8Boundary, False, epubver, use_hd)
File "F:\kindle\KindleUnpack\lib\kindleunpack.py", line 844, in process_all_mobi_headers
processMobi7(mh, metadata, sect, files, rscnames)
File "F:\kindle\KindleUnpack\lib\kindleunpack.py", line 627, in processMobi7
positionMap = dictSupport(mh, sect).getPositionMap()
File "lib\mobi_dict.py", line 218, in getPositionMap
assert len(tagMap[0x02]) == 1
KeyError: 2

@kevinhendricks
Copy link
Owner

No, and I can not as dictionaries in some of the older formats have never been reverse engineered.
Without examples to work from and the correct before and after html to see, reversing an older dictionary in a language you do not speak is next to impossible.

If this is a project you want to take on I would supply whatever help I could.

@kevinhendricks
Copy link
Owner

There was an older c based mobi library that did have somewhat better dictionary support. You may still be able to find it on the web.

@Yao-DY
Copy link

Yao-DY commented Dec 3, 2020

There was an older c based mobi library that did have somewhat better dictionary support. You may still be able to find it on the web.

Thank you for tell me.
Do you mean "mobi library" a program (or script)?Can you tell me its name by the way. I searched "c based mobi library" on Bing but didn't find any useful information.
Finally, let me express my thanks again.

@kevinhendricks
Copy link
Owner

You might search for "libmobi" on github. It was about 5 years back I saw it though. Perhaps you can find a fork that still exists.

@Yao-DY
Copy link

Yao-DY commented Dec 3, 2020

You might search for "libmobi" on github. It was about 5 years back I saw it though. Perhaps you can find a fork that still exists.

Thank you so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@wjdp @kevinhendricks @Yao-DY and others