Merge branch 'master' into modernize-Python-2-codes
This commit is contained in:
@@ -88,6 +88,11 @@ import zipfile
|
||||
import traceback
|
||||
from zipfile import ZipFile
|
||||
|
||||
import erdr2pml
|
||||
import ineptpdf
|
||||
import k4mobidedrm
|
||||
import zipfix
|
||||
|
||||
class DeDRMError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
@@ -880,7 +880,7 @@ class AddSerialDialog(QDialog):
|
||||
|
||||
@property
|
||||
def key_value(self):
|
||||
return unicode(self.key_ledit.text()).strip()
|
||||
return unicode(self.key_ledit.text()).replace(' ', '')
|
||||
|
||||
def accept(self):
|
||||
if len(self.key_name) == 0 or self.key_name.isspace():
|
||||
|
||||
@@ -49,7 +49,7 @@ from __future__ import print_function
|
||||
|
||||
__version__ = '1.01'
|
||||
|
||||
import sys, struct, os
|
||||
import sys, struct, os, traceback
|
||||
import zlib
|
||||
import zipfile
|
||||
import xml.etree.ElementTree as etree
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
|
||||
|
||||
from __future__ import print_function
|
||||
from .convert2xml import encodeNumber
|
||||
|
||||
class Unbuffered:
|
||||
def __init__(self, stream):
|
||||
self.stream = stream
|
||||
|
||||
@@ -21,19 +21,24 @@ from Crypto.Cipher import AES
|
||||
from Crypto.Util.py3compat import bchr, bord
|
||||
|
||||
try:
|
||||
# lzma library from calibre 2.35.0 or later
|
||||
import lzma.lzma1 as calibre_lzma
|
||||
# lzma library from calibre 4.6.0 or later
|
||||
import calibre_lzma.lzma1 as calibre_lzma
|
||||
except ImportError:
|
||||
calibre_lzma = None
|
||||
# lzma library from calibre 2.35.0 or later
|
||||
try:
|
||||
import lzma
|
||||
import lzma.lzma1 as calibre_lzma
|
||||
except ImportError:
|
||||
# Need pip backports.lzma on Python <3.3
|
||||
calibre_lzma = None
|
||||
try:
|
||||
from backports import lzma
|
||||
import lzma
|
||||
except ImportError:
|
||||
# Windows-friendly choice: pylzma wheels
|
||||
import pylzma as lzma
|
||||
# Need pip backports.lzma on Python <3.3
|
||||
try:
|
||||
from backports import lzma
|
||||
except ImportError:
|
||||
# Windows-friendly choice: pylzma wheels
|
||||
import pylzma as lzma
|
||||
|
||||
|
||||
TID_NULL = 0
|
||||
|
||||
@@ -40,6 +40,12 @@ from struct import pack, unpack, unpack_from
|
||||
import json
|
||||
import getopt
|
||||
|
||||
try:
|
||||
RegError
|
||||
except NameError:
|
||||
class RegError(Exception):
|
||||
pass
|
||||
|
||||
# Routines common to Mac and PC
|
||||
|
||||
# Wrap a stream so that output gets flushed immediately
|
||||
@@ -1302,7 +1308,7 @@ elif isosx:
|
||||
uuids = []
|
||||
uuidnum = os.getenv('MYUUIDNUMBER')
|
||||
if uuidnum != None:
|
||||
uuids.append(strip(uuidnum))
|
||||
uuids.append(uuidnum.strip())
|
||||
cmdline = '/usr/sbin/ioreg -l -S -w 0 -r -c AppleAHCIDiskDriver'
|
||||
cmdline = cmdline.encode(sys.getfilesystemencoding())
|
||||
p = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
|
||||
|
||||
@@ -525,7 +525,7 @@ def cli_main():
|
||||
else:
|
||||
infile = argv[1]
|
||||
outfile = argv[2]
|
||||
if len(argv) is 4:
|
||||
if len(argv) == 4:
|
||||
pidlist = argv[3].split(',')
|
||||
else:
|
||||
pidlist = []
|
||||
|
||||
@@ -11,7 +11,7 @@ def load_pycrypto():
|
||||
class DES(object):
|
||||
def __init__(self, key):
|
||||
if len(key) != 8 :
|
||||
raise Error('DES improper key used')
|
||||
raise ValueError('DES improper key used')
|
||||
self.key = key
|
||||
self._des = _DES.new(key,_DES.MODE_ECB)
|
||||
def desdecrypt(self, data):
|
||||
|
||||
@@ -115,6 +115,7 @@ def decryptpdf(infile, outdir, rscpath):
|
||||
|
||||
|
||||
def decryptpdb(infile, outdir, rscpath):
|
||||
errlog = ''
|
||||
outname = os.path.splitext(os.path.basename(infile))[0] + ".pmlz"
|
||||
outpath = os.path.join(outdir, outname)
|
||||
rv = 1
|
||||
@@ -142,6 +143,7 @@ def decryptpdb(infile, outdir, rscpath):
|
||||
|
||||
|
||||
def decryptk4mobi(infile, outdir, rscpath):
|
||||
errlog = ''
|
||||
rv = 1
|
||||
pidnums = []
|
||||
pidspath = os.path.join(rscpath,'pidlist.txt')
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
from __future__ import with_statement
|
||||
|
||||
from ignoblekeygen import generate_key
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
|
||||
DETAILED_MESSAGE = \
|
||||
|
||||
@@ -7,7 +7,7 @@ from __future__ import print_function
|
||||
__license__ = 'GPL v3'
|
||||
|
||||
# Standard Python modules.
|
||||
import os, sys, re, hashlib
|
||||
import os, sys, re, hashlib, traceback
|
||||
from calibre_plugins.dedrm.__init__ import PLUGIN_NAME, PLUGIN_VERSION
|
||||
|
||||
def WineGetKeys(scriptpath, extension, wineprefix=""):
|
||||
|
||||
Reference in New Issue
Block a user