mirror of
https://github.com/noDRM/DeDRM_tools.git
synced 2026-03-20 04:58:56 +00:00
Compare commits
4 Commits
97eab0c1d7
...
4537288efb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4537288efb | ||
|
|
b9bad26d4b | ||
|
|
2a1413297e | ||
|
|
ad33aea18d |
8
.github/ISSUE_TEMPLATE/QUESTION.yml
vendored
8
.github/ISSUE_TEMPLATE/QUESTION.yml
vendored
@@ -10,16 +10,16 @@ body:
|
|||||||
id: calibre-version
|
id: calibre-version
|
||||||
attributes:
|
attributes:
|
||||||
label: Which version of Calibre are you running?
|
label: Which version of Calibre are you running?
|
||||||
description: "Example: 5.32"
|
description: "Example: 6.23"
|
||||||
placeholder: "5.32"
|
placeholder: "6.23"
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: input
|
- type: input
|
||||||
id: plugin-version
|
id: plugin-version
|
||||||
attributes:
|
attributes:
|
||||||
label: Which version of the DeDRM plugin are you running?
|
label: Which version of the DeDRM plugin are you running?
|
||||||
description: "Example: v10.0.0"
|
description: "Example: v10.0.2"
|
||||||
placeholder: "v10.0.0"
|
placeholder: "v10.0.2"
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: input
|
- type: input
|
||||||
|
|||||||
10
CHANGELOG.md
10
CHANGELOG.md
@@ -67,7 +67,11 @@ List of changes since the fork of Apprentice Harper's repository:
|
|||||||
- Fix Nook Study key retrieval code (partially fixes #50).
|
- Fix Nook Study key retrieval code (partially fixes #50).
|
||||||
- Make the plugin work on Calibre 6 (Qt 6). (fixes #54 and #98) If you're running Calibre 6 and you notice any issues, please open a bug report.
|
- Make the plugin work on Calibre 6 (Qt 6). (fixes #54 and #98) If you're running Calibre 6 and you notice any issues, please open a bug report.
|
||||||
|
|
||||||
## Fixes on master (not yet released):
|
## Fixes in v10.0.9 (RC for v10.1.0, 2023-08-02):
|
||||||
|
|
||||||
|
Note that versions v10.0.4(s), v10.0.5(s) and v10.0.6(s) were released by other people in various forks, so I have decided to make a larger version jump so there are no conflicting version numbers / different builds with the same version number.
|
||||||
|
|
||||||
|
This is v10.0.9, a release candidate for v10.1.0. I don't expect there to be major issues / bugs, but since a lot of code has changed in the last year I wanted to get some "extended testing" before this becomes v10.1.0.
|
||||||
|
|
||||||
- Fix a bug introduced with #48 that breaks DeDRM'ing on Calibre 4 (fixes #101).
|
- Fix a bug introduced with #48 that breaks DeDRM'ing on Calibre 4 (fixes #101).
|
||||||
- Fix some more Calibre-6 bugs in the Obok plugin (should fix #114).
|
- Fix some more Calibre-6 bugs in the Obok plugin (should fix #114).
|
||||||
@@ -92,3 +96,7 @@ List of changes since the fork of Apprentice Harper's repository:
|
|||||||
- Two bugfixes for Amazon DeDRM from Satuoni ( https://github.com/noDRM/DeDRM_tools/issues/315#issuecomment-1508305428 ) and andrewc12 ( https://github.com/andrewc12/DeDRM_tools/commit/d9233d61f00d4484235863969919059f4d0b2057 ) that might make the plugin work with newer versions.
|
- Two bugfixes for Amazon DeDRM from Satuoni ( https://github.com/noDRM/DeDRM_tools/issues/315#issuecomment-1508305428 ) and andrewc12 ( https://github.com/andrewc12/DeDRM_tools/commit/d9233d61f00d4484235863969919059f4d0b2057 ) that might make the plugin work with newer versions.
|
||||||
- Fix font decryption not working with some books (fixes #347), thanks for the patch @bydioeds.
|
- Fix font decryption not working with some books (fixes #347), thanks for the patch @bydioeds.
|
||||||
- Fix a couple unicode errors for Python2 in Kindle and Nook code.
|
- Fix a couple unicode errors for Python2 in Kindle and Nook code.
|
||||||
|
|
||||||
|
## Fixes on master (not yet released):
|
||||||
|
|
||||||
|
- (none)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ p {margin-top: 0}
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>DeDRM Plugin <span class="version">(v10.0.3)</span></h1>
|
<h1>DeDRM Plugin <span class="version">(v10.0.9 / v10.1.0 RC1)</span></h1>
|
||||||
|
|
||||||
<p>This plugin removes DRM from ebooks when they are imported into calibre. If you already have DRMed ebooks in your calibre library, you will need to remove them and import them again.</p>
|
<p>This plugin removes DRM from ebooks when they are imported into calibre. If you already have DRMed ebooks in your calibre library, you will need to remove them and import them again.</p>
|
||||||
|
|
||||||
@@ -26,6 +26,8 @@ p {margin-top: 0}
|
|||||||
<h3>Installation</h3>
|
<h3>Installation</h3>
|
||||||
<p>You have obviously managed to install the plugin, as otherwise you wouldn’t be reading this help file. However, you should also delete any older DRM removal plugins, as this DeDRM plugin replaces the five older plugins: Kindle and Mobipocket DeDRM (K4MobiDeDRM), Ignoble Epub DeDRM (ignobleepub), Inept Epub DeDRM (ineptepub), Inept PDF DeDRM (ineptepub) and eReader PDB 2 PML (eReaderPDB2PML).</p>
|
<p>You have obviously managed to install the plugin, as otherwise you wouldn’t be reading this help file. However, you should also delete any older DRM removal plugins, as this DeDRM plugin replaces the five older plugins: Kindle and Mobipocket DeDRM (K4MobiDeDRM), Ignoble Epub DeDRM (ignobleepub), Inept Epub DeDRM (ineptepub), Inept PDF DeDRM (ineptepub) and eReader PDB 2 PML (eReaderPDB2PML).</p>
|
||||||
|
|
||||||
|
<p>This plugin (in versions v10.0.0 and above) will automatically replace the older 7.X and below versions from Apprentice Alf and Apprentice Harper.</p>
|
||||||
|
|
||||||
<h3>Configuration</h3>
|
<h3>Configuration</h3>
|
||||||
<p>On Windows and Mac, the keys for ebooks downloaded for Kindle for Mac/PC and Adobe Digital Editions are automatically generated. If all your DRMed ebooks can be opened and read in Kindle for Mac/PC and/or Adobe Digital Editions on the same computer on which you are running calibre, you do not need to do any configuration of this plugin. On Linux, keys for Kindle for PC and Adobe Digital Editions need to be generated separately (see the Linux section below).</p>
|
<p>On Windows and Mac, the keys for ebooks downloaded for Kindle for Mac/PC and Adobe Digital Editions are automatically generated. If all your DRMed ebooks can be opened and read in Kindle for Mac/PC and/or Adobe Digital Editions on the same computer on which you are running calibre, you do not need to do any configuration of this plugin. On Linux, keys for Kindle for PC and Adobe Digital Editions need to be generated separately (see the Linux section below).</p>
|
||||||
|
|
||||||
@@ -60,7 +62,7 @@ p {margin-top: 0}
|
|||||||
<li>And probably many more.</li>
|
<li>And probably many more.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>For additional help read the <a href="https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md">FAQs</a> at <a href="https://github.com/noDRM/DeDRM_tools">NoDRM's GitHub repository</a> (or the corresponding <a href="https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md">FAQs</a> at <a href="https://github.com/apprenticeharper/DeDRM_tools/">Apprentice Harpers’s GitHub repository</a>). You can <a href="https://github.com/noDRM/DeDRM_tools/issues">open issue reports</a>related to this fork at NoDRM's GitHub repository.</h3>
|
<h4>For additional help read the <a href="https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md">FAQs</a> at <a href="https://github.com/noDRM/DeDRM_tools">NoDRM's GitHub repository</a> (or the corresponding <a href="https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md">FAQs</a> at <a href="https://github.com/apprenticeharper/DeDRM_tools/">Apprentice Harpers’s GitHub repository</a>). You can <a href="https://github.com/noDRM/DeDRM_tools/issues">open issue reports</a> related to this fork at NoDRM's GitHub repository.</h4>
|
||||||
|
|
||||||
|
|
||||||
<h2>Linux Systems Only</h2>
|
<h2>Linux Systems Only</h2>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from __future__ import print_function
|
|||||||
|
|
||||||
# __init__.py for DeDRM_plugin
|
# __init__.py for DeDRM_plugin
|
||||||
# Copyright © 2008-2020 Apprentice Harper et al.
|
# Copyright © 2008-2020 Apprentice Harper et al.
|
||||||
# Copyright © 2021 NoDRM
|
# Copyright © 2021-2023 NoDRM
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
@@ -82,6 +82,7 @@ __docformat__ = 'restructuredtext en'
|
|||||||
# 10.0.0 - First forked version by NoDRM. See CHANGELOG.md for details.
|
# 10.0.0 - First forked version by NoDRM. See CHANGELOG.md for details.
|
||||||
# 10.0.1 - Fixes a bug in the watermark code.
|
# 10.0.1 - Fixes a bug in the watermark code.
|
||||||
# 10.0.2 - Fix Kindle for Mac & update Adobe key retrieval
|
# 10.0.2 - Fix Kindle for Mac & update Adobe key retrieval
|
||||||
|
# For changes made in 10.0.3 and above, see the CHANGELOG.md file
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Decrypt DRMed ebooks.
|
Decrypt DRMed ebooks.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#@@CALIBRE_COMPAT_CODE@@
|
#@@CALIBRE_COMPAT_CODE@@
|
||||||
|
|
||||||
PLUGIN_NAME = "DeDRM"
|
PLUGIN_NAME = "DeDRM"
|
||||||
__version__ = '10.0.3'
|
__version__ = '10.0.9'
|
||||||
|
|
||||||
PLUGIN_VERSION_TUPLE = tuple([int(x) for x in __version__.split(".")])
|
PLUGIN_VERSION_TUPLE = tuple([int(x) for x in __version__.split(".")])
|
||||||
PLUGIN_VERSION = ".".join([str(x)for x in PLUGIN_VERSION_TUPLE])
|
PLUGIN_VERSION = ".".join([str(x)for x in PLUGIN_VERSION_TUPLE])
|
||||||
|
|||||||
@@ -7,6 +7,18 @@ from __future__ import absolute_import, print_function
|
|||||||
|
|
||||||
# Copyright © 2021 NoDRM
|
# Copyright © 2021 NoDRM
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
NOTE: This code is not functional (yet). I started working on it a while ago
|
||||||
|
to make a standalone version of the plugins that could work without Calibre,
|
||||||
|
too, but for now there's only a rough code structure and no working code yet.
|
||||||
|
|
||||||
|
Currently, to use these plugins, you will need to use Calibre. Hopwfully that'll
|
||||||
|
change in the future.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
OPT_SHORT_TO_LONG = [
|
OPT_SHORT_TO_LONG = [
|
||||||
["c", "config"],
|
["c", "config"],
|
||||||
["e", "extract"],
|
["e", "extract"],
|
||||||
|
|||||||
@@ -8,6 +8,17 @@ from __future__ import absolute_import, print_function
|
|||||||
|
|
||||||
# Taken from Calibre code - Copyright © 2008, Kovid Goyal kovid@kovidgoyal.net, GPLv3
|
# Taken from Calibre code - Copyright © 2008, Kovid Goyal kovid@kovidgoyal.net, GPLv3
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
NOTE: This code is not functional (yet). I started working on it a while ago
|
||||||
|
to make a standalone version of the plugins that could work without Calibre,
|
||||||
|
too, but for now there's only a rough code structure and no working code yet.
|
||||||
|
|
||||||
|
Currently, to use these plugins, you will need to use Calibre. Hopwfully that'll
|
||||||
|
change in the future.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
#@@CALIBRE_COMPAT_CODE@@
|
#@@CALIBRE_COMPAT_CODE@@
|
||||||
|
|
||||||
import sys, os, codecs, json
|
import sys, os, codecs, json
|
||||||
|
|||||||
@@ -8,6 +8,17 @@ from __future__ import absolute_import, print_function
|
|||||||
|
|
||||||
# Copyright © 2021 NoDRM
|
# Copyright © 2021 NoDRM
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
NOTE: This code is not functional (yet). I started working on it a while ago
|
||||||
|
to make a standalone version of the plugins that could work without Calibre,
|
||||||
|
too, but for now there's only a rough code structure and no working code yet.
|
||||||
|
|
||||||
|
Currently, to use these plugins, you will need to use Calibre. Hopwfully that'll
|
||||||
|
change in the future.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
#@@CALIBRE_COMPAT_CODE@@
|
#@@CALIBRE_COMPAT_CODE@@
|
||||||
|
|
||||||
import os, sys
|
import os, sys
|
||||||
|
|||||||
@@ -8,6 +8,17 @@ from __future__ import absolute_import, print_function
|
|||||||
|
|
||||||
# Copyright © 2021 NoDRM
|
# Copyright © 2021 NoDRM
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
NOTE: This code is not functional (yet). I started working on it a while ago
|
||||||
|
to make a standalone version of the plugins that could work without Calibre,
|
||||||
|
too, but for now there's only a rough code structure and no working code yet.
|
||||||
|
|
||||||
|
Currently, to use these plugins, you will need to use Calibre. Hopwfully that'll
|
||||||
|
change in the future.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
#@@CALIBRE_COMPAT_CODE@@
|
#@@CALIBRE_COMPAT_CODE@@
|
||||||
|
|
||||||
import os, sys
|
import os, sys
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from __future__ import (unicode_literals, division, absolute_import,
|
|||||||
print_function)
|
print_function)
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__version__ = '10.0.3'
|
__version__ = '10.0.9'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
@@ -20,7 +20,7 @@ except NameError:
|
|||||||
PLUGIN_NAME = 'Obok DeDRM'
|
PLUGIN_NAME = 'Obok DeDRM'
|
||||||
PLUGIN_SAFE_NAME = PLUGIN_NAME.strip().lower().replace(' ', '_')
|
PLUGIN_SAFE_NAME = PLUGIN_NAME.strip().lower().replace(' ', '_')
|
||||||
PLUGIN_DESCRIPTION = _('Removes DRM from Kobo kepubs and adds them to the library.')
|
PLUGIN_DESCRIPTION = _('Removes DRM from Kobo kepubs and adds them to the library.')
|
||||||
PLUGIN_VERSION_TUPLE = (10, 0, 3)
|
PLUGIN_VERSION_TUPLE = (10, 0, 9)
|
||||||
PLUGIN_VERSION = '.'.join([str(x) for x in PLUGIN_VERSION_TUPLE])
|
PLUGIN_VERSION = '.'.join([str(x) for x in PLUGIN_VERSION_TUPLE])
|
||||||
HELPFILE_NAME = PLUGIN_SAFE_NAME + '_Help.htm'
|
HELPFILE_NAME = PLUGIN_SAFE_NAME + '_Help.htm'
|
||||||
PLUGIN_AUTHORS = 'Anon'
|
PLUGIN_AUTHORS = 'Anon'
|
||||||
|
|||||||
@@ -168,8 +168,8 @@
|
|||||||
"""Manage all Kobo books, either encrypted or DRM-free."""
|
"""Manage all Kobo books, either encrypted or DRM-free."""
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
__version__ = '10.0.1'
|
__version__ = '10.0.9'
|
||||||
__about__ = "Obok v{0}\nCopyright © 2012-2022 Physisticated et al.".format(__version__)
|
__about__ = "Obok v{0}\nCopyright © 2012-2023 Physisticated et al.".format(__version__)
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
@@ -327,36 +327,50 @@ class KoboLibrary(object):
|
|||||||
elif sys.platform.startswith('darwin'):
|
elif sys.platform.startswith('darwin'):
|
||||||
self.kobodir = os.path.join(os.environ['HOME'], "Library", "Application Support", "Kobo", "Kobo Desktop Edition")
|
self.kobodir = os.path.join(os.environ['HOME'], "Library", "Application Support", "Kobo", "Kobo Desktop Edition")
|
||||||
elif sys.platform.startswith('linux'):
|
elif sys.platform.startswith('linux'):
|
||||||
|
# Since on Linux, you have to run Kobo Desktop within Wine,
|
||||||
|
# there is no guarantee where Kobo.sqlite (and the rest of
|
||||||
|
# the kobo directory) might be.
|
||||||
|
#
|
||||||
|
# It should also be noted that Kobo Desktop will store all
|
||||||
|
# of it files in the current directory where you run it,
|
||||||
|
# meaning that a user might accidentally create several
|
||||||
|
# Kobo.sqlite files which are all separate and then be
|
||||||
|
# confused why Obok can't find any of the new books. Sadly
|
||||||
|
# there isn't a trivial way to deal with this.
|
||||||
|
|
||||||
#sets ~/.config/calibre as the location to store the kobodir location info file and creates this directory if necessary
|
# We cache the kobodir we find in ~/.config/calibre.
|
||||||
kobodir_cache_dir = os.path.join(os.environ['HOME'], ".config", "calibre")
|
kobodir_cache_dir = os.path.join(os.environ['HOME'], ".config", "calibre", "plugins", "obok")
|
||||||
if not os.path.isdir(kobodir_cache_dir):
|
if not os.path.isdir(kobodir_cache_dir):
|
||||||
os.mkdir(kobodir_cache_dir)
|
os.mkdir(kobodir_cache_dir)
|
||||||
|
kobodir_cache_file = os.path.join(kobodir_cache_dir, "kobo-location")
|
||||||
|
|
||||||
#appends the name of the file we're storing the kobodir location info to the above path
|
try:
|
||||||
kobodir_cache_file = str(kobodir_cache_dir) + "/" + "kobo location"
|
# If the cached version exists and the path does really
|
||||||
|
# contain Kobo.sqlite, use that.
|
||||||
|
with open(kobodir_cache_file, "r") as f:
|
||||||
|
cached_kobodir = f.read().strip()
|
||||||
|
assert os.path.isfile(os.path.join(cached_kobodir, "Kobo.sqlite"))
|
||||||
|
self.kobodir = cached_kobodir
|
||||||
|
except (AssertionError, FileNotFoundError):
|
||||||
|
# If there was no cached version, search the entire
|
||||||
|
# filesystem tree for a directory containing
|
||||||
|
# "Kobo.sqlite".
|
||||||
|
#
|
||||||
|
# We first search $HOME to avoid picking another user's
|
||||||
|
# Kobo.sqlite file, but then fallback to / if there was
|
||||||
|
# nothing in $HOME.
|
||||||
|
for candidate_root in (os.environ["HOME"], "/"):
|
||||||
|
for root, _, files in os.walk(candidate_root):
|
||||||
|
if "Kobo.sqlite" in files:
|
||||||
|
with open(kobodir_cache_file, "w") as f:
|
||||||
|
f.write("%s/\n" % (root,))
|
||||||
|
self.kobodir = root
|
||||||
|
break
|
||||||
|
|
||||||
"""if the above file does not exist, recursively searches from the root
|
# Desktop versions use Kobo.sqlite.
|
||||||
of the filesystem until kobodir is found and stores the location of kobodir
|
|
||||||
in that file so this loop can be skipped in the future"""
|
|
||||||
original_stdout = sys.stdout
|
|
||||||
if not os.path.isfile(kobodir_cache_file):
|
|
||||||
for root, dirs, files in os.walk('/'):
|
|
||||||
for file in files:
|
|
||||||
if file == 'Kobo.sqlite':
|
|
||||||
kobo_linux_path = str(root)
|
|
||||||
with open(kobodir_cache_file, 'w') as f:
|
|
||||||
sys.stdout = f
|
|
||||||
print(kobo_linux_path, end='')
|
|
||||||
sys.stdout = original_stdout
|
|
||||||
|
|
||||||
f = open(kobodir_cache_file, 'r' )
|
|
||||||
self.kobodir = f.read()
|
|
||||||
|
|
||||||
# desktop versions use Kobo.sqlite
|
|
||||||
kobodb = os.path.join(self.kobodir, "Kobo.sqlite")
|
kobodb = os.path.join(self.kobodir, "Kobo.sqlite")
|
||||||
# check for existence of file
|
# check for existence of file
|
||||||
if (not(os.path.isfile(kobodb))):
|
if not os.path.isfile(kobodb):
|
||||||
# give up here, we haven't found anything useful
|
# give up here, we haven't found anything useful
|
||||||
self.kobodir = u""
|
self.kobodir = u""
|
||||||
kobodb = u""
|
kobodb = u""
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>Obok DeDRM Plugin</h1>
|
<h1>Obok DeDRM Plugin</h1>
|
||||||
<h3>(version 10.0.2)</h3>
|
<h3>(version 10.0.9 / 10.1.0 RC1)</h3>
|
||||||
|
|
||||||
<h3>Installation:</h3>
|
<h3>Installation:</h3>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user