apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.52k stars 1.51k forks source link

Kindle for PC and 'print replica' books - no error but corrupt text #2042

Closed Hecatron closed 2 years ago

Hecatron commented 2 years ago

Hi, so I recently tried converting a book under calibre I'm using the latest calibre and ddrm versions From what I can gather it's a "print replica" book, in that inside kindle you can't alter the font / size etc. I downgraded the kindle for windows app to 1.34.1 then used the special batch file to get around the kfx issue The type of file shows up as Mobi The front image looks fine, metadata is fine, but the text is all corrupted. Things work fine for other books which are not "print replica" ones

There doesn't seem to be an error which is interesting in the log

One interesting thing I noticed is that the print replica books seem more readable when zoomed right in on the windows kindle app while using the older version of the windows kindle app. With the more recent kindle version, the page jumps about with moving the mouse over sections which I suspect is a bug related to that new crappy kfx standard, which is why I tried to use calibre.

My Environment

Calibre: 5.39.1

Kindle: 1.34.1

DeDRM: 7.2.1

Log

Log Title ```log calibre Debug log calibre 5.39.1 embedded-python: True is64bit: False Windows-10-10.0.19041 Windows ('32bit', 'WindowsPE') 32bit process running on 64bit windows ('Windows', '10', '10.0.19041') Python 3.8.5 Windows: ('10', '10.0.19041', '', 'Multiprocessor Free') Interface language: en_GB Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 47, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 47, 0) && KFX metadata reader (from KFX Input) (1, 47, 0) && KFX Input (1, 47, 0) calibre 5.39.1 embedded-python: True is64bit: False Windows-10-10.0.19041 Windows ('32bit', 'WindowsPE') 32bit process running on 64bit windows ('Windows', '10', '10.0.19041') Python 3.8.5 Windows: ('10', '10.0.19041', '', 'Multiprocessor Free') Interface language: en_GB Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 47, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 47, 0) && KFX metadata reader (from KFX Input) (1, 47, 0) && KFX Input (1, 47, 0) Turning on automatic hidpi scaling devicePixelRatio: 3.0 logicalDpi: 96.0 x 96.0 physicalDpi: 85.33333333333333 x 85.45794392523364 Using calibre Qt style: True [0.00] Starting up... [0.00] Showing splash screen... [0.34] splash screen shown [0.34] Initializing db... [0.34] db initialized [0.34] Constructing main UI... [0.83] main UI initialized... [0.83] Hiding splash screen Starting QuickView Gather KFX-ZIP (from KFX Input) 1.47.0: Importing C:\Users\xxx\Documents\My Kindle Content\B07LD48CTV_EBOK\B07LD48CTV_EBOK.azw Gather KFX-ZIP (from KFX Input): File is not KFX format DeDRM v7.2.1: Trying to decrypt B07LD48CTV_EBOK.azw Using Library AlfCrypto DLL/DYLIB/SO Using Library AlfCrypto DLL/DYLIB/SO MobiDeDrm v1.0. Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al. Decrypting Mobipocket 4 ebook: Designing Video Game Hardware in Verilog Got DSN key from database default_key Found 4 keys to try after 0.1 seconds Crypto Type is: 2 File is encoded with PID 0u1jPzrDFN. Decrypting. Please wait . . . . . . . . . done Decryption succeeded after 0.2 seconds DeDRM v7.2.1: Finished after 0.2 seconds [41.97] splash screen hidden [41.97] Started up in 41.97 seconds with 5 books stdout+stderr from file dialog helper: [b'', b''] piped data from file dialog helper: [b'\x05F\x86\xf80\x02=J\xbaG\x890\x10\xde\x991Ww#i\x9f%\x90qMcL"\xf6"Z0', b'C:\\Users\\xxx\\Documents\\My Kindle Content\\B07LD48CTV_EBOK\\B07LD48CTV_EBOK.azw'] Added Designing Video Game Hardware in Verilog to db in: 0.2 Added 1 books in Worker Launch took: 0.00 seconds ```
Hecatron commented 2 years ago

Ok so I just figured this out The solution was to install the KindleUnpack plugin Then run that to extract the book as a pdf

Now it reads fine :)

ElleKayEm commented 2 years ago

This is bug in DeDRM. The file is actually a pdf in a mobi wrapper. Use the KindleUnpack plugin to extract the pdf.

ElleKayEm commented 2 years ago

Oops, looks like we cross-posted. Glad you figured it out.