Add empty placeholder file for LCP

This commit is contained in:
NoDRM 2022-01-11 07:57:02 +01:00
parent e54bb3f700
commit 2b46f61eae
2 changed files with 71 additions and 0 deletions

View File

@ -21,6 +21,7 @@ li {margin-top: 0.5em}
<p>Readium LCP is a relatively new eBook DRM. It's also known under the names "CARE DRM" or "TEA DRM". It does not rely on any accounts or key data that's difficult to acquire. All you need to open (or decrypt) LCP eBooks is the account passphrase given to you by the eBook provider - the very same passphrase you'd have to enter into your eBook reader device (once) to read LCP-encrypted books.</p> <p>Readium LCP is a relatively new eBook DRM. It's also known under the names "CARE DRM" or "TEA DRM". It does not rely on any accounts or key data that's difficult to acquire. All you need to open (or decrypt) LCP eBooks is the account passphrase given to you by the eBook provider - the very same passphrase you'd have to enter into your eBook reader device (once) to read LCP-encrypted books.</p>
<p>This plugin no longer supports removing the Readium LCP DRM due to a DMCA takedown request issued by Readium. Please read the <a href="https://github.com/github/dmca/blob/master/2022/01/2022-01-04-readium.md">takedown notice</a> or <a href="https://github.com/noDRM/DeDRM_tools/issues/18">this bug report</a> for more information.</p>
<h3>Entering an LCP passphrase:</h3> <h3>Entering an LCP passphrase:</h3>

70
DeDRM_plugin/lcpdedrm.py Normal file
View File

@ -0,0 +1,70 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# lcpdedrm.py
# Copyright © 2021-2022 NoDRM
# Released under the terms of the GNU General Public Licence, version 3
# <http://www.gnu.org/licenses/>
# Revision history:
# 1 - Initial release
# 2 - LCP DRM code removed due to a DMCA takedown.
"""
This file used to contain code to remove the Readium LCP DRM
from eBooks. Unfortunately, Readium has issued a DMCA takedown
request, so I was forced to remove that code:
https://github.com/github/dmca/blob/master/2022/01/2022-01-04-readium.md
This file now just returns an error message when asked to remove LCP DRM.
For more information, see this issue:
https://github.com/noDRM/DeDRM_tools/issues/18
"""
__license__ = 'GPL v3'
__version__ = "2"
import json
from zipfile import ZipFile
from contextlib import closing
class LCPError(Exception):
pass
# Check file to see if this is an LCP-protected file
def isLCPbook(inpath):
try:
with closing(ZipFile(open(inpath, 'rb'))) as lcpbook:
if ("META-INF/license.lcpl" not in lcpbook.namelist() or
"META-INF/encryption.xml" not in lcpbook.namelist() or
b"EncryptedContentKey" not in lcpbook.read("META-INF/encryption.xml")):
return False
license = json.loads(lcpbook.read('META-INF/license.lcpl'))
if "id" in license and "encryption" in license and "profile" in license["encryption"]:
return True
except:
return False
return False
# Takes a file and a list of passphrases
def decryptLCPbook(inpath, passphrases, parent_object):
if not isLCPbook(inpath):
raise LCPError("This is not an LCP-encrypted book")
print("LCP: LCP DRM removal no longer supported due to a DMCA takedown request.")
print("LCP: The takedown request can be found here: ")
print("LCP: https://github.com/github/dmca/blob/master/2022/01/2022-01-04-readium.md ")
print("LCP: More information can be found in the Github repository: ")
print("LCP: https://github.com/noDRM/DeDRM_tools/issues/18 ")
raise LCPError("LCP DRM removal no longer supported")