apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.55k stars 1.52k forks source link

DEDRM not working with the latest Kindle books #1830

Open hampole123 opened 3 years ago

hampole123 commented 3 years ago

The release is not working with the latest azw book. In fact Amazon does not open the book with the earlier Kindle for PC. Asks for the latest Kindle for PC. When I open the azw book with the latest Kindle for PC and use this DEDRM, it doees not work.

ian5142 commented 3 years ago

Following. I encountered the same issue with Kindle for PC v1.17.

ElleKayEm commented 3 years ago

If the book cannot be downloaded with Kindle for PC/Mac 1.26 or earlier and it is not available for "download & transfer via USB" to an E-ink Kindle, then it cannot be decrypted at this time.

@ian5142 This should not be a problem with Kindle for PC 1.17.

ian5142 commented 3 years ago

This is the ebook. I don't see a Download & transfer via USB. Will I still get the update to latest kindle for PC message in v1.26?

ElleKayEm commented 3 years ago

@ian5142 I'm sorry. I misunderstood. I thought you meant you were unable to decrypt a book from Kindle for PC 1.17. Download & transfer via USB would be available from the book's listing on your Content & Devices page at Amazon under More Actions. You also need an E-ink Kindle (not a Fire) on your account. You may get the same message in 1.26; and from what I've seen, those books are also not available for "download & transfer". If so, then it is only available in KFX format with a newer DRM that cannot be removed yet.

ian5142 commented 3 years ago

Well then, I guess I am just stuck using it on the Kindle for PC app, for now.

ian5142 commented 3 years ago

It says this title is unavailable for download and transfer.

cat-reader commented 3 years ago

I've been using Calibre 4.23 with DeDRM 6.8.0 and it's been working fine for both AZW and ADE EPUB. Today I purchased 3 Kindle AZW books published within the last 4 years, downloaded for transfer using USB, and DeDRM does not work for them.

I upgraded to Calibre 5.29 and installed DeDRM 7.2.1, and verified that my Kindle serial number (an e-Ink device) appears in the plugin configuration. However, DeDRM is still not working. Log file is attached. DeDRMlog 2021-10-10.txt

ElleKayEm commented 3 years ago

When getting the book for "download & transfer", make sure you've chosen the correct E-ink Kindle. And make sure that Kindle's serial number is entered in DeDRM's customization correctly. Copy and paste from the website works well.

cat-reader commented 3 years ago

Thanks for your reply, ElleKayEm.

I only have one Kindle device, so it's definitely the correct one used for "download and transfer by USB". And the serial number is also definitely the correct number.

I've been using DeDRM for years, and have never had a problem before this.

ElleKayEm commented 3 years ago

I don't know what else to check. It is still working for me.

TheSpyder commented 3 years ago

I decrypted some books successfully using Kindle for Mac 1.29 a bit over a month ago, but the same setup is no longer working. The only thing I changed was upgrading calibre but downgrading it didn't help.

Log Title ```log calibre Debug log calibre 5.30 embedded-python: True is64bit: True macOS-10.16-x86_64-i386-64bit Darwin ('64bit', '') ('Darwin', '20.6.0', 'Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:20 PDT 2021; root:xnu-7195.141.6~3/RELEASE_ARM64_T8101') Python 3.8.5 OSX: ('10.16', ('', '', ''), 'x86_64') Interface language: None Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 44, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 44, 0) && Goodreads Sync (1, 15, 1) && KFX metadata reader (from KFX Input) (1, 44, 0) && KFX Input (1, 44, 0) && Kobo Books (1, 8, 2) && KoboTouchExtended (3, 5, 3) calibre 5.30 embedded-python: True is64bit: True macOS-10.16-x86_64-i386-64bit Darwin ('64bit', '') ('Darwin', '20.6.0', 'Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:20 PDT 2021; root:xnu-7195.141.6~3/RELEASE_ARM64_T8101') Python 3.8.5 OSX: ('10.16', ('', '', ''), 'x86_64') Interface language: None Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 44, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 44, 0) && Goodreads Sync (1, 15, 1) && KFX metadata reader (from KFX Input) (1, 44, 0) && KFX Input (1, 44, 0) && Kobo Books (1, 8, 2) && KoboTouchExtended (3, 5, 3) devicePixelRatio: 2.0 logicalDpi: 72.0 x 72.0 physicalDpi: 113.50000170459899 x 113.50000170459901 Using calibre Qt style: True [0.00] Starting up... [0.01] Showing splash screen... [0.22] splash screen shown [0.22] Initializing db... [0.23] db initialized [0.23] Constructing main UI... DEBUG: 0.0 Goodreads Sync::dialogs.py - loading translations DEBUG: 0.0 GoodreadsSync::action.py - loading translations DEBUG: 0.6 HttpHelper::__init__: proxy=None [1.00] main UI initialized... [1.00] Hiding splash screen [1.02] splash screen hidden [1.02] Started up in 1.02 seconds with 111 books Starting QuickView Gather KFX-ZIP (from KFX Input) 1.44.0: Importing /Users/spyder/Library/Application Support/Kindle/My Kindle Content/B01NAKSWW1_EBOK/B01NAKSWW1_EBOK.azw Gather KFX-ZIP (from KFX Input): File is not KFX format DeDRM v7.2.1: Trying to decrypt B01NAKSWW1_EBOK.azw Using Library AlfCrypto Python Using Library AlfCrypto Python MobiDeDrm v1.0. Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al. Decrypting Kindle Format 8 ebook: Blood, Sweat, and Pixels Got SerialNumber from database default_key Got UsernameHash from database default_key Found 4 keys to try after 0.1 seconds Crypto Type is: 2 DeDRM v7.2.1: Failed to decrypt with error: No key found in 4 PIDs tried. DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds Found k4Mac kinf2018 file: /Users/spyder/Library/Application Support/Kindle/storage/.kinf2018 trying username b'spyder' on file /Users/spyder/Library/Application Support/Kindle/storage/.kinf2018 trying IDString: b'bba507b7bf8c' trying IDString: b'bba507b7bf8f' trying IDString: b'bd9b4a547415' Decrypted key file using IDString 'bd9b4a547415' and UserName 'spyder' DeDRM v7.2.1: Found 1 new key MobiDeDrm v1.0. Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al. Decrypting Kindle Format 8 ebook: Blood, Sweat, and Pixels Got SerialNumber from database default_key_1 Got UsernameHash from database default_key_1 Found 4 keys to try after 1.2 seconds Crypto Type is: 2 DeDRM v7.2.1: Ultimately failed to decrypt after 1.2 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 "calibre_plugins.dedrm.__init__", line 540, in KindleMobiDecrypt book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime) File "calibre_plugins.dedrm.k4mobidedrm", line 238, in GetDecryptedBook mb.processBook(totalpids) File "calibre_plugins.dedrm.mobidedrm", line 484, in processBook raise DrmException("No key found in {0:d} PIDs tried.".format(len(goodpids))) calibre_plugins.dedrm.mobidedrm.DrmException: No key found in 4 PIDs tried. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "calibre/customize/ui.py", line 175, in _run_filetype_plugins File "calibre_plugins.dedrm.__init__", line 633, in run decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook) File "calibre_plugins.dedrm.__init__", line 583, in KindleMobiDecrypt raise DeDRMError("{0} v{1}: Ultimately failed to decrypt after {2:.1f} seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md".format(PLUGIN_NAME, PLUGIN_VERSION,time.time()-self.starttime)) calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 1.2 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md ```
ElleKayEm commented 3 years ago

Did you try calibre 4.23 and DeDRM 6.8.1?

TheSpyder commented 3 years ago

No, because I don’t have them installed. It worked just fine on the newer releases when I set this up a couple of months ago.

I’ll track down the older releases tomorrow and give them a go.

ElleKayEm commented 3 years ago

DeDRM 7.2.1 has trouble initially retrieving the key on Macs. You should be able to go back to the current versions if the older one is successful.

TheSpyder commented 3 years ago

That's so weird. I am thoroughly confused as to why this worked before and then stopped working. Oh well, yes the old version fixed the problem. It took me a while to realise I had to reinstall DeDRM 7 after upgrading back to Calibre 5, but yes it also works now that the older version retrieved the 4 keys correctly. It was reporting 8 keys until I realised it was just the same 4 but retrieved correctly this time.

Thanks for your help!

cat-reader commented 3 years ago

Unfortunately, I am still having the problem in Windows where neither Calibre 4.23 with DeDRM 6.8.0 nor Calibre 5.29 with DeDRM 7.2.1 is working on AZW files (both combinations work fine with DRM-protected MOBI and EPUB files). EDIT: both combinations also work with AZW3 files.

ElleKayEm commented 3 years ago

On Windows, DeDRM 7.2.1 should work with Kindle for PC 1.26 and earlier. Or any version with KFX downloads disabled. See this post: https://www.mobileread.com/forums/showthread.php?t=283371

cat-reader commented 3 years ago

I'm not using Kindle. I'm downloading directly via "dowload and transfer using USB".

ElleKayEm commented 3 years ago

Are you choosing an E-ink Kindle? Do you have that serial number entered correctly in DeDRM's customization?

cat-reader commented 3 years ago

Hi ElleKayEm, please scroll up to read my previous answers to these questions.

ElleKayEm commented 3 years ago

@cat-reader Sorry with several people and issues in this thread, I lost track. Can you download those books with the older Kindle for PC? Would you mind sharing the ASIN of one? I'd like to try decrypting a sample myself.

cat-reader commented 3 years ago

Okay, here's what I found out: 1) I have only 17 books in my Calibre library (out of several thousand) of type "AZW". The rest were all "AZW3", which convert to EPUB fine. None of the AZW books would convert. 2) I uninstalled Kindle for PC. 3) I disconnected my internet connection 4) I installed Kindle for PC 1.17. I made sure "auto update" in Options was disabled (not ticked). 5) I turned on my internet connection and registered the 1.17 Kindle for PC. 6) I downloaded one of the books I just bought (ASIN B01C37XEGO), then shut down Kindle for PC. 7) I imported that book into Calibre, and it successfully converted to EPUB. Yay! 8) I fired up Kindle for PC again\ in order to download the other 16 AZW books, and Kindle for PC automatically updated to version 1.30 even though auto update was turned off. (B**s!) 9) I repeated steps 2 thru 5, then downloaded the other 16 AZW books (I also saved all 17 files to my Kindle backup folder, in case Kindle for PC later decides to alter them). Note that this time, even though they had .azw file suffixes, they imported as type AZW3, compared to the AZW I got when downloading to transfer by USB. 10) I now have all 17 files converted to EPUB and backed up.

So this solves my problem in that I no longer have any DRMed Kindle books which I can't convert, and if I get another one, I know how to fix it.

But it does not solve the problem of the current Calibre/DeDRM programs not being able to handle the DRM'ed AZW files.

Thanks for your help, ElleKayEm.

ElleKayEm commented 3 years ago

For preventing unwanted updates of the Kindle app, see the bottom of the first post here: https://www.mobileread.com/forums/showthread.php?t=283371

With Kindle for PC, the extension is always AZW regardless of the actual format. When DeDRM successfully decrypts it, you'll see an extension for the actual format in calibre. So an AZW file from there could be any Amazon format. When downloading from the website, AZW usually means MOBI. But for most books you'd get AZW3.

So I really don't know what the deal was with your "download & transfer" copies. When I searched for the book by the title in your log and tried to get a sample to test, it said it wasn't available for download and transfer. But it could have been a different book with the same title.

cat-reader commented 3 years ago

I don't think Kindle Samples are usually available for USB transfer, only by download to Kindle device. But if you can figure out a way to tell me how to send you both AZW and AZW3 files of that book so that you can analyze them, I'm happy to do so.

ElleKayEm commented 3 years ago

Kindle samples are usually available in the same ways and with the same encryption the full book is. If you let me know the ASIN shown on the product page details, I'll try to take a look.

cat-reader commented 3 years ago

The ASIN is in my comment above.

ElleKayEm commented 3 years ago

Oh, thanks! I got an AZW3 when I did the download & transfer of the sample choosing my Oasis for the device. I was also able to download the sample with Kindle for PC 1.17, and that became an AZW3 in calibre. But both were actually already DRM-free. Maybe this publisher doesn't bother having DRM on samples. Although I'm used to seeing samples have DRM too. So I still haven't got a clue.

dnmc919 commented 2 years ago

Latest Calibre and DEDRM work for 95% of Amazon AZW3 books I have using download and USB option. Any idea why a few books are immune? Is it a different encryption for those particular authors/books?

j-howell commented 2 years ago

Latest Calibre and DEDRM work for 95% of Amazon AZW3 books I have using download and USB option. Any idea why a few books are immune? Is it a different encryption for those particular authors/books?

You would have to provide more details for someone to determine what is going wrong in those cases. The log from an import would help.

dnmc919 commented 2 years ago

Sorry, I only found the error for no key found in the log, so did not post it. This only happens with this book and one other so far, but 20 others processed fine.

Log removed to shorten thread.

ElleKayEm commented 2 years ago

@dnmc919 When downloading from the website, you need to choose an E-ink Kindle (not a Fire) and enter the Kindle's serial number into DeDRM's customization.

dnmc919 commented 2 years ago

My apologies. I appreciate you taking the time to respond. I re-entered the serial and it worked, so I must have typo'd when updating. The prior imports that I thought worked were not encrypted once I checked those individual log files, so the assumption it was working after I updated Calibre and DeDRM was flawed. I should have verified the serial first.