summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/WebshareCz.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-07-07 01:23:55 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-07-07 01:23:55 +0200
commitb1759bc440cd6013837697eb8de540914f693ffd (patch)
treed170caf63d7f65e44d23ea2d91a65759a1665928 /module/plugins/accounts/WebshareCz.py
parent[Plugin] Fix decoding in load method (diff)
downloadpyload-b1759bc440cd6013837697eb8de540914f693ffd.tar.xz
No camelCase style anymore
Diffstat (limited to 'module/plugins/accounts/WebshareCz.py')
-rw-r--r--module/plugins/accounts/WebshareCz.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/module/plugins/accounts/WebshareCz.py b/module/plugins/accounts/WebshareCz.py
index b1ecef3fd..c8711838f 100644
--- a/module/plugins/accounts/WebshareCz.py
+++ b/module/plugins/accounts/WebshareCz.py
@@ -12,7 +12,7 @@ from module.plugins.internal.Account import Account
class WebshareCz(Account):
__name__ = "WebshareCz"
__type__ = "account"
- __version__ = "0.09"
+ __version__ = "0.10"
__description__ = """Webshare.cz account plugin"""
__license__ = "GPLv3"
@@ -24,17 +24,17 @@ class WebshareCz(Account):
TRAFFIC_LEFT_PATTERN = r'<bytes>(.+)</bytes>'
- def loadAccountInfo(self, user, req):
+ def load_account_info(self, user, req):
html = self.load("https://webshare.cz/api/user_data/",
- post={'wst': self.getAccountData(user).get('wst', None)})
+ post={'wst': self.get_account_data(user).get('wst', None)})
- self.logDebug("Response: " + html)
+ self.log_debug("Response: " + html)
expiredate = re.search(self.VALID_UNTIL_PATTERN, html).group(1)
- self.logDebug("Expire date: " + expiredate)
+ self.log_debug("Expire date: " + expiredate)
validuntil = time.mktime(time.strptime(expiredate, "%Y-%m-%d %H:%M:%S"))
- trafficleft = self.parseTraffic(re.search(self.TRAFFIC_LEFT_PATTERN, html).group(1))
+ trafficleft = self.parse_traffic(re.search(self.TRAFFIC_LEFT_PATTERN, html).group(1))
premium = validuntil > time.time()
return {'validuntil': validuntil, 'trafficleft': -1, 'premium': premium}
@@ -46,7 +46,7 @@ class WebshareCz(Account):
'wst' : ""}, req=req)
if "<status>OK</status>" not in salt:
- self.wrongPassword()
+ self.wrong_password()
salt = re.search('<salt>(.+)</salt>', salt).group(1)
password = hashlib.sha1(md5_crypt.encrypt(data['password'], salt=salt)).hexdigest()
@@ -60,6 +60,6 @@ class WebshareCz(Account):
'wst' : ""}, req=req)
if "<status>OK</status>" not in login:
- self.wrongPassword()
+ self.wrong_password()
data['wst'] = re.search('<token>(.+)</token>', login).group(1)