Skip to content

Instantly share code, notes, and snippets.

@rendyanthony
Last active October 30, 2024 20:55
Show Gist options
  • Save rendyanthony/a1d6b830c33a5e0fcd8b4c86f3f0dbff to your computer and use it in GitHub Desktop.
Save rendyanthony/a1d6b830c33a5e0fcd8b4c86f3f0dbff to your computer and use it in GitHub Desktop.
Install Adobe Digital Editions (ADE) and Calibre DeDRM on Fedora

Install Adobe Digital Editions and Calibre DeDRM on Fedora

How to get an .epub from an .acsm on Fedora Linux

This guide is based on Installing on Arch Linux via WINE and Exactly how to remove DRM.

The steps below were tested with Fedora 32.

Install Adobe Digital Editions (ADE)

Since ADE is a Windows application, to run it under Linux we will to install Wine.

Configure environment variables:

wine_install="$HOME/.adewine/"
export WINEPREFIX=$wine_install
export WINEARCH=win32

Install dependencies:

sudo dnf install -y wine winetricks gnutls

Setup Wine:

wineboot
winetricks -q corefonts
winetricks -q dotnet35sp1
winetricks -q python27

Download and install ADE in Wine:

curl -L http://download.adobe.com/pub/adobe/digitaleditions/ADE_2.0_Installer.exe \
    -o /tmp/adeinstaller.exe
wine /tmp/adeinstaller.exe

Authorize Your Computer

Note: You would need an Adobe ID. Please refer to: https://helpx.adobe.com/manage-account/using/create-update-adobe-id.html to create one.

  1. Start ADE
  2. Help > Authorize Computer
  3. Select eBook Vendor: Adobe ID
  4. Enter your Adobe ID and Password

Extract Adobe Key for DeDRM

Create the dedrm_plugins directory in Wine:

mkdir -p "$wine_install/drive_c/dedrm_plugins/"

Install PyCrypto in Wine:

curl -L http://www.voidspace.org.uk/python/pycrypto-2.6.1/pycrypto-2.6.1.win32-py2.7.exe \
    -o /tmp/pycrypto.exe
wine /tmp/pycrypto.exe

Download adobekey.py from DeDRM:

curl -L https://raw.githubusercontent.com/apprenticeharper/DeDRM_tools/Python2/DeDRM_plugin/adobekey.py \
    -o "$wine_install/drive_c/dedrm_plugins/adobekey.py"

Extract key:

wine python "$wine_install/drive_c/dedrm_plugins/adobekey.py"

Your key file can be found at $wine_install/drive_c/dedrm_plugins/adobekey_1.der

Setup Calibre and the DeDRM plugin

Note: We need use the Flatpack version for Calibre (v5.x) and DeDRM v7.x (pre-release) which are both written for Python 3. This is because the RPM version of Calibre (v4.x) from the Fedora 32 repo uses Python 3. This makes it incompatible with DeDRM v6.8.0 (latest-stable) which was written for Python 2.

  1. Install Calibre via Software.
    1. Select the Flatpack format (v5.10.1)
  2. Download DeDRM v7.x (pre-release version) e.g. DeDRM_plugin_7.0.3.zip
  3. Open the Calibre application
  4. Install DeDRM Plugin:
    1. Preferences > Plugins > Load plugin from file. Select the DeDRM .zip file you just downloaded.
    2. Search for the plugin, click on Customize plugin
    3. Click on Adobe Digital Editions ebooks
    4. Click on Import Exiting Keyfiles
      1. Navigate to $HOME/.adewine/drive_c/dedrm_plugins
      2. Select adobekey_1.der

Remove DRM

  1. Open Adobe Digital Editions
  2. Drag-and-drop the .acsm file into the ADE window.
    1. This will download the encrypted .epub file into $HOME/Documents/My Digital Editions directory.
  3. Open Calibre
  4. Add the encrypted .epub file into Calibre.
    1. You will find the unecrypted .epub file in your $HOME/Calibre Library directory.

You can open the uncrypted file with your preferred .epub reader app, such as Foliate.

@kaosine
Copy link

kaosine commented May 15, 2022

The voidspace pycrypto doesn't work anymore. The site just doesn't exist at all. pycryptodome is a drop in replacement supposedly

@superboum
Copy link

you may try wine .../python.exe -m pip pycryptodome this is a compatible fork of pycrypto with a compiled version available directly in pypi

@chriscz
Copy link

chriscz commented Dec 24, 2023

I had my fair share of hassle getting this to work on Fedora.

But a made a dockerized script. Which should make your life a bit easier!

https://github.com/chriscz/nodrm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment