apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.38k stars 1.48k forks source link

Calibre plugin for Topaz .tpz ebook / Failed to read book #516

Open ng0177 opened 6 years ago

ng0177 commented 6 years ago

Any suggestions? Thanks!

Traceback (most recent call last): File "/usr/lib64/calibre/calibre/utils/ipc/simple_worker.py", line 283, in main res = {'result':func(*args, **kwargs)} File "/usr/lib64/calibre/calibre/ebooks/oeb/iterator/book.py", line 54, in extract_book plumber = Plumber(pathtoebook, tdir, log, view_kepub=view_kepub) File "/usr/lib64/calibre/calibre/ebooks/conversion/plumber.py", line 752, in init raise ValueError('No plugin to handle input format: '+input_fmt) ValueError: No plugin to handle input format: tpz

ElleKayEm commented 6 years ago

What is this? Part of a log?

ng0177 commented 6 years ago

I attach a screenshot!

On Sat, May 19, 2018 at 8:37 PM, ElleKayEm notifications@github.com wrote:

What is this? Part of a log?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/apprenticeharper/DeDRM_tools/issues/516#issuecomment-390424302, or mute the thread https://github.com/notifications/unsubscribe-auth/Ag8FyrB-eXtcc-dxQOHaHlYUX6uZwMMUks5t0GZtgaJpZM4UFyC- .

ElleKayEm commented 6 years ago

Post a log: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md#i-cannot-solve-my-problem-with-the-dedrm-plugin-and-now-i-need-to-post-a-log-how-do-i-do-that

ng0177 commented 6 years ago

calibre Debug log calibre 3.19 embedded-python: False is64bit: True Linux-4.16.8-300.fc28.x86_64-x86_64-with-fedora-28-Twenty_Eight Linux ('64bit', 'ELF') ('Linux', '4.16.8-300.fc28.x86_64', '#1 SMP Wed May 9 20:23:40 UTC 2018') Python 2.7.15 Linux: ('Fedora', '28', 'Twenty Eight') Interface language: None Successfully initialized third party plugins: DeDRM (6, 6, 0) && Obok DeDRM (6, 5, 4) calibre 3.19 embedded-python: False is64bit: True Linux-4.16.8-300.fc28.x86_64-x86_64-with-fedora-28-Twenty_Eight Linux ('64bit', 'ELF') ('Linux', '4.16.8-300.fc28.x86_64', '#1 SMP Wed May 9 20:23:40 UTC 2018') Python 2.7.15 Linux: ('Fedora', '28', 'Twenty Eight') Interface language: None Successfully initialized third party plugins: DeDRM (6, 6, 0) && Obok DeDRM (6, 5, 4) Turning on automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 144.0 x 144.0 physicalDpi: 122.686792453 x 121.92 Using calibre Qt style: True [0.00] Starting up... [0.00] Showing splash screen... [0.11] splash screen shown [0.11] Initializing db... [0.12] db initialized [0.12] Constructing main UI... DEBUG: 0.0 obok::utilities.py - loading translations DEBUG: 0.0 obok::dialogs.py - loading translations DEBUG: 0.0 obok::config.py - loading translations DEBUG: 0.0 obok::action_err.py - loading translations Looking for desktop notifier support from: org.freedesktop.Notifications org.freedesktop.Notifications found in 0.0 seconds [0.96] main UI initialized... [0.96] Hiding splash screen Gtk-Message: 21:16:48.390: GtkDialog mapped without a transient parent. This is discouraged. DeDRM v6.6.0: Trying to decrypt Fluid Mechanics.tpz Using Library AlfCrypto DLL/DYLIB/SO Decrypting Topaz ebook: Fluid Mechanics Found 0 keys to try after 0.0 seconds DeDRM v6.6.0: Failed to decrypt with error: No key found in 0 keys tried. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md DeDRM v6.6.0: Looking for new default Kindle Key after 0.0 seconds DeDRM v6.6.0: Running kindlekey.py under Wine DeDRM v6.6.0: Command line: 'WINEPREFIX="/home/th6mas" wine python.exe "/home/th6mas/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py" "/home/th6mas/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir"' /bin/sh: wine: command not found DeDRM v6.6.0: Found and decrypted 0 key files DeDRM v6.6.0: Ultimately failed to decrypt after 0.1 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Running file type plugin DeDRM failed with traceback: Traceback (most recent call last): File "/usr/lib64/calibre/calibre/customize/ui.py", line 171, in _run_filetype_plugins nfp = plugin.run(nfp) or nfp File "calibre_plugins.dedrm.init", line 620, in run File "calibre_plugins.dedrm.init", line 570, in KindleMobiDecrypt DeDRMError: DeDRM v6.6.0: Ultimately failed to decrypt after 0.1 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md [36.35] splash screen hidden [36.35] Started up in 36.35 seconds with 1 books Added Fluid Mechanics to db in: 0.1 Added 1 books in 0.5 seconds gio: file:///home/th6mas/Calibre%20Library/Joseph%20Spurk/Fluid%20Mechanics%20(4)/Fluid%20Mechanics%20-%20Joseph%20Spurk.tpz: No application is registered as handling this file gio: file:///home/th6mas/Calibre%20Library/Joseph%20Spurk/Fluid%20Mechanics%20(4)/Fluid%20Mechanics%20-%20Joseph%20Spurk.tpz: No application is registered as handling this file Worker Launch took: 0.0566120147705

ElleKayEm commented 6 years ago

Is the book from an E-ink Kindle? Then you need to enter its serial number into the plugin customization.

ng0177 commented 6 years ago

I downloaded the .tpz to USB from my Kindle Shop. It might have purchased it for the E-ink Kindle. I also own a FIRE HD 7 for which I might have been purchased - does it make a difference? I entered the SN for for the E-ink Kindle and obtain this log:

libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile calibre Debug log calibre 3.21 embedded-python: False is64bit: True Linux-4.15.0-20-generic-x86_64-with-Ubuntu-18.04-bionic Linux ('64bit', '') ('Linux', '4.15.0-20-generic', '#21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018') Python 2.7.15rc1 Linux: ('Ubuntu', '18.04', 'bionic') Interface language: None Successfully initialized third party plugins: DeDRM (6, 6, 0) && Obok DeDRM (6, 5, 4) calibre 3.21 embedded-python: False is64bit: True Linux-4.15.0-20-generic-x86_64-with-Ubuntu-18.04-bionic Linux ('64bit', '') ('Linux', '4.15.0-20-generic', '#21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018') Python 2.7.15rc1 Linux: ('Ubuntu', '18.04', 'bionic') Interface language: None Successfully initialized third party plugins: DeDRM (6, 6, 0) && Obok DeDRM (6, 5, 4) Turning on automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 144.0 x 144.0 physicalDpi: 141.76744186 x 141.402061856 Using calibre Qt style: True [0.00] Starting up... [0.00] Showing splash screen... [0.07] splash screen shown [0.07] Initializing db... [0.08] db initialized [0.08] Constructing main UI... DEBUG: 0.0 obok::utilities.py - loading translations DEBUG: 0.0 obok::dialogs.py - loading translations DEBUG: 0.0 obok::config.py - loading translations DEBUG: 0.0 obok::action_err.py - loading translations Looking for desktop notifier support from: org.freedesktop.Notifications org.freedesktop.Notifications found in 0.0 seconds [0.62] main UI initialized... [0.62] Hiding splash screen Gtk-Message: 11:15:29.109: GtkDialog mapped without a transient parent. This is discouraged. DeDRM v6.6.0: Trying to decrypt Fluid Mechanics.tpz Using Library AlfCrypto DLL/DYLIB/SO Decrypting Topaz ebook: Fluid Mechanics Found 2 keys to try after 0.1 seconds Trying: 1RC1H3C* Trying: pvVOI2q+ DeDRM v6.6.0: Failed to decrypt with error: No key found in 2 keys tried. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md DeDRM v6.6.0: Looking for new default Kindle Key after 0.1 seconds DeDRM v6.6.0: Running kindlekey.py under Wine DeDRM v6.6.0: Command line: 'WINEPREFIX="/home/th6mas" wine python.exe "/home/th6mas/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py" "/home/th6mas/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir"' /bin/sh: 1: wine: not found DeDRM v6.6.0: Found and decrypted 0 key files DeDRM v6.6.0: Ultimately failed to decrypt after 0.1 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Running file type plugin DeDRM failed with traceback: Traceback (most recent call last): File "/usr/lib/calibre/calibre/customize/ui.py", line 171, in _run_filetype_plugins nfp = plugin.run(nfp) or nfp File "calibre_plugins.dedrm.init", line 620, in run File "calibre_plugins.dedrm.init", line 570, in KindleMobiDecrypt DeDRMError: DeDRM v6.6.0: Ultimately failed to decrypt after 0.1 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md [7.57] splash screen hidden [7.57] Started up in 7.57 seconds with 1 books Added Fluid Mechanics to db in: 0.2 Added 1 books in 0.8 seconds gio: file:///home/th6mas/Calibre%20Library/Joseph%20Spurk/Fluid%20Mechanics%20(2)/Fluid%20Mechanics%20-%20Joseph%20Spurk.tpz: No application is registered as handling this file gio: file:///home/th6mas/Calibre%20Library/Joseph%20Spurk/Fluid%20Mechanics%20(2)/Fluid%20Mechanics%20-%20Joseph%20Spurk.tpz: No application is registered as handling this file libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile Worker Launch took: 0.121009111404

ElleKayEm commented 6 years ago

Download it again and be sure to choose your E-ink Kindle as the device, not the Fire.

ng0177 commented 6 years ago

I followed these steps closly: 1) download again, run wizard and selected "Kindle (basic)" 2) installed both plugins 3) entered the E-ink Kindle 4) remove book, restart and add book. The removal still fails and the above log does not change. BTW the device is not recoreded in the log. Any ideas?

Running file type plugin DeDRM failed with traceback: Traceback (most recent call last): File "/usr/lib/calibre/calibre/customize/ui.py", line 171, in _run_filetype_plugins nfp = plugin.run(nfp) or nfp File "calibre_plugins.dedrm.init", line 620, in run File "calibre_plugins.dedrm.init", line 570, in KindleMobiDecrypt

ElleKayEm commented 6 years ago

Make sure you have your serial number entered correctly. Try copy and paste from your content and device page at Amazon (removing any spaces).

ng0177 commented 6 years ago

Yep, that is precisely what I previously did...

ElleKayEm commented 6 years ago

Alright, seems like this is something that @ApprenticeHarper will need to look at.

Are you able to remove DRM from other Kindle books?

ng0177 commented 6 years ago

Yes, please. Appreciate your swift responses! Good thought: I purchased another e-book from amazon in .azw4 format and a similar error occurs. I wonder, if the problem is related to Linux.

libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile DBusExport: Failed to detect window status notifier, with error: org.freedesktop.DBus.Error.UnknownMethod: No such interface 'org.freedesktop.DBus.Properties' on object at path /StatusNotifierWatcher calibre Debug log calibre 3.21 embedded-python: False is64bit: True Linux-4.15.0-20-generic-x86_64-with-Ubuntu-18.04-bionic Linux ('64bit', '') ('Linux', '4.15.0-20-generic', '#21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018') Python 2.7.15rc1 Linux: ('Ubuntu', '18.04', 'bionic') Interface language: None Successfully initialized third party plugins: DeDRM (6, 6, 0) && Obok DeDRM (6, 5, 4) calibre 3.21 embedded-python: False is64bit: True Linux-4.15.0-20-generic-x86_64-with-Ubuntu-18.04-bionic Linux ('64bit', '') ('Linux', '4.15.0-20-generic', '#21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018') Python 2.7.15rc1 Linux: ('Ubuntu', '18.04', 'bionic') Interface language: None Successfully initialized third party plugins: DeDRM (6, 6, 0) && Obok DeDRM (6, 5, 4) Turning on automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 144.0 x 144.0 physicalDpi: 123.385199241 x 123.567567568 Using calibre Qt style: True [0.00] Starting up... [0.01] Showing splash screen... [0.10] splash screen shown [0.10] Initializing db... [0.10] db initialized [0.10] Constructing main UI... DEBUG: 0.0 obok::utilities.py - loading translations DEBUG: 0.0 obok::dialogs.py - loading translations DEBUG: 0.0 obok::config.py - loading translations DEBUG: 0.0 obok::action_err.py - loading translations Looking for desktop notifier support from: org.freedesktop.Notifications org.freedesktop.Notifications found in 0.0 seconds [0.61] main UI initialized... [0.61] Hiding splash screen Gtk-Message: 16:13:32.123: GtkDialog mapped without a transient parent. This is discouraged. DeDRM v6.6.0: Trying to decrypt Grundlagen der Technischen Mechanik (German Edition).azw4 Using Library AlfCrypto DLL/DYLIB/SO MobiDeDrm v0.42. Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al. Decrypting Mobipocket 4 ebook: Grundlagen der Technischen Mechanik (German Edition) Found 2 keys to try after 0.1 seconds Crypto Type is: 2 DeDRM v6.6.0: Failed to decrypt with error: No key found in 2 keys tried. DeDRM v6.6.0: Looking for new default Kindle Key after 0.1 seconds DeDRM v6.6.0: Running kindlekey.py under Wine DeDRM v6.6.0: Command line: 'WINEPREFIX="/home/th6mas" wine python.exe "/home/th6mas/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py" "/home/th6mas/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir"' 0012:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046} 0012:err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa} 0012:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002 0012:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002 0012:err:ole:get_local_server_stream Failed: 80004002 0014:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046} 0014:err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa} 0014:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002 0014:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002 0014:err:ole:get_local_server_stream Failed: 80004002 [3.20] splash screen hidden [3.20] Started up in 3.20 seconds with 1 books Could not load wine-gecko. HTML rendering will be disabled. Could not load wine-gecko. HTML rendering will be disabled. wine: configuration in '/home/th6mas' has been updated. wine: cannot find L"C:\windows\system32\python.exe" DeDRM v6.6.0: Found and decrypted 0 key files DeDRM v6.6.0: Ultimately failed to decrypt after 20.6 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Running file type plugin DeDRM failed with traceback: Traceback (most recent call last): File "/usr/lib/calibre/calibre/customize/ui.py", line 171, in _run_filetype_plugins nfp = plugin.run(nfp) or nfp File "calibre_plugins.dedrm.init", line 620, in run File "calibre_plugins.dedrm.init", line 570, in KindleMobiDecrypt DeDRMError: DeDRM v6.6.0: Ultimately failed to decrypt after 20.6 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile Added Grundlagen der Technischen Mechanik (German Edition) to db in: 0.1 Added 1 books in 21.0 seconds

ElleKayEm commented 6 years ago

It still doesn't seem to have the right key. This was also for your Kindle, and you've entered its serial number into the E-ink Kindle section of the plugin customization?

ng0177 commented 6 years ago

I download it from the Kindle Shop "for USB". The two conversions I tried are:

Book1.tpz: wizard: Kindle (all models) w/ E-Ink Kindle key Book2.awz4: wizard: Fire w/ E-Ink Kindle key

I can let @apprenticeharper have books and keys for debugging only, if required.

ElleKayEm commented 6 years ago

When you download it for transfer for USB be sure to choose your E-ink Kindle, not the Fire. We cannot DeDRM books for Fires. And if you have more than one E-ink Kindle, choose the right one or add all their serial numbers. The books are keyed to a specific Kindle.

I don't know what you're referring to when you say "wizard". In the DeDRM plugin customization, you should see an "eInk Kindle ebooks" button. And that's where you enter the serial number, not either of the other types of Kindle keys.

ng0177 commented 6 years ago

I think we solved the problem for Book1.tpz: it was previously not USB-exported for the E-ink Kindle. DeDRM is working! Thank you for being persistent. I was referring to the calibre wizard.

Can I file a feature request for Book2.awz4 USB-exported for Fire to be DeDRMed in a future release?

ElleKayEm commented 6 years ago

No one has figured out how to get the keys for Fires. They aren't tied to their serial numbers.

You should be able to DeDRM the other book too. Just choose your E-ink Kindle when downloading from your content and devices page at Amazon.

(Only calibre wizard I'm familiar with is the one that runs the very first time you install it.)

ng0177 commented 6 years ago

The download for E-ink Kindle is unfortunately deactived / greyed out for the other book.

(The first time calibre wizard may be restarted from the preferences drop down menu).

Thanks again for all your help and patience!

ElleKayEm commented 6 years ago

Well, that's too bad. I'm surprised it's not available. The only other possibility is downloading to Kindle for PC. But that is tough to get working on Linux.

(You don't really need to run that wizard when plugging in different devices.)

ng0177 commented 6 years ago

It looks like https://www.epubor.com/drm-removal-tools.html can do the trick...

(Thanks for the hint!)

ElleKayEm commented 6 years ago

Epubor is based on these tools.

ng0177 commented 6 years ago

The prerequiste for Epubor is the "Kindle for PC" exe which downloads .azw instead of .azw4 for USB; this might make a difference. I shall give it a try tomorrow.

ElleKayEm commented 6 years ago

Kindle for PC gives all its book files the generic AZW extension, regardless of underlying format. Epubor can't remove DRM from anything that these tools can't. They've built it from these tools. Just a different UI and not free.

ng0177 commented 6 years ago

Alright. Any ideas how to proceed?

ElleKayEm commented 6 years ago

Haven't done it myself. But you'd need to install Kindle for PC under Wine.

xomix commented 6 years ago

Log says wine cannot find python. Have you python 2.7 installed in wine? And pcrypto?

ng0177 commented 6 years ago

I found this https://www.bountysource.com/issues/29460102-wine-cannot-find-l-c-windows-system32-python-exe but it seems too tough for me.

To summarize: the .azw4 for USB book requires for Linux python 2.7 / pcrypto under wine which is probably available under Window and for which reason Epubor can DeDRM it.

ElleKayEm commented 6 years ago

It's tough but certainly possible to get DeDRM working with Kindle for PC on Linux. Really, really easy to setup on Windows.