mirror of
https://github.com/noDRM/DeDRM_tools.git
synced 2026-03-21 05:18:56 +00:00
Merge pull request #983 from cclauss/patch-1
GitHub Action: There is no requirements.txt
This commit is contained in:
@@ -87,6 +87,11 @@ import zipfile
|
||||
import traceback
|
||||
from zipfile import ZipFile
|
||||
|
||||
import erdr2pml
|
||||
import ineptpdf
|
||||
import k4mobidedrm
|
||||
import zipfix
|
||||
|
||||
class DeDRMError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ from __future__ import with_statement
|
||||
|
||||
__version__ = '1.01'
|
||||
|
||||
import sys, struct, os
|
||||
import sys, struct, os, traceback
|
||||
import zlib
|
||||
import zipfile
|
||||
import xml.etree.ElementTree as etree
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#! /usr/bin/python
|
||||
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
|
||||
|
||||
from .convert2xml import encodeNumber
|
||||
|
||||
class Unbuffered:
|
||||
def __init__(self, stream):
|
||||
self.stream = stream
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -524,7 +524,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):
|
||||
|
||||
@@ -114,6 +114,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
|
||||
@@ -141,6 +142,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 = \
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import with_statement
|
||||
__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