Only use this to backup the books you own, etc.
ESPECIALLY IF YOU ARE GOING FROM PYTHON-2 TO PYTHON-3
Please uninstall the existing version before installing the new version (you can also use a new prefix for testing and not deleting the old version in case something breaks; in this case, first uninstall the Calibre plugin configuration first).
See below for more details.
If you are still using an older version of Calibre that runs on Python-2, please use this older version.
I kept having issues migrating over my Calibre + DeDRM configuration from one computer to another, and got sick of manually repeating all the steps. Furthermore, writing this let me brush up on my Ansible skills.
Whilst doing this I also came across several issues (that might be due to my own setup) and found how to deal with them.
This Ansible playbook will automate:
- Creating the Wine Prefix for use.
- Installing all necessary Windows dependencies in Wine (Python, Kindle, Adobe Digital Editions, etc.).
- Install and configure the plugin in Calibre.
The canonical list of Windows dependencies as required for NixOS 21.05 can be found in shell.nix. Package names for other Linux distributions will vary.
This supports Calibre >= 5 and DeDRM tools >= 7, both of which using Python-3.
Unfortunately, no. Depending on how you configure this, you will need to:
- Do the typical Windows thing of clicking "Next" in Windows installation dialogues.
- Sign-in/authorize Kindle and Adobe Digital Editions so that the key can be extracted.
First of all, edit the configuration to what you require; possible options include:
- Change DeDRM version.
- Changing the name of the Wine Prefix (you should ensure that the directory doesn't exist before running this).
- Download directory.
- Disabling Kindle or Adobe Digital Editions support.
You may then need to run (especially if using Ansible 2.10 or newer):
ansible-galaxy install -r requirements.yml
Afterwards, you can just do:
ansible-playbook install.yml
If you ever need to uninstall:
ansible-playbook uninstall.yml
If you wish to change the version of DeDRM:
- Make sure Calibre isn't running.
- Run
ansible-playbook remove-plugin.yml
to remove the current version of DeDRM. - Change the version in [configuration.yml]
- Run
ansible-playbook install.yml
again.
If you started with either install_kindle
or install_adobe
set to
false
then you can change them to true
and re-install and it
should work.
However, you can't remove one of these integrations without uninstalling.
If using NixOS or nixpkgs, then you should first run nix-shell --pure
in this directory to ensure that you get the required
dependencies installed, especially since Ansible doesn't work when
installed at the top-level. This was tested with Nixpkgs version
21.05.1076.bad3ccd099e
.
Note that this package requires PyCryptodome, which is not a dependency of Calibre in Nixpkgs. As such, you may need something like this:
nixpkgs.overlays = [
(self: super: rec {
calibre = super.calibre.overrideAttrs (oldAttrs: rec {
# For DeDRM plugin
propagatedBuildInputs = (oldAttrs.propagatedBuildInputs or [ ]) ++ [ super.python3Packages.pycryptodome ];
});
})
];
(This seems to work via the nix-shell
route, possibly due to Ansible
bringing in PyCryptodome already.)
This Ansible code is available under the MIT License.
It includes code by Joey Espinosa licensed under the MIT License from https://github.com/particledecay/ansible-jsonpatch