summaryrefslogtreecommitdiffstats
path: root/pyload/plugin/account
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugin/account')
-rw-r--r--pyload/plugin/account/NoPremiumPl.py14
-rw-r--r--pyload/plugin/account/OboomCom.py1
-rw-r--r--pyload/plugin/account/RapideoPl.py14
-rw-r--r--pyload/plugin/account/SmoozedCom.py9
-rw-r--r--pyload/plugin/account/UploadableCh.py2
-rw-r--r--pyload/plugin/account/WebshareCz.py2
-rw-r--r--pyload/plugin/account/ZeveraCom.py5
7 files changed, 22 insertions, 25 deletions
diff --git a/pyload/plugin/account/NoPremiumPl.py b/pyload/plugin/account/NoPremiumPl.py
index d825b38ed..6cefed550 100644
--- a/pyload/plugin/account/NoPremiumPl.py
+++ b/pyload/plugin/account/NoPremiumPl.py
@@ -37,16 +37,16 @@ class NoPremiumPl(Account):
try:
result = json_loads(self.runAuthQuery())
except Exception:
- # todo: return or let it be thrown?
+ #@TODO: return or let it be thrown?
return
premium = False
valid_untill = -1
- if "expire" in result.keys() and result["expire"]:
+ if "expire" in result.keys() and result['expire']:
premium = True
- valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result["expire"])).timetuple())
- traffic_left = result["balance"] * 2 ** 20
+ valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result['expire'])).timetuple())
+ traffic_left = result['balance'] * 2 ** 20
return ({
"validuntil": valid_untill,
@@ -57,7 +57,7 @@ class NoPremiumPl(Account):
def login(self, user, data, req):
self._usr = user
- self._pwd = hashlib.sha1(hashlib.md5(data["password"]).hexdigest()).hexdigest()
+ self._pwd = hashlib.sha1(hashlib.md5(data['password']).hexdigest()).hexdigest()
self._req = req
try:
@@ -73,8 +73,8 @@ class NoPremiumPl(Account):
def createAuthQuery(self):
query = self._api_query
- query["username"] = self._usr
- query["password"] = self._pwd
+ query['username'] = self._usr
+ query['password'] = self._pwd
return query
diff --git a/pyload/plugin/account/OboomCom.py b/pyload/plugin/account/OboomCom.py
index 68e083d75..8b33d0612 100644
--- a/pyload/plugin/account/OboomCom.py
+++ b/pyload/plugin/account/OboomCom.py
@@ -8,6 +8,7 @@ try:
except ImportError:
from beaker.crypto.pbkdf2 import pbkdf2
from binascii import b2a_hex
+
class PBKDF2(object):
def __init__(self, passphrase, salt, iterations=1000):
diff --git a/pyload/plugin/account/RapideoPl.py b/pyload/plugin/account/RapideoPl.py
index d40c76cb5..c58414b53 100644
--- a/pyload/plugin/account/RapideoPl.py
+++ b/pyload/plugin/account/RapideoPl.py
@@ -37,16 +37,16 @@ class RapideoPl(Account):
try:
result = json_loads(self.runAuthQuery())
except Exception:
- # todo: return or let it be thrown?
+ #@TODO: return or let it be thrown?
return
premium = False
valid_untill = -1
- if "expire" in result.keys() and result["expire"]:
+ if "expire" in result.keys() and result['expire']:
premium = True
- valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result["expire"])).timetuple())
+ valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result['expire'])).timetuple())
- traffic_left = result["balance"]
+ traffic_left = result['balance']
return ({
"validuntil": valid_untill,
@@ -57,7 +57,7 @@ class RapideoPl(Account):
def login(self, user, data, req):
self._usr = user
- self._pwd = hashlib.md5(data["password"]).hexdigest()
+ self._pwd = hashlib.md5(data['password']).hexdigest()
self._req = req
try:
response = json_loads(self.runAuthQuery())
@@ -72,8 +72,8 @@ class RapideoPl(Account):
def createAuthQuery(self):
query = self._api_query
- query["username"] = self._usr
- query["password"] = self._pwd
+ query['username'] = self._usr
+ query['password'] = self._pwd
return query
diff --git a/pyload/plugin/account/SmoozedCom.py b/pyload/plugin/account/SmoozedCom.py
index 7f4beb7d9..f24799caf 100644
--- a/pyload/plugin/account/SmoozedCom.py
+++ b/pyload/plugin/account/SmoozedCom.py
@@ -9,6 +9,7 @@ try:
except ImportError:
from beaker.crypto.pbkdf2 import pbkdf2
from binascii import b2a_hex
+
class PBKDF2(object):
def __init__(self, passphrase, salt, iterations=1000):
@@ -46,10 +47,10 @@ class SmoozedCom(Account):
'premium' : False}
else:
# Parse account info
- info = {'validuntil' : float(status["data"]["user"]["user_premium"]),
- 'trafficleft': max(0, status["data"]["traffic"][1] - status["data"]["traffic"][0]),
- 'session' : status["data"]["session_key"],
- 'hosters' : [hoster["name"] for hoster in status["data"]["hoster"]]}
+ info = {'validuntil' : float(status['data']['user']['user_premium']),
+ 'trafficleft': max(0, status['data']['traffic'][1] - status['data']['traffic'][0]),
+ 'session' : status['data']['session_key'],
+ 'hosters' : [hoster['name'] for hoster in status['data']['hoster']]}
if info['validuntil'] < time.time():
info['premium'] = False
diff --git a/pyload/plugin/account/UploadableCh.py b/pyload/plugin/account/UploadableCh.py
index 15717db44..c95fe7f0b 100644
--- a/pyload/plugin/account/UploadableCh.py
+++ b/pyload/plugin/account/UploadableCh.py
@@ -25,7 +25,7 @@ class UploadableCh(Account):
def login(self, user, data, req):
html = req.load("http://www.uploadable.ch/login.php",
post={'userName' : user,
- 'userPassword' : data["password"],
+ 'userPassword' : data['password'],
'autoLogin' : "1",
'action__login': "normalLogin"},
decode=True)
diff --git a/pyload/plugin/account/WebshareCz.py b/pyload/plugin/account/WebshareCz.py
index 47dfed255..5cbe6b1b8 100644
--- a/pyload/plugin/account/WebshareCz.py
+++ b/pyload/plugin/account/WebshareCz.py
@@ -51,7 +51,7 @@ class WebshareCz(Account):
self.wrongPassword()
salt = re.search('<salt>(.+)</salt>', salt).group(1)
- password = sha1(md5_crypt.encrypt(data["password"], salt=salt)).hexdigest()
+ password = sha1(md5_crypt.encrypt(data['password'], salt=salt)).hexdigest()
digest = md5(user + ":Webshare:" + password).hexdigest()
login = req.load("https://webshare.cz/api/login/",
diff --git a/pyload/plugin/account/ZeveraCom.py b/pyload/plugin/account/ZeveraCom.py
index 25c2c5512..1e5eacb4c 100644
--- a/pyload/plugin/account/ZeveraCom.py
+++ b/pyload/plugin/account/ZeveraCom.py
@@ -19,11 +19,6 @@ class ZeveraCom(Account):
HOSTER_DOMAIN = "zevera.com"
- def __init__(self, manager, accounts): #@TODO: remove in 0.4.10
- self.init()
- return super(ZeveraCom, self).__init__(manager, accounts)
-
-
def init(self):
if not self.HOSTER_DOMAIN:
self.logError(_("Missing HOSTER_DOMAIN"))