This commit is contained in:
Florian Bach 2022-05-11 06:46:35 +02:00
parent b9f6672a4c
commit b2b88abd06
3 changed files with 13 additions and 14 deletions

View File

@ -325,12 +325,18 @@ def sendPOSTHTTPRequest(URL, document, type, returnRC = False):
except uliberror.HTTPError as err:
# This happens with HTTP 500 and related errors.
print("Post request caused HTTPError %d" % (err.code))
return err.code, "Post request caused HTTPException"
if returnRC:
return err.code, "Post request caused HTTPException"
else:
return None
except uliberror.URLError as err:
# This happens if the hostname cannot be resolved.
print("Post request failed with URLError")
return 900, "Post request failed with URLError"
if returnRC:
return 900, "Post request failed with URLError"
else:
return None
ret_code = handler.getcode()
if (ret_code == 204 and returnRC):

View File

@ -144,11 +144,10 @@ def buildAuthRequest():
user_pkcs12 = base64.b64decode(activationxml.find("./%s/%s" % (adNS("credentials"), adNS("pkcs12"))).text)
try:
from calibre_plugins.deacsm.libadobe import devkey_bytes as devkey_adobe
except:
from libadobe import devkey_bytes as devkey_adobe
except:
pass
if devkey_adobe is not None:
devkey_bytes = devkey_adobe

View File

@ -34,10 +34,7 @@ def importADEactivationLinuxWine(wine_prefix_path, buildIDtoEmulate=VAR_VER_DEFA
pass
# Get encryption key
try:
from getEncryptionKeyLinux import GetMasterKey
except:
from calibre_plugins.deacsm.getEncryptionKeyLinux import GetMasterKey
from getEncryptionKeyLinux import GetMasterKey
master_key = GetMasterKey(wine_prefix_path)
@ -120,10 +117,7 @@ def importADEactivationWindows(buildIDtoEmulate=VAR_VER_DEFAULT_BUILD_ID):
return False, "Windows only!"
# Get encryption key:
try:
from getEncryptionKeyWindows import GetMasterKey
except:
from calibre_plugins.deacsm.getEncryptionKeyWindows import GetMasterKey
from getEncryptionKeyWindows import GetMasterKey
master_key = GetMasterKey()