here's how i got my kindle books into calibre on linux, without a current kindle serial number (1/n)
- installed Bottles from flatpak
- downloaded Kindle for PC 1.40 (list of all available versions on wayback here https://web.archive.org/web/*/https://s3.amazonaws.com/kindleforpc/* ) and installed in a new bottle, making sure to disable networking so it didn't autoupdate, and disabled autoupdate in the settings before restarting w/networking enabled
- in Kindle for PC, authenticated w/amazon and synced account, then downloaded each book individually (no bulk download option?)
- back in linux: installed calibre
- installed *latest alpha* of the DeDRM calibre plugin https://github.com/noDRM/DeDRM_tools
- installed python 3.11 in the kindle bottle I made earlier (3.12+ are buggy under wine)
- installed pycryptodome in the bottle (opened a shell w/bottles' "Command Line" tool, ran `python.exe -m pip install pycryptodome`)
- copied the contents of DeDRM_plugin.zip in the DeDRM tools zip to a directory inside the kindle bottle, e.g., i copied to ~/.var/app/com.usebottles.bottles/data/bottles/bottles/kindle/drive_c/users/allison/Desktop/dedrm
- back in the bottle shell: cd'ed to that directory and ran `python.exe -m kindlekey`, which produced a file called kindlekey1.k4i
- in calibre plugins dialog, clicked customize DeDRM plugin: kindle for mac/pc > import existing keyfiles, then import kindlekey1.k4i
- in calibre, installed kfx input plugin from here https://www.mobileread.com/forums/showthread.php?t=291290
- found the dir inside the bottle where kindle for pc downloaded the ebooks (for me this was ~/.var/app/com.usebottles.bottles/data/bottles/bottles/kindle/drive_c/users/allison/Documents/My Kindle Content)
- imported individual .azw files from each listed directory
- converted them to .epub! they look fine
what i left out: I tried like five different versions of Kindle for PC before finding one that both works with Wine and will actually connect to Amazon. also tried four different python versions before hitting on the one that could run the dedrm key code (note that the version in the dedrm github's "other tools" directory is not up to date!). so the whole thing only took like six hours from start to finish
@aparrish thank you for sharing this, I'm sure it will help people!