Giter Site home page Giter Site logo

ansible-dedrm-wine's Introduction

Ansible Playbook for installing DeDRM for Calibre under Wine

Obligatory notice

Only use this to backup the books you own, etc.

Upgrade warning

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.

Python 2 support

If you are still using an older version of Calibre that runs on Python-2, please use this older version.

Why write this?

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.

What does it do?

This Ansible playbook will automate:

  1. Creating the Wine Prefix for use.
  2. Installing all necessary Windows dependencies in Wine (Python, Kindle, Adobe Digital Editions, etc.).
  3. Install and configure the plugin in Calibre.

Dependencies

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.

So can I run this unattended?

Unfortunately, no. Depending on how you configure this, you will need to:

  1. Do the typical Windows thing of clicking "Next" in Windows installation dialogues.
  2. Sign-in/authorize Kindle and Adobe Digital Editions so that the key can be extracted.

How to use this

First of all, edit the configuration to what you require; possible options include:

  1. Change DeDRM version.
  2. Changing the name of the Wine Prefix (you should ensure that the directory doesn't exist before running this).
  3. Download directory.
  4. 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

Upgrading DeDRM

If you wish to change the version of DeDRM:

  1. Make sure Calibre isn't running.
  2. Run ansible-playbook remove-plugin.yml to remove the current version of DeDRM.
  3. Change the version in [configuration.yml]
  4. Run ansible-playbook install.yml again.

What other changes can be made?

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.

NixOS / nixpkgs

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.)

Licensing

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

ansible-dedrm-wine's People

Contributors

ivan-m avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ansible-dedrm-wine's Issues

Kindle Unable to Connect

Unable to connect. Please check your network settings

Error Message.

I don't have anything unusual in my set up, no weird connections. I've taken a look in the settings, nothing there. Any idea why it can't connect?

Can't Sign In?

Hello,
Thanks for making this script, it does save a lot of effort when trying to setup dedrm.

Unfortunately, I can't seem to sign in on ADE 2.0, I understand that just locally authorizing it won't generate the required keys, but even though I'm inputting the correct information (I've quadruple checked). It still hits me with the:
incorrect login ID or password for the selected eBook vendor, Please try again.

I've got no clue how to proceed. On my desktop ADE 1.4 I can login in just fine, though still can't extract the keys, I've spent far to long pulling my hair out as to why.

What's going on?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.