diff options
author | Armin <Armin@Armin-PC.diedering.lan> | 2015-04-09 20:11:11 +0200 |
---|---|---|
committer | Armin <Armin@Armin-PC.diedering.lan> | 2015-04-09 20:11:11 +0200 |
commit | f53d57b902b71708f05a3125872ec5d34ebe65b9 (patch) | |
tree | 2f8756396411a98331cb937e42ded87da2c9f253 /pyload/plugin/account | |
parent | Merge remote-tracking branch 'origin/0.4.10' into 0.4.10 (diff) | |
download | pyload-f53d57b902b71708f05a3125872ec5d34ebe65b9.tar.xz |
fix: OboomCom and SmoozedCom with beaker >= v1.7.x
fix: run plugins this fix makes the plugin attribute "__name" obsolet
Diffstat (limited to 'pyload/plugin/account')
-rw-r--r-- | pyload/plugin/account/OboomCom.py | 14 | ||||
-rw-r--r-- | pyload/plugin/account/SmoozedCom.py | 14 |
2 files changed, 26 insertions, 2 deletions
diff --git a/pyload/plugin/account/OboomCom.py b/pyload/plugin/account/OboomCom.py index 7b73c38fa..0712cbc37 100644 --- a/pyload/plugin/account/OboomCom.py +++ b/pyload/plugin/account/OboomCom.py @@ -2,7 +2,19 @@ import time -from beaker.crypto.pbkdf2 import PBKDF2 +try: + from beaker.crypto.pbkdf2 import PBKDF2 +except: + from beaker.crypto.pbkdf2 import pbkdf2 + from binascii import b2a_hex + class PBKDF2(object): + def __init__(self, passphrase, salt, iterations=1000): + self.passphrase = passphrase + self.salt = salt + self.iterations = iterations + + def hexread(self, octets): + return b2a_hex(pbkdf2(self.passphrase, self.salt, self.iterations, octets)) from pyload.utils import json_loads from pyload.plugin.Account import Account diff --git a/pyload/plugin/account/SmoozedCom.py b/pyload/plugin/account/SmoozedCom.py index 54cd94fbf..ffe7142cf 100644 --- a/pyload/plugin/account/SmoozedCom.py +++ b/pyload/plugin/account/SmoozedCom.py @@ -3,7 +3,19 @@ import hashlib import time -from beaker.crypto.pbkdf2 import PBKDF2 +try: + from beaker.crypto.pbkdf2 import PBKDF2 +except: + from beaker.crypto.pbkdf2 import pbkdf2 + from binascii import b2a_hex + class PBKDF2(object): + def __init__(self, passphrase, salt, iterations=1000): + self.passphrase = passphrase + self.salt = salt + self.iterations = iterations + + def hexread(self, octets): + return b2a_hex(pbkdf2(self.passphrase, self.salt, self.iterations, octets)) from pyload.utils import json_loads from pyload.plugin.Account import Account |