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

Adobe DRM - "ValueError: string argument should contain only ASCII characters" #119

Closed
marvinnnnn opened this issue Aug 7, 2022 · 6 comments

Comments

@marvinnnnn
Copy link

Question / bug report

I was helping a friend get set up with Calibre and DeDRM and ran in to an issue when trying to dedrm an Adobe Digital Editions book that they wanted to put on their Kindle. I'm not sure that it's directly related to DeDRM, but I don't know where else to ask for help. I followed all of the instructions to install and configure DeDRM for Adobe Digital Editions, but when I clicked the green + sign, instead of "default_key" like showed up when I set up my own computer, they ended up with a long alphanumeric string plus the email address they registered ADE with.

We tried importing one of their books, but when we tried to open it we got the error that it was still protected by DeDRM. I deleted the book, restarted in debug mode, and imported it again to get the attached log.

The alphanumeric string that shows up in the DeDRM ADE Configuration window matches the UUID value in the log:
DeDRM v10.0.3: Plenty More.epub is a secure Adobe Adept ePub for UUID 721d8ff3-3b78-4452-b7ce-14b587700261

I don't see any non-ASCII characters anywhere, so I'm not sure what we're doing wrong. I didn't find any results when I googled "ValueError: string argument should contain only ASCII characters," so it seems like I might be the first person to run into this problem. I also tried clicking "Save highlighted key to a .der file" in case that would let me see what's wrong with the key, but received a similar error about ASCII characters.

Which version of Calibre are you running?

6.2.1

Which version of the DeDRM plugin are you running?

10.0.3

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

No response

Log output

ApplicationPaletteChange event ignored
Using calibre Qt style: True
ApplicationPaletteChange event received
calibre Debug log
calibre 6.2.1  embedded-python: True
Windows-10-10.0.19043-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19043')
Python 3.10.1
Windows: ('10', '10.0.19043', 'SP0', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: DeDRM (10, 0, 3)
calibre 6.2.1  embedded-python: True
Windows-10-10.0.19043-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19043')
Python 3.10.1
Windows: ('10', '10.0.19043', 'SP0', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: DeDRM (10, 0, 3)
QPA platform: windows
devicePixelRatio: 1.0
logicalDpi: 96.0 x 96.0
physicalDpi: 102.23899371069182 x 102.35820895522387
[0.00] Starting up...
[0.00] Showing splash screen...
[0.19] splash screen shown
[0.19] Initializing db...
[0.23] db initialized
[0.23] Constructing main UI...
[0.89] main UI initialized...
[0.89] Hiding splash screen
Starting QuickView
DeDRM v10.0.3: Trying to decrypt Plenty More.epub
DeDRM v10.0.3: Verifying zip archive integrity
DeDRM v10.0.3: Plenty More.epub is a secure Adobe Adept ePub for UUID 721d8ff3-3b78-4452-b7ce-14b587700261
Running file type plugin DeDRM 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\customize\ui.py", line 178, in _run_filetype_plugins
  File "calibre_plugins.dedrm.__init__", line 1067, in run
  File "calibre_plugins.dedrm.__init__", line 533, in ePubDecrypt
ValueError: decoding with 'hex' codec failed (ValueError: string argument should contain only ASCII characters)
[36.95] splash screen hidden
[36.95] Started up in 36.95 seconds with 1269 books
Added Plenty More: Vibrant Vegetable Cooking from London's Ottolenghi [A Cookbook] to db in: 0.1
Added 1 books in 0.6 secondWorker Launch took: 0.00 seconds
@ElleKayEm
Copy link

There's a bug when there's something wrong with the saved key, DeDRM doesn't try to retrieve the correct key. Delete the saved key and re-add the book letting DeDRM automatically retrieve the correct key.

I assume that ADE is authorized with their Adobe ID and on the same machine and user as calibre with DeDRM.

@noDRM
Copy link
Owner

noDRM commented Aug 8, 2022

I wonder, though, why there are so many of these reports within the last ~2 weeks or so. Did I break stuff in 10.0.3?

#109 #115 #116

Before you do what ElleKayEm suggested, would you mind going to Preferences -> Miscellaneous -> Open calibre configuration folder, then go to "plugins" and take the "dedrm.json" file in there and send it to the email address you can find on my Github profile?

I'd like to figure out where that issue comes from and why the plugin thinks the key is corrupted ...

@franklouwers
Copy link

Proposed solution does not work here. Any other suggestions?

@ElleKayEm
Copy link

Not without knowing more about your specific issue. Let's see an import log.

@marvinnnnn
Copy link
Author

For what it's worth, I was able to solve my friend's problem by following the instruction from @ElleKayEm. I deleted the key and imported the epub file and DeDRM found/created the default key successfully. I did send the requested file to noDRM, though I didn't hear anything back so I don't know if the file was ultimately useful in diagnosing this problem.

Apologies for not coming back and closing the issue sooner, I thought @noDRM could close it based on the email I sent them.

noDRM added a commit that referenced this issue Sep 10, 2022
@noDRM
Copy link
Owner

noDRM commented Sep 10, 2022

Sorry, I didn't have much time for the plugin in the last couple weeks. Your file was helpful, and the bug is now fixed in the plugin.

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