Open stephenfpersonal opened 5 years ago
DRM removal happens when you first add the book to calibre, not during conversion. Here's how to get the log we need to see:
My apologies. Here's the import log:
[6.17] Started up in 6.17 seconds with 3105 books
objc[14804]: Class FIFinderSyncExtensionHost is implemented in both /System/Library/PrivateFrameworks/FinderKit.framework/Versions/A/FinderKit (0x7fff8d860cd0) and /System/Library/PrivateFrameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride (0x11bd44cd8). One of the two will be used. Which one is undefined.
DeDRM v6.6.1: Trying to decrypt Texas.azw3
Using Library AlfCrypto DLL/DYLIB/SO
MobiDeDrm v0.42.
Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al.
Decrypting Kindle Format 8 ebook: Texas
Found 8 keys to try after 0.1 seconds
Crypto Type is: 2
DeDRM v6.6.1: Failed to decrypt with error: No key found in 8 keys tried.
DeDRM v6.6.1: Looking for new default Kindle Key after 0.1 seconds
Found k4Mac kinf2011 file: /Users/stephen/Library/Application Support/Kindle/storage/.kinf2011
Found k4Mac kindle-info file: /Users/stephen/Library/Application Support/Amazon/Kindle for Mac/storage/.kindle-info
Decrypted key file using IDString '6d8fb113e7e3' and UserName 'stephen'
Couldn't decrypt file.
DeDRM v6.6.1: Found 1 new key
MobiDeDrm v0.42.
Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al.
Decrypting Kindle Format 8 ebook: Texas
Got DSN key from database default_key_1
Found 4 keys to try after 1.1 seconds
Crypto Type is: 2
DeDRM v6.6.1: Ultimately failed to decrypt after 1.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 "site-packages/calibre/customize/ui.py", line 172, in _run_filetype_plugins
File "calibre_plugins.dedrm.__init__", line 621, in run
File "calibre_plugins.dedrm.__init__", line 571, in KindleMobiDecrypt
DeDRMError: DeDRM v6.6.1: Ultimately failed to decrypt after 1.1 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
Added Texas to db in: 0.4
Added 1 books in 2.4 seconds
Thanks for the pointer. I'm not new to Calibre, but I'm new to debug mode!
Where is the book from? Did you get it from the website for "Download & transfer via USB"? If so, you need to choose an E-ink Kindle (not a Fire) and enter its serial number into the DeDRM customization.
@ElleKayEm so you're saying there's no way to DeDRM if you only own a Kindle Fire?
@tamarshallme You can use Kindle for PC/Mac version 1.24 or earlier installed on the same machine and user as calibre with DeDRM. (No customization of the plugin needed.)
Where is the book from? Did you get it from the website for "Download & transfer via USB"? If so,
Purchased from Amazon, downloaded as specified. I've done this many times before successfully.
you need to choose an E-ink Kindle (not a Fire) and enter its serial number into the DeDRM customization.
Yes, and I double-checked the serial numbers. (I have four e-ink Kindles). Again, this has worked hundreds of times before. Something changed in January.
Try downloading the books again. If the serial number is entered correctly, it should work.
Or you can use Kindle for Mac 1.23 or earlier.
Thanks. I deleted and re-downloaded them into Calibre twice. No success. Other books purchased today DeDRMed successfully using the same process with the same serial number(s).
I was able to extract them with Kindle for Mac 1.17, but it makes me nervous that something changed on Amazon's end, and I'm not sure what.
Choosing the same Kindle as the books that work? That is strange. If one of your Kindles is a 1st gen Paperwhite or earlier, you could also try importing a book directly from the device.
I have also run up against a similar error message
DeDRM v6.6.0: Processing: B007MB58WU_EBOK.azw...
MobiDeDrm v0.42.
Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al.
Decrypting Kindle Format 8 ebook: Fear and Loathing on the Campaign Trail '72
Got DSN key from database C:\Users\Zaz\AppData\Local\DeDRMPrefs\kindlekey.k4i
Found 4 keys to try after 0.0 seconds
Crypto Type is: 2
Error decrypting book after 0.0 seconds: No key found in 4 keys tried.
Traceback (most recent call last):
File "C:\src\eBookConverter\DeDRM_tools-master\DeDRM_Windows_Application\DeDRM_App\DeDRM_lib\lib\k4mobidedrm.py", line 259, in decryptBook
book = GetDecryptedBook(infile, kDatabases, androidFiles, serials, pids, starttime)
File "C:\src\eBookConverter\DeDRM_tools-master\DeDRM_Windows_Application\DeDRM_App\DeDRM_lib\lib\k4mobidedrm.py", line 233, in GetDecryptedBook
mb.processBook(totalpids)
File "C:\src\eBookConverter\DeDRM_tools-master\DeDRM_Windows_Application\DeDRM_App\DeDRM_lib\lib\mobidedrm.py", line 471, in processBook
raise DrmException(u"No key found in {0:d} keys tried.".format(len(goodpids)))
DrmException: No key found in 4 keys tried.
DeDRM v6.6.0: Failed
DeDRM v6.6.0: Complete: Successes: 0, Failures: 1
Book was purchased today, and downloaded using Kindleforpc 1.24.3 with the rendertest file removed. This has worked earlier, and I just tested and it still works on my old books, if i delete them and download them again through kindleforpc.
Books are from the same installation of Kindle for PC? Can be both be opened and read in Kindle for PC? And both Kindle for PC where the books were downloaded are on the same machine and user as DeDRM?
I notice you're not using the latest version of DeDRM, but that shouldn't matter here.
Yes the latest version broke my scripts for some reason. Something about python references. See https://github.com/apprenticeharper/DeDRM_tools/issues/650
I can reproduce the error by doing the following: Delete the book from my kindleforpc device. Download it again. Download any other book I have to compare it with. Run my script. (basically "python DeDRM_App.pyw <path to azw>") The other book (bought 2019-01-17) will convert as it should, but "Fear and Loathing" (bought 2019-02-11) wont.
Hmm, usually it's all or nothing with a particular installation of a Kindle app or device...unless the book is a rental/loan or one of the included dictionaries.
Have you tried the calibre plugin?
No, but would it really find more keys to try?
Well, it should be the same. But sometimes people have better luck with the plugin.
Update: I had better luck by trying another computer. I installed kindleforpc and calibre and dedrm on my work laptop, and here both my script and the calibre plugin works. (I tested both)
Is there a way to compare the k4i files to figure out what went wrong on the other computer?
Is there a way to force kindle to regenerate the k4i file without reinstalling the application or re-registering?
Keys are definitely going to be different on another computer. Each app installation/device has its own key.
Sounds like the key changed for that installation of the app and DeDRM isn't picking up the new one. I'd try completely uninstalling and reinstalling Kindle for PC. There are instructions here:
(They advise using 1.17 or earlier, but as you know, you can now use 1.24 or earlier.)
Actually, I just deleted the dedrm cached kindlekey.k4i from %LocalAppData%\DeDrmPrefs and that solved the issue. :D
Thanks for all the help.
Oh, that's a lot easier! Thanks for reporting what worked.
These tools are intended for books you own.
I want the digital version.
Then buy it.
The developers of these tools have always made their policy on this very clear.
Not going to argue. Just pointing out the policy here.
I have been using Calibre and DeDRM for years to archive PURCHASED Amazon books and to convert them to EPUB for use on my Kobo. This week, it stopped working on certain files. Specifically, I purchased "Texas" by James Michener, "Storm Front" and "Fool Moon" by Jim Butcher, and "Downbelow Station" by CJ Cherryh. In all cases, Calibre throws the same error you would get if DeDRM was not installed. Surprisingly, "Panacea" (F. Paul Wilson) and "A Gentleman in Moscow" (Amor Towles) purchased during the same week were converted to EPUBs just fine.
Running Calibre 3.38.1, DeDRM 6.6.1, macOS 10.13.6. Debug log below if it's useful to anyone. No configuration changes between the last time I used Calibre three weeks ago, and the failures I am experiencing now. Any insight or suggestions? Thanks!