Skip to content

Instantly share code, notes, and snippets.

Last active February 17, 2021 15:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
DeDRM Adobe Digital Edition Books
Convenient DeDRM Scripts
**NOTE**: read to find out what this gist is good for.
* ./ extracts Adobe Digital Editions private key and required files to DeDRM.
* ./dedrm: removes DRM from given ebook (pdf/epub)
If you are using this for the first time, make sure that you have authenticated your Adobe Digital Editions (ADE) and run './'. Import any DRM-protected file into ADE and run '':
It uses the already extracted private key under "config/adobekey.der" and two python scripts (for epub and pdf extensions respectively) which were originally part of the DeDRM Calibre plugins:
The jailbroken ebook is now in the root directory!
err () {
>&2 echo "$1"
exit 1
main() {
local readonly KEY="./conf/adobekey.der"
if [[ ! -r "${KEY}" ]]; then
err "Private Adobe Key not found!"
local readonly LIB="./lib"
if [[ ! -d "${LIB}" ]]; then
err "DeDRM python scripts not found!"
if [[ ! -r "$1" ]]; then
err "No file given to DeDRM!"
local readonly FILENAME="$(basename -- "$1")"
local readonly EXT="${FILENAME##*.}"
local libTarget="${LIB}/inept${EXT}.py"
python3 "${libTarget}" "${KEY}" "$1" "${FILENAME}"
main "$@" || exit 1
set -e
main() {
local readonly LIBPATH="$(pwd)/lib"
local readonly CONFPATH="$(pwd)/conf"
mkdir -p "${LIBPATH}"
mkdir -p "${CONFPATH}"
local winePrefix="${WINEPREFIX}"
if [[ -z "${winePrefix}" ]]; then
echo "WINEPREFIX not given, using defualt ('~/.ade')..."
export WINEPREFIX=~/.ade
echo "Downloading necessary scripts..."
wget --continue -i "sources.txt" -P "${LIBPATH}"
echo "Trying to extract Adobe private Key..."
local readonly KEYPATH="${CONFPATH}/adobekey.der"
if [[ -r "${KEYPATH}" ]]; then
echo "Private key found under '${CONFPATH}'".
wine python "${LIBPATH}/" "${CONFPATH}/adobekey.der"
main "$@" || exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment