From 114c4988c0c75918c37dbd681274286d5aeec578 Mon Sep 17 00:00:00 2001 From: Jonah Weissman Date: Thu, 19 Jul 2018 20:00:25 -0400 Subject: [PATCH 1/3] Create CLI instructions --- CLI_INSTRUCTIONS.md | 47 +++++++++++++++++++++++++++++++++++++++++++++ FAQs.md | 2 ++ 2 files changed, 49 insertions(+) create mode 100644 CLI_INSTRUCTIONS.md diff --git a/CLI_INSTRUCTIONS.md b/CLI_INSTRUCTIONS.md new file mode 100644 index 0000000..7d9a83d --- /dev/null +++ b/CLI_INSTRUCTIONS.md @@ -0,0 +1,47 @@ +# Command Line Interface Installation Instructions + +If you're not a fan of GUIs, but you still want to take DRM off of your +ebooks, then this guide is for you. + +This guide assumes you are on Linux, but it may very well work on other +platforms. + +## Step-by-step Tutorial + +#### Install Calibre + - Follow [Calibre's installation instructions](https://calibre-ebook.com/download_linux) + +#### Install plugins + - Download the DeDRM `.zip` archive from DeDRM_tools' + [latest release](https://github.com/apprenticeharper/DeDRM_tools/releases/latest). + Then unzip it. + - Add the DeDRM plugin to Calibre: + ``` + cd *the unzipped DeDRM_tools folder* + calibre-customize --add DeDRM_calibre_plugin/DeDRM_plugin.zip + ``` + - Add the Obok plugin: + ``` + calibre-customize --add Obok_calibre_plugin/obok_plugin.zip + ``` + +#### Enter your keys + - Figure out what format DeDRM wants your key in by looking in + [the code that handles that](src/prefs.py). + - For Kindle eInk devices, DeDRM expects you to put a list of serial + numbers in the `serials` field: `"serials": ["012345689abcdef"]` or + `"serials": ["1111111111111111", "2222222222222222"]`. + - Now add your keys to `$CALIBRE_CONFIG_DIRECTORY/plugins/dedrm.json`. + +#### Import your books + - Make a library folder + ``` + mkdir library + ``` + - Add your book(s) with this command: + ``` + calibredb add /path/to/book.format --with-library=library + ``` + +The DRM should be removed from your book, which you can find in the `library` +folder. diff --git a/FAQs.md b/FAQs.md index d27a6dd..cf3dc38 100644 --- a/FAQs.md +++ b/FAQs.md @@ -180,6 +180,8 @@ The Macintosh DeDRM application creates a log file on your desktop every time it ## I cannot solve my problem with the Windows DeDRM application, and now I need to ‘post a log’. How do I do that? The Windows DeDRM application creates a log file in your home directory (C:\Users\[username]) every time it is run. After unsuccessfully removing DRM from one ebook, copy the contents of the log file (it is a simple text file) and paste it into your comment at Apprentice Alf's blog or in a new issue at Apprentice Harper's github repository. +## Is there a way to use the DeDRM tools from the command line? +See the [command line interface (CLI) instructions](CLI_INSTRUCTIONS.md). # General Questions From 63c8b28efd6a96e89f218d0e9ee0406452878af3 Mon Sep 17 00:00:00 2001 From: Jonah Weissman Date: Sat, 13 Oct 2018 14:34:47 -0400 Subject: [PATCH 2/3] Clarify CLI instructions are for Calibre plugin --- CLI_INSTRUCTIONS.md => CALIBRE_CLI_INSTRUCTIONS.md | 6 +++--- FAQs.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) rename CLI_INSTRUCTIONS.md => CALIBRE_CLI_INSTRUCTIONS.md (89%) diff --git a/CLI_INSTRUCTIONS.md b/CALIBRE_CLI_INSTRUCTIONS.md similarity index 89% rename from CLI_INSTRUCTIONS.md rename to CALIBRE_CLI_INSTRUCTIONS.md index 7d9a83d..d579348 100644 --- a/CLI_INSTRUCTIONS.md +++ b/CALIBRE_CLI_INSTRUCTIONS.md @@ -1,7 +1,7 @@ -# Command Line Interface Installation Instructions +# Using the DeDRM plugin with the Calibre command line interface -If you're not a fan of GUIs, but you still want to take DRM off of your -ebooks, then this guide is for you. +If you prefer the Calibre CLI instead of the GUI, follow this guide to +install and use the DeDRM plugin. This guide assumes you are on Linux, but it may very well work on other platforms. diff --git a/FAQs.md b/FAQs.md index cf3dc38..d892545 100644 --- a/FAQs.md +++ b/FAQs.md @@ -180,8 +180,8 @@ The Macintosh DeDRM application creates a log file on your desktop every time it ## I cannot solve my problem with the Windows DeDRM application, and now I need to ‘post a log’. How do I do that? The Windows DeDRM application creates a log file in your home directory (C:\Users\[username]) every time it is run. After unsuccessfully removing DRM from one ebook, copy the contents of the log file (it is a simple text file) and paste it into your comment at Apprentice Alf's blog or in a new issue at Apprentice Harper's github repository. -## Is there a way to use the DeDRM tools from the command line? -See the [command line interface (CLI) instructions](CLI_INSTRUCTIONS.md). +## Is there a way to use the DeDRM plugin for Calibre from the command line? +See the [Calibre command line interface (CLI) instructions](CALIBRE_CLI_INSTRUCTIONS.md). # General Questions From 454286b08b62edd393babd65eea424d99308d474 Mon Sep 17 00:00:00 2001 From: Mike Vastola Date: Wed, 14 Nov 2018 18:01:25 -0500 Subject: [PATCH 3/3] Small fix to bug in K4/Mobi DeDRM with unicode filenames. Fixes #658 --- src/k4mobidedrm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k4mobidedrm.py b/src/k4mobidedrm.py index 1ce1f35..c6ab3ab 100644 --- a/src/k4mobidedrm.py +++ b/src/k4mobidedrm.py @@ -269,7 +269,7 @@ def decryptBook(infile, outdir, kDatabaseFiles, androidFiles, serials, pids): re.match('^{0-9A-F-}{36}$', orig_fn_root) ): # Kindle for PC / Mac / Android / Fire / iOS clean_title = cleanup_name(book.getBookTitle()) - outfilename = '{}_{}'.format(orig_fn_root, clean_title) + outfilename = u'{}_{}'.format(orig_fn_root, clean_title) else: # E Ink Kindle, which already uses a reasonable name outfilename = orig_fn_root