(This post is an expansion of a thread originally posted to my Mastodon writing account)
Background, how to use this post, and warning
Late last year I downloaded my Kobo e-books to my Arch Linux computer through the Kobo desktop app and removed DRM protections using Calibre and the Obok plugin. See The Weird Rules Governing What We Download for general background information on DRM protections and why they are anti-consumer (link changed 2025-01-17). For my part I don’t like the reading software and environments that Kobo’s DRM restricted me to, and I want to own and control my purchases by being able to read and store my books freely without the risk of losing access to them.
I’ll detail the DRM process here to document it, and so others can follow along if they want. Let me know at my email (lj [at] ljwrites [dot] blog) or my Mastodon account above if you have comments or questions, I’ll try to help you and update the post accordingly. If you’re on Windows or Mac and don’t need to install the Kobo Desktop Edition through Wine, you can skip to the final section on Calibre and the Obok plugin.
WARNING (added 2025-01-17): Stripping DRM from your content may be ILLEGAL depending on your jurisdiction. This post comes with no warranties whatsoever that the described activity is legal where you are: There is a possibility that you may be subject to measures such as having your account removed, or to civil, criminal, and other liabilities. You should undertake de-DRM solely at your own risk and with whatever advice you feel you need, and I can take no responsibility for the consequences.
That said, as a practical matter you are unlikely to be detected or pursued as long as you keep your files for your own use on devices you own and don’t pirate the books by indiscriminately distributing them. You should refrain from piracy in most circumstances anyway, both to reduce your exposure to legal risk and as a basic courtesy to authors who depend not only on income from sales but also on sales figures for career options and algorithmic promotion.
The warning above, incidentally, is exactly why individually implemented technological fixes are not a replacement for regulatory changes. DRM needs to be destroyed or overhauled, not simply tiptoed around, and I recognize that options available to a few technically skilled individuals who are willing to brave some legal risk are a stopgap at best, for much the same reasons that Self-Hosting Isn’t a Solution; It’s a Patch. Tutorials like this one are workarounds for a few and obviously do not scale like solutions and improvements at a societal level.
Set up Wine for a 32-bit installation
For me, setting up Wine on my 64-bit architecture for a 32-bit installation was the most time-consuming part of the process. I’m not even sure why I’m supposed to trick Wine into thinking it’s on a 32-bit architecture, but it didn’t work until I did.
You can check your kernel architecture with uname -a
.
Here’s my output:
|
|
The x86_64
part means it’s a 64-bit architecture.
Outputs such as i386
and i686
are 32-bit.
Though I already had a Wine installation, I kept getting architecture-related errors so I uninstalled and reinstalled everything Wine-related:
|
|
I then set environmental variables to get Wine working in 32-bit mode:
|
|
(.wine32
is just a random blank directory I created under my home directory because the default .wine directory is 64-bit and was giving me errors.)
Since environmental variables exported from the terminal will only last for that session, I also put the following lines in ~/.bashrc
to make the variables persistent:
|
|
Originally I had $WINEPREFIX
set to a prefix
subdirectory under ~/.wine32
as seen below, per advice I saw on a forum, but for me it worked either way.
If the above $WINEPREFIX
does not work, maybe having it point to a subdirectory will, like so:
|
|
Install Kobo Desktop Edition through Wine
After setting up Wine, I downloaded the kobosetup.exe
file.
Because nothing can ever be easy, the download button reached through https://kobosetup.com didn’t work for me and I had to search the button text (“Download now”) in the page source and then the id of that button for the href attribute.
As of the date of this blog post (January 12, 2025) the direct link to the file is https://cdn.kobo.com/downloads/desktop/kobodesktop/kobosetup.exe , but that may change in the future.
I then executed the file through Wine:
|
|
The output stalled so I assumed it didn’t work, but when I navigated to the directory manually I found the installation and ran the executable:
|
|
As a convenience function I also put a shorthand alias in my ~/.bashrc
to open Kobo Desktop Edition with a simple command, in my case kobo
.
|
|
I logged into my account on the Kobo Desktop Edition app and downloaded all the books in my library. The app should be shut down before the next step, which is the actual de-DRM process using the Obok plugin.
Remove DRM with the Obok plugin on Calibre
I already had Calibre installed through the Arch Linux repository:
|
|
Obok is part of DeDRM Tools, available through the Github repo.
Unzip the file and obok_plugin.zip
should be one of the files that appear in the folder.
As detailed in the repository’s readme file, open Calibre and navigate to Preferences > Plugins and then the “Load plugin from file” button at the bottom of the Plugins window.
Select the obok_plugin.zip
file from the file navigation that pops up.
Choose what menus to access Obok through, then click through the installation.
I then configured Obok through Preferences > Plugins > Obok to manually set the Kobo Desktop Edition library folder that Obok should access.
In my case the directory was ~/.wine32/drive_c/users/lj/AppData/Local/Kobo/Kobo Desktop Edition
.
I think the folder is automatically detected on Windows and Mac.
Maybe there’s auto-detect on Linux systems, too, but it didn’t happen for me, maybe because I installed Obok before Kobo Desktop Edition.
Click on the Obok icon, which in my case is on the top menu bar of Calibre, and a popup window will show decrypted versions of books downloaded through Kobo Desktop Edition. All that remains is to import them into the Calibre library as DRM-free epubs that you can read on any device and software that supports the format.
Conclusion and postscript
Since de-DRM-ing my Kobo library I’ve been reading my epubs on everything from the Emacs nov-mode package on desktop to Foliate on Steam Deck’s desktop mode (a.k.a. my second Arch machine). It’s made reading ebooks more fun and I’ve been reading more as a result. My decrypted books are also in local and remote locations through my usual backups, so I know I won’t lose access to them by some whim of the bookshop or publisher.
I hope DRM removal will be a similarly positive experience for others, especially those like me with large Kobo libraries.