noDRM / DeDRM_tools

DeDRM tools for ebooks
7.34k stars 323 forks source link

Plugin does absolutely nothing (log from debug mode below) #545

Open LeyviRose opened 6 months ago

LeyviRose commented 6 months ago

Question / bug report

Hello, I downloaded the plugin and added it to Calibre, along with KFX input. It didn't seem to do anything when I added an AZW3 file, so I tried again in debug mode. I hope this is useful.

Which version of Calibre are you running?

7.9

Which version of the DeDRM plugin are you running?

10.0.9

If applicable, which version of the Kindle software are you running?

No response

Log output

Using calibre Qt style: True
qt.gui.imageio: libpng warning: iCCP: known incorrect sRGB profile
calibre Debug log
calibre 7.9  embedded-python: False
Linux-6.8.7-gentoo-x86_64-AMD_Ryzen_9_7900X_12-Core_Processor-with-glibc2.39 Linux ('64bit', 'ELF')
('Linux', '6.8.7-gentoo', '#1 SMP PREEMPT Fri Apr 19 18:23:57 IDT 2024')
Python 3.11.9
Interface language: None
EXE path: /usr/bin/python3.11
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (2, 10, 0) && DeDRM (10, 0, 9) && Package KFX (from KFX Input) (2, 10, 0) && KFX metadata reader (from KFX Input) (2, 10, 0) && From KFX (2, 10, 0) && KFX Input (2, 10, 0) && Set KFX metadata (from KFX Output) (2, 7, 0) && KFX Output (2, 7, 0)
calibre 7.9  embedded-python: False
Linux-6.8.7-gentoo-x86_64-AMD_Ryzen_9_7900X_12-Core_Processor-with-glibc2.39 Linux ('64bit', 'ELF')
('Linux', '6.8.7-gentoo', '#1 SMP PREEMPT Fri Apr 19 18:23:57 IDT 2024')
Python 3.11.9
Interface language: None
EXE path: /usr/bin/python3.11
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (2, 10, 0) && DeDRM (10, 0, 9) && Package KFX (from KFX Input) (2, 10, 0) && KFX metadata reader (from KFX Input) (2, 10, 0) && From KFX (2, 10, 0) && KFX Input (2, 10, 0) && Set KFX metadata (from KFX Output) (2, 7, 0) && KFX Output (2, 7, 0)
QPA platform: wayland
devicePixelRatio: 1.0
logicalDpi: 96.0 x 96.0
physicalDpi: 109.21999999999998 x 107.5764705882353
[0.00] Starting up...
[0.00] Showing splash screen...
[1.02] splash screen shown
[1.02] Initializing db...
[1.07] db initialized
[1.07] Constructing main UI...
[1.39] GUI main window shown
[1.40] main UI initialized...
[1.40] Hiding splash screen
[1.40] splash screen hidden
[1.40] Started up in 1.40 seconds with 1 books
PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
DeDRM v10.0.9: Trying to decrypt The Lottery and Other Stories (FSG Classics).azw3
Running file type plugin DeDRM failed with traceback:
Traceback (most recent call last):
  File "/home/leyvi/.config/calibre/plugins/DeDRM.zip/androidkindlekey.py", line 38, in <module>
    from Cryptodome.Cipher import AES, DES
  File "/usr/lib64/calibre/calibre/constants.py", line 221, in find_spec
    return ModuleSpec(fullname, DeVendorLoader(fullname.replace('dome', '', 1)))
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/calibre/calibre/constants.py", line 190, in __init__
    self.aliased_module = import_module(aliased_name)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'Crypto'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/calibre/calibre/customize/ui.py", line 199, in _run_filetype_plugins
    nfp = plugin.run(nfp) or nfp
          ^^^^^^^^^^^^^^^
  File "calibre_plugins.dedrm.__init__", line 1030, in run
    decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "calibre_plugins.dedrm.__init__", line 918, in KindleMobiDecrypt
    import k4mobidedrm
  File "/home/leyvi/.config/calibre/plugins/DeDRM.zip/k4mobidedrm.py", line 107, in <module>
    import androidkindlekey
  File "/home/leyvi/.config/calibre/plugins/DeDRM.zip/androidkindlekey.py", line 40, in <module>
    from Crypto.Cipher import AES, DES
ModuleNotFoundError: No module named 'Crypto'
Added The Lottery and Other Stories (FSG Classics) to db in: 0.4
Added 1 books in 0.6 seconds
Path override failed for key base::DIR_APP_DICTIONARIES and path '/usr/bin/qtwebengine_dictionaries'
Path override failed for key base::DIR_APP_DICTIONARIES and path '/usr/lib64/qt6/libexec/qtwebengine_dictionaries'
Path override failed for key base::DIR_APP_DICTIONARIES and path '/usr/lib64/qt6/libexec/qtwebengine_dictionaries'
Worker Launch took: 0.00 seconds
Device 0 (VID=18d1 and PID=4ee1) is a Google Inc Nexus/Pixel (MTP).
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
ElleKayEm commented 6 months ago

ModuleNotFoundError: No module named 'Crypto'

If you use the official Linux calibre, you won't run into this error.

https://calibre-ebook.com/download_linux

If this book is from or for an E-ink Kindle (not a Fire), be sure you have that Kindle's serial number entered correctly into DeDRM's customization.

LeyviRose commented 6 months ago

Ah... I installed Calibre using Portage. I will install it from the website instead. Thanks for the tip!

Also, how do I use the DeDRM customization settings? Some sort of configuration file? Or a setting in Calibre?

On May 4, 2024 7:47:49 PM UTC, ElleKayEm @.***> wrote:

ModuleNotFoundError: No module named 'Crypto'

If you use the official Linux calibre, you won't run into this error.

https://calibre-ebook.com/download_linux

If this book is from or for an E-ink Kindle (not a Fire), be sure you have that Kindle's serial number entered correctly into DeDRM's customization.

-- Reply to this email directly or view it on GitHub: https://github.com/noDRM/DeDRM_tools/issues/545#issuecomment-2094360874 You are receiving this because you authored the thread.

Message ID: @.***> Sent by Leyvi on GrapheneOS.

ElleKayEm commented 6 months ago

In calibre, Preferences > Plugins. Then select DeDRM under File type and press the Customize plugin button. Then eInk Kindle ebooks and click the green plus sign. Enter your serial number. Then ok and apply your way back out and restart calibre.

ElleKayEm commented 5 months ago

No, that's just a method if you do have an E-ink Kindle. Otherwise, you can use Kindle for PC or Kindle Classic for Mac. It's also possible to use an older version of Kindle for Android.

https://www.mobileread.com/forums/showthread.php?t=361503

On Sat, Jun 8, 2024, 12:09 AM Jatts @.***> wrote:

So the only way to remove DRM is to go out and buy a physical Kindle, which is the only way to have a serial number? What.

— Reply to this email directly, view it on GitHub https://github.com/noDRM/DeDRM_tools/issues/545#issuecomment-2155798143, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYUWTMSTYAZXC4DREWBE6LZGJ7WDAVCNFSM6AAAAABHHBXCQ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJVG44TQMJUGM . You are receiving this because you commented.Message ID: @.***>

Jatts-Art commented 5 months ago

No, that's just a method if you do have an E-ink Kindle. Otherwise, you can use Kindle for PC or Kindle Classic for Mac. It's also possible to use an older version of Kindle for Android. https://www.mobileread.com/forums/showthread.php?t=361503

I'd download the book using Kindle PC... and then on the Calibre side of things the file is labeled as "AZW" with a blank cover, and it simply refuses to convert it nor can it read it. The error says it is KFX, even though it is tagged as AZW, which is also strange.

39fbc70ea3ca1e30eeddbcac3bac2232

This is even the case for past older books, where I had done this before flawlessly, but now those give me the same problems too. Calibre is completely up-to-date... I've tried latest versions of both DeDRM & KFX Output... neither of those work (KFX Output in particular doesn't even seem to try.

Then I tried old versions of Kindle PC, linked in that thread, and I'd redownload the book and redo the process... results in the same exact outcome of not being able to read/convert within Calibre. Next I tried even older versions of Kindle PC, it gets to the point where I literally cannot login because the CAPTCHA code is a broken image that I cannot see.

Lastly, not sure how important this is, but I am specifically trying to convert content from Amazon.jp (Japanese). But I've done this for many years in the past without any problems. I am definitely not purchasing any physical Kindles, even if cheap, if this was never a problem before for me in the past... which was only about 3 to 5 years ago.

ElleKayEm commented 5 months ago

DeDRM 10.0.9 and KFX Input, not Output.

Jatts-Art commented 5 months ago

DeDRM 10.0.9 and KFX Input, not Output.

Oh interesting, tbh i thought it would be both. I'll try to search for the KFX Input version then, thanks for pointing that out.

ElleKayEm commented 5 months ago

If you wanted to convert another format into KFX, that's what you'd want KFX Output for.