Longtime readers may remember that I am quite stubborn about removing the DRMs of books I purchased for my own reading.
In fact, I have little choice: my current ebook reader is a PocketBook Touch Lux 3 that, crucially, is not linked to a specific bookstore (unless the same bought, say, from Decitre in France). I tend to buy ebooks from Kobo, because I like their selection and because, unlike the dreaded Amazon-Kindle binding, you're not limited to using their reader to read your ebooks.
Unfortunately, many of the ebooks they sell come with the dreaded Adobe Digital Edition (also known as ADE, which make it sounds nice and nonthreatening like my friend Adélaïde, but do not get lulled into a false sense of security) DRMs. Particularly dreaded of the Linux users, for ADE is only available for Windows or Mac.
All fine and dandy (provided you're not too bothered about the concept of DRMs) if you have an ADE-compatible device.
But not so much in my case.
So I need to somehow transform the .acsm files I purchase into DRM-free epubs.
And my old setup to do so suddenly started failing with a "#2038" network error that I was not able to fix. Which is when it became apparent that I had to seriously upgrade my suite of tools... And here's how I did it, on Linux Mint 18.3 (yeah, I should upgrade, but it's stable, okay?).
Installing Adobe Digital Editions 2.0
The first thing is to install Adobe Digital Editions 2.0. I owe many thanks to Pat David's post for that part.
First thing first, you need wine 3.0. Easy to acquire as wine-stable
from your repository.
You'll also need winetricks
and cabextract
.
One nice thing about wine is that you can have multiple setups, each corresponding to a so-called "prefix", so you can mess around one setup without killing everything else. Following Pat's advice, I decided to use a prefix called ".adewine" (instead of the default ".wine") for the installation and use of ADE.
export WINEPREFIX=~/.adewine
Then you need to tell wine you want to work with a 32 bits Windows
WINEARCH=win32 winecfg
At this point, a setup window should open. Make sure to choose Windows XP here, as more recent versions of Windows won't let you install the .NET framework.
Add a few necessary packages:
winetricks -q corefonts winetricks -q windowscodecs
If at this stage you encounter an error, follow Pat's advice again to fix it:
cd ~/.cache/winetricks/windowscodecs/ cabextract -d tmp wic_x86_enu.exe cd tmp/ cp windowscodecs* ~/.adewine/drive_c/windows/system32/
You're now ready to install the Microsoft .NET Framework 3.5 SP1 Full Package!
Here what worked from me diverged from what Pat did. I had to download dotnetfx35setup.exe from the Microsoft website and then run
wine wine dotnetfx35setup.exe
(This took me two days to figure out, by the way.)
And now, to the installation of Adobe Digital Edition 2.0
All what's left to do is to download the Windows installer of ADE and run
wine ADE_2.0_Installer.exe
Phew!
You should now be able to run ADE, with a command such as
wine ~/.adewine/drive_c/Program\ Files/Adobe/Adobe\ Digital\ Editions\ 2.0/DigitalEditions.exe
Now you should be able to drag and drop your .acsm file into ADE and double-click the ebook to open it.
If you navigate to
~/My\ Digital\ Editions
you'll see that a new epub file has appeared here: your book!
Unfortunately, at this stage, this epub file is still DRMed, and the book is still quite far from being readble on your ebook reader...
Time to move on to step 2: the wonderful tools of Apprentice Alf.
Installing the DeDRM tools
Apprentice Alf, Apprentice Harper, The Dark Reverser and i♥cabbages are a few of the heroes that make it possible to remove DRMs from books you've legally purchased so that you can actually read them on your ebook reader (which you have also legally purchased for the purpose of reading books rather than surfing the Internets looking for a solution to your obscure error messages). Thank you, folks. Heartily.
Your first step here is to download DeDRM_tools_6.6.3.zip.
Unzip this somewhere and navigate to DeDRM_calibre_plugin/
.
To use these tools, you'll need Python2.7. On wine, of course. To install it, download the latest Windows X86 MSI and run
wine msiexec /i python-2.7.16.msi
Now download pycrypto-2.1.0.win32-py2.7.zip from Voidspace, unzip it, and run
wine pycrypto-2.1.0.win32-py2.7.exe
You are ready to extract the relevant scripts from the DeDRM calibre plugin!
unzip DeDRM_plugin.zip cp inept*py ~/.adewine/drive_c/Python27/Tools/Scripts/. cp adobekey.py ~/.adewine/drive_c/Python27/Tools/Scripts/.
The adobekey.py script allows you to generate the magic key that will unlock your DRMs: run
wine explorer /desktop=name,1024x768 python.exe adobekey.py
and take good note of the message telling you that the key was successfully added to, in my case, adobekey_1.der
.
You can now use ineptpdf.py to remove DRMs from your DRMed pdf files:
wine explorer /desktop=name,1024x768 python.exe ineptepdf.py
and ineptepub.py to remove DRMs from your DRMed epub files: wine explorer /desktop=name,1024x768 python.exe ineptepub.py
If you use calibre, which is a very nice tool to manage your library, you can now install the DeDRM calibre plugin as follows.
Open calibre.
In the upper menu bar, you'll find a "Preferences" menu. You might need to click on the tiny arrow at the far right of this bar to see all the possibilities.
Click "Plugins" then "Load plugin from file"
Pick DeDRM_calibre_plugin/DeDRM_plugin.zip
.
Click "Configure plugin". If you need to find this plugin again, it will be under "File type plugins".
Click "Import Existing Key Files"
Navigate to the .der key previously generated.
And voilà[1]!
Any DRMed epub, obtained under "My Digital Editions" after having opened an .acsm file with ADE, that you read in Calibre will be DeDRMed in calibre.
And now I can finally get on with my weekend.
Note
[1] No, not "viola". The viola is a wonderful instrument but "viola" is French for "raped", unlike "voilà" which is French for "here you go". Also, I've seen "raped carrots" (for "shredded carrots salad") way too often in the English version of the menus in French restaurant.