From 25d2cceff065a0268a7e183449ef54edf98f1783 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 13:49:12 +0200 Subject: simplify json loads, replace crypto with hashlib --- module/plugins/accounts/RapideoPl.py | 11 +++-------- module/plugins/hooks/RapideoPl.py | 7 +------ module/plugins/hoster/RapideoPl.py | 6 +----- 3 files changed, 5 insertions(+), 19 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 853731f26..6ace9ede0 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -1,16 +1,11 @@ # -*- 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 -except ImportError: - from simplejson import loads - +from module.common.json_layer import json_loads as loads class RapideoPl(Account): __name__ = "RapideoPl" @@ -60,7 +55,7 @@ class RapideoPl(Account): def login(self, user, data, req): self._usr = user - self._pwd = crypto.md5(data["password"]).hexdigest() + self._pwd = hashlib.md5(data["password"]).hexdigest() self._req = req try: response = loads(self.runAuthQuery()) diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py index de1a80908..0c5327903 100644 --- a/module/plugins/hooks/RapideoPl.py +++ b/module/plugins/hooks/RapideoPl.py @@ -2,12 +2,7 @@ from module.plugins.internal.MultiHoster import MultiHoster from module.network.RequestFactory import getURL - -try: - from json import loads -except ImportError: - from simplejson import loads - +from module.common.json_layer import json_loads as loads class RapideoPl(MultiHoster): __name__ = "RapideoPl" diff --git a/module/plugins/hoster/RapideoPl.py b/module/plugins/hoster/RapideoPl.py index 587b00bca..d64919ae0 100644 --- a/module/plugins/hoster/RapideoPl.py +++ b/module/plugins/hoster/RapideoPl.py @@ -1,10 +1,6 @@ # -*- coding: utf-8 -*- -try: - from json import loads, dumps -except ImportError: - from simplejson import loads - +from module.common.json_layer import json_loads as loads from module.plugins.internal.SimpleHoster import SimpleHoster -- cgit v1.2.3