This commit is contained in:
NoDRM
2021-12-29 09:14:35 +01:00
parent 80f511ade9
commit 9c40b3ce5a
9 changed files with 24 additions and 463 deletions

View File

@@ -50,8 +50,8 @@ def decryptepub(infile, outdir, rscpath):
errlog += traceback.format_exc()
errlog += str(e)
rv = 1
# now try with ignoble epub
elif ignobleepub.ignobleBook(zippath):
# now try with ignoble epub
# try with any keyfiles (*.b64) in the rscpath
files = os.listdir(rscpath)
filefilter = re.compile("\.b64$", re.IGNORECASE)
@@ -62,7 +62,7 @@ def decryptepub(infile, outdir, rscpath):
userkey = open(keypath,'r').read()
#print userkey
try:
rv = ignobleepub.decryptBook(userkey, zippath, outfile)
rv = ineptepub.decryptBook(userkey, zippath, outfile)
if rv == 0:
print("Decrypted B&N ePub with key file {0}".format(filename))
break
@@ -121,7 +121,7 @@ def decryptpdb(infile, outdir, rscpath):
rv = 1
socialpath = os.path.join(rscpath,'sdrmlist.txt')
if os.path.exists(socialpath):
keydata = file(socialpath,'r').read()
keydata = open(socialpath,'r').read()
keydata = keydata.rstrip(os.linesep)
ar = keydata.split(',')
for i in ar:
@@ -148,7 +148,7 @@ def decryptk4mobi(infile, outdir, rscpath):
pidnums = []
pidspath = os.path.join(rscpath,'pidlist.txt')
if os.path.exists(pidspath):
pidstr = file(pidspath,'r').read()
pidstr = open(pidspath,'r').read()
pidstr = pidstr.rstrip(os.linesep)
pidstr = pidstr.strip()
if pidstr != '':
@@ -156,7 +156,7 @@ def decryptk4mobi(infile, outdir, rscpath):
serialnums = []
serialnumspath = os.path.join(rscpath,'seriallist.txt')
if os.path.exists(serialnumspath):
serialstr = file(serialnumspath,'r').read()
serialstr = open(serialnumspath,'r').read()
serialstr = serialstr.rstrip(os.linesep)
serialstr = serialstr.strip()
if serialstr != '':