-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Update kindlekey for Python 3 #1732
base: master
Are you sure you want to change the base?
Conversation
Because it's 2021. No attempt was made for readability/backwards compatibility/etc, I just wanted to dump my books. Tested on Windows 10 and it successfully got my keys from Kindle PC 1.17.1
The kindlekey script from the plugin is Python 3. |
This is somewhat confusing, the kindlekey script referred to here isn't the script from the plugin, it's the kindlkey.pyw script from the Other_Tools folder. Note the extra 'w' in the file name, this means it's a python script that won't start a DOS console window. As ElleKayEm has stated quite correctly, the script from the plugin is already Python 3. However, it's also true that this older version of the script in Other_Tools is indeed still Python 2. So we could convert this script to Python 3 as well, but I'm not sure we should. What's the purpose of the scripts from Other_Tools? Are they an archive of an older version? If so, are they meant to be Python 2, and ought to stay as such? Or should they be updated to Python 3 too? That shouldn't even be necessary, because the update already has been done to the plugin script, and updating this script would mean doing the same work again. I recommend using the plugin, because that's tested, and in the case of 7.2.1, updated to Python 3. Actually, most of the Python scripts can be used in a DOS console. If you're using Python 2, you could use the current version in Other_Tools. And if you're using Python 3, and still want to use a script in a console, you could just use the one from from the plugin (get it from the zip). I've tried it, it works that way. If you don't want to open a DOS console, you could even rename it to kindlekey.pyw first. It works that way too. |
Presumably the key scripts are just in Other_Tools so you don't have to dig them out from all the other scripts in the plugin if you want to run them on a virtual machine or something. But seems they've been forgotten and not kept in sync with the plugin. If someone wanted the Python 2 versions, they could get them from DeDRM 6.8.1. |
The plugin didn't actually work for me, until I did this and got the key and entered it into the plugin preferences, so I thought this was a separate tool and a extra required step to installing the plugin. If this is shared code, it should be linked as such properly and not copy pasted like this in a file that will bitrot and confuse people. |
This commit works for me at this moment! Thanks! |
@acotor Why? Didn't the plugin work on it's own without this extra step? |
@ElleKayEm The plugin supposed to work with this script according to this wiki. To my test, without the key file being configured, the plugin won't remove DRM for or maybe I'm wrong, since Calibre and Kindle4PC are runing on the same system. Anyway, I got 'syntax error' after running the latest script. I don't use python often but this commit succeed in getting the key file.
|
That wiki along with this whole repo is no longer maintained. As mentioned above, the scripts in the Other_Tools folder here are old Python 2 ones. If for whatever reason, you need to run the key script on its own, you can use the one from inside the plugin. The latest DeDRM plugin is available from this repo: https://github.com/noDRM/DeDRM_tools |
Because it's 2021. No attempt was made for readability/backwards compatibility/etc, I just wanted to dump my books.
Tested on Windows 10 and it successfully got my keys from Kindle PC 1.17.1
I assume this won't be merged, but maybe someone can use it as a starting point for a real change, or just see this PR and be able to read their books 🤷