diff options
author | synweap15 <shamdog+github@gmail.com> | 2014-07-09 12:15:03 +0200 |
---|---|---|
committer | synweap15 <shamdog+github@gmail.com> | 2014-07-09 12:15:03 +0200 |
commit | dfd5cb44138494b803f66559747cacc1260b5595 (patch) | |
tree | 7177d4e941dc8bf32c0d2a83de4403d4b06a5acf /module | |
parent | fix json loads, dumps on ImportError exception (diff) | |
download | pyload-dfd5cb44138494b803f66559747cacc1260b5595.tar.xz |
simplify json loads, replace crypto with hashlib
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/accounts/NoPremiumPl.py | 10 | ||||
-rw-r--r-- | module/plugins/hooks/NoPremiumPl.py | 8 | ||||
-rw-r--r-- | module/plugins/hoster/NoPremiumPl.py | 7 |
3 files changed, 7 insertions, 18 deletions
diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 7b4140169..0f3b5286f 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -1,16 +1,12 @@ # -*- coding: utf-8 -*- from datetime import datetime +import hashlib from module.plugins.Account import Account from time import mktime -import module.lib.beaker.crypto as crypto -try: - from json import loads, dumps -except ImportError: - from module.common.json_layer import json_loads as loads - from module.common.json_layer import json_dumps as dumps +from module.common.json_layer import json_loads as loads class NoPremiumPl(Account): @@ -61,7 +57,7 @@ class NoPremiumPl(Account): def login(self, user, data, req): self._usr = user - self._pwd = crypto.sha1(crypto.md5(data["password"]).hexdigest()).hexdigest() + self._pwd = hashlib.sha1(hashlib.md5(data["password"]).hexdigest()).hexdigest() self._req = req try: diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index 47aa117df..1357c95e8 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -3,11 +3,9 @@ from module.plugins.internal.MultiHoster import MultiHoster from module.network.RequestFactory import getURL -try: - from json import loads, dumps -except ImportError: - from module.common.json_layer import json_loads as loads - from module.common.json_layer import json_dumps as dumps +from module.common.json_layer import json_loads as loads + + class NoPremiumPl(MultiHoster): __name__ = "NoPremiumPl" diff --git a/module/plugins/hoster/NoPremiumPl.py b/module/plugins/hoster/NoPremiumPl.py index 86255f95a..39e5b435c 100644 --- a/module/plugins/hoster/NoPremiumPl.py +++ b/module/plugins/hoster/NoPremiumPl.py @@ -1,11 +1,6 @@ # -*- coding: utf-8 -*- -try: - from json import loads, dumps -except ImportError: - from module.common.json_layer import json_loads as loads - from module.common.json_layer import json_dumps as dumps - +from module.common.json_layer import json_loads as loads from module.plugins.internal.SimpleHoster import SimpleHoster |