Leseratte10 / acsm-calibre-plugin

Calibre plugin for ACSM->EPUB and ACSM->PDF conversion.
https://www.mobileread.com/forums/showthread.php?t=341975
GNU General Public License v3.0
593 stars 23 forks source link

DeACSM fails with exception "Running file type plugin failed" #78

Closed spicyllamas closed 5 months ago

spicyllamas commented 5 months ago

Bug description

I just installed this plugin and am getting this exception which happens when importing (drag and dropping) acsms into Calibre. I tested with both PDF and EPUB including a test one from the Adobe site. The book gets imported into Calibre but is still locked. I'm using an anonymous authorization.

Here's the debug log with error:

calibre 7.1  embedded-python: True
Linux-6.5.6-76060506-generic-x86_64-with-glibc2.35 Linux ('64bit', 'ELF')
('Linux', '6.5.6-76060506-generic', '#202310061235~1697396945~22.04~9283e32 SMP PREEMPT_DYNAMIC Sun O')
Python 3.11.5
Interface language: None
Successfully initialized third party plugins: DeACSM (0, 0, 16) && DeDRM (10, 0, 3)
QPA platform: xcb
devicePixelRatio: 1.0
logicalDpi: 96.0 x 96.0
physicalDpi: 124.83276450511946 x 124.69090909090909
ApplicationPaletteChange event ignored
Using calibre Qt style: True
[0.00] Starting up...
[0.00] Showing splash screen...
[0.09] splash screen shown
[0.09] Initializing db...
[0.12] db initialized
[0.12] Constructing main UI...
[0.61] main UI initialized...
[0.61] Hiding splash screen
Starting QuickView
[0.80] splash screen hidden
[0.80] Started up in 0.80 seconds with 7 books
DeACSM v0.0.16: Trying to parse file BookName.acsm
DeACSM v0.0.16: Try to fulfill ...
Notifying server ...
Notifying server https://acsepub.contentreserve.com/fulfillment/FulfillmentNotification
Fulfillment notification successful.
Notifying optional server https://ofs.contentreserve.com/ACSNotificationService.svc/Notify
Weird Fulfillment Notification response: 
DeACSM v0.0.16: Downloading book ...
DeACSM v0.0.16: Loading book from https://acs.cdn.overdrive.com/ACSStore1/1785-1/FF3/44A/0C/{FF344A0C-4C5D-4ABB-8787-4870C576F932}Fmt410.epub
Download took 456 ms (HTTP 200)
That's a ZIP file -> EPUB
DeACSM v0.0.16: File successfully fulfilled ...
DeACSM v0.0.16: Executing plugin DeDRM ...
DeDRM v10.0.3: Trying to decrypt iny0r4dt.epub
DeDRM v10.0.3: Verifying zip archive integrity
DeDRM v10.0.3: iny0r4dt.epub is a secure Adobe Adept ePub for UUID b1e22a4f-d259-44f6-adb6-07955e39f00e
DeACSM v0.0.16: Running file type plugin failed with traceback:
Traceback (most recent call last):
  File "encodings/hex_codec.py", line 19, in hex_decode
ValueError: string argument should contain only ASCII characters

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "calibre_plugins.deacsm.__init__", line 486, in run
    plugin_ret = plugin.run(rpl)
                 ^^^^^^^^^^^^^^^
  File "calibre_plugins.dedrm.__init__", line 1067, in run
    decrypted_ebook = self.ePubDecrypt(path_to_ebook)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "calibre_plugins.dedrm.__init__", line 533, in ePubDecrypt
    userkey = codecs.decode(userkeyhex, 'hex')
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: decoding with 'hex' codec failed (ValueError: string argument should contain only ASCII characters)
DeACSM v0.0.16: Plugin returned nothing - skipping
Added An Autobiography to db in: 0.1
Added 1 books in 16.6 seconds

Operating system

Linux

Which version of Calibre are you running?

7.1 and 7.2

Which version of the ACSM Input plugin are you running?

v0.0.16

Import type

Dragging-and-Dropping the ACSM file into the Calibre window

Further information

No response

Leseratte10 commented 5 months ago

This is not a bug with my plugin but a bug/issue with the DRM removal plugin. Try updating that to 10.0.9, or uninstall and re-install it and see if that helps. If it doesn't, please open a bug report in their repository.

spicyllamas commented 5 months ago

@Leseratte10 Deleting the auto-imported ACSM key from DeDRM and importing it myself fixed the issue. (See https://github.com/noDRM/DeDRM_tools/issues/481)