08 January 2013

Alternate method - Linux, Calibre, e-books (epub) and DRM


You may already have read my previous post, where I examined the utterly ludicrous situation that Linux users are placed in if they want to buy, download and finally read an ebook on their ebook reader.

You may recall me mentioning that I had given you the long version.  This post will cover off on the slightly less long version – this is the Calibre plugins version.

Same as before, note that for this exercise, I'm using Linux Mint 14 (Nadia) XFCE.   Also, I'm assuming that the ebook that you purchased was DRM protected by Adobe's Digital Editions software and is in the .epub format.  Most lending libraries use the .epub format for their ebooks, so if you plan on using a library, this will help.  Sadly, if you have a Kindle, this will not help you.  Apologies, however you may notice later on in this that we will be downloading a plugin for Kindle users.  We'll pretty much leave it at that and go no further with that or any other plugins in this post.

Once again, please note that this process cracks DRM off .epub files.  Linux users, there are no other ways to use files that you have paid for without removing the DRM, but this process can also potentially be misused.  Misuse can be extremely illegal.  Please, for the love of FSM, don't misuse this or the other process, because repeated misuse will mean that publishers and retailers will make things twice as difficult for us in the long run as they continue to rubber-glove both us, the consumers and most of the authors who provide them with content.

That out of the way, let's get started.

1.-11. Steps 1. to 11.

If you haven't already done so, follow steps 1 to 11 in my previous post.

We'll deviate slightly in step 12 onwards.

12. Download Tools v5.5.3

These can be downloaded from here.

Right click on the “Download” button on the LEFT and select “save as” and don't click the frankly fraudulent advertising link that says “Download Now” on the right.  I had to have this one pointed out to me, as it doesn't show to me – I use ABP in Firefox and don't see much advertising anymore.

It's worth checking in with this page of Apprentice Alf's.  He will generally have a link to the most up to date box of tricks in this collection.

13.  Install plugin(s) in Calibre

See that .zip file that you just downloaded?  It's got the plugins in it.

Extract the contents of the .zip file into a new folder – I recommend that you create a folder within the folder that you created to house the Python scripts from step 6.

Open Calibre up.

Click on Preferences.  If you can't find Preferences, click on the right-arrows at the right hand end of the top row of icons.  You'll find it.


The Calibre preferences screen will open in a new window.  Scroll down to the bottom left and select Plugins.  The plugins screen should open up.

From the bottom, select “Load plugin from file”.


Navigate to the folder that contains the freshly extracted files that were in the .zip file that you downloaded.  There should be a folder there titled “Calibre_Plugins”.  Go into that and select the ineptepub_v02.0_plugin.zip file that is in that folder.  While you're here, you could do this for each of the .zip files in that folder – installation is similar, but we will not cover these today.

When you're finished, click on “Apply” on the top left, and “Close” in the Preferences window.  Finally, close Calibre and restart it.  And then, you should exit once again.

The plugins will not be useful yet.  In this post, I'm going to cover off on ensuring that the Ineptepub one works, but we have a couple of things left to do first.

14.  Run ineptkey.pyw (Python script)

The set that you downloaded in Step 6 included two Python scripts should be run in Wine.  This process only needs one of these.  Open a terminal and navigate your way into the folder that contains your Python scripts.

Start with the ineptkey script.  Copy and paste this into your terminal:

playonlinux ineptkey.pyw

You'll see a few things happen, and even a couple of errors.  Hopefully, though, none of these should be fatal.  If all goes well, you should be met by this message:


Woo hoo!

But where's the key?  Go into your virtual ADE drive, in the drive_c/Python26 folder and you should be able to find a file named "adeptkey.der".  Copy and past this into both the folder where you kept Python, PyCrypto and the Python scripts, and also into your .config/calibre/plugins folder in your home folder.  It is absolutely necessary that it goes into the last one.

Edit (21/01/2012): Reader Arc has pointed out that the adeptkey.der file needs to go into ~/.config/calibre, not the /plugins folder that is within that. I did both and didn't notice.

At this point you should also go into your My Digital Editions folder, locate the .epub file that you just "decrypted" with Digital Editions in step 11 and copy it.  Go back to your Books folder and create two new folders in that.  I call one "Dirty" and one "Clean".  Paste the .epub file that you copied into the Dirty folder.

15.  Add file to your Calibre library

To ensure that the file is appropriately cleaned, you should do this from the command line as follows.

Open a terminal, navigate to your Dirty folder and type:

calibredb add filename.epub

Where "filename.epub" is the filename of your ebook. If you are successful, you should see this message in the terminal:

Inept Epub DeDRM v0.2.0: Encryption successfully removed.

(You may also see an error if you loaded the Ignoble plugin, but that's OK)

When you open Calibre, your new, clean file will be smiling back at you, as if to say, “Download me on to your ebook reader!”.

And that is that.  Happy reading!

6 comments:

M.Smith said...

Calibre plugin does not work with Adobe Digital Editions 2.0

Help? Advise? Please?

Smith
Quality Web Programmer

Dikkii said...

Hi M. Smith.

You may want to read what I wrote in the link provided in steps 1-11. The link goes back to my previous post which discusses this issue at length at step 3.

In other words, use Adobe Digital Editions version 1.7, not 2.0.

Anonymous said...

The second part of step 14 can be simplified slightly. It's not necessary to copy the adaptkey.der file anywhere because the plugin configuration includes an Import facility. Click the "Import Existing Keyfiles" button and paste the full path to the file (copied from your favorite file manager) into the box.

But that's a minor quibble. Thanks very much for the comprehensive tutorials. It works great, first time. I can borrow Overdrive books and read them in Calibre. Excellent!

Andy said...

Any ideas on how to de drm a pdf file encrypted by drumlin? We've bought a text book for my son but there are no readers available for linux (ubuntu) users.

Dikkii said...

Not sure Andy, but I am intrigued by this. I'll look into it.

Thanks.

Paul said...

Thanks for the excellent tutorial.
One question:The ADE 1.7 I have installed is counting down a "time to update to a new version" warning.What will happen /what should I do, when this reaches zero?