summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/EasybytezCom.py
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-07-23 20:22:42 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-07-23 20:22:42 +0200
commitf5535809bebc6cc343475704832c8fd8674d2d06 (patch)
treec59bc1e6d71c04f5545ea262056c0c5be1bd8910 /module/plugins/accounts/EasybytezCom.py
parentFixed PEP 8 violations in Hosters (diff)
downloadpyload-f5535809bebc6cc343475704832c8fd8674d2d06.tar.xz
Fixed PEP 8 violations in Accounts
Diffstat (limited to 'module/plugins/accounts/EasybytezCom.py')
-rw-r--r--module/plugins/accounts/EasybytezCom.py36
1 files changed, 19 insertions, 17 deletions
diff --git a/module/plugins/accounts/EasybytezCom.py b/module/plugins/accounts/EasybytezCom.py
index ba7829b83..cd995fbe5 100644
--- a/module/plugins/accounts/EasybytezCom.py
+++ b/module/plugins/accounts/EasybytezCom.py
@@ -17,11 +17,13 @@
@author: zoidberg
"""
+import re
+from time import mktime, strptime
+
from module.plugins.Account import Account
from module.plugins.internal.SimpleHoster import parseHtmlForm
-import re
from module.utils import parseFileSize
-from time import mktime, strptime
+
class EasybytezCom(Account):
__name__ = "EasybytezCom"
@@ -30,16 +32,16 @@ class EasybytezCom(Account):
__description__ = """EasyBytez.com account plugin"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
-
+
VALID_UNTIL_PATTERN = r'<TR><TD>Premium account expire:</TD><TD><b>([^<]+)</b>'
TRAFFIC_LEFT_PATTERN = r'<TR><TD>Traffic available today:</TD><TD><b>(?P<S>[^<]+)</b>'
- def loadAccountInfo(self, user, req):
- html = req.load("http://www.easybytez.com/?op=my_account", decode = True)
-
+ def loadAccountInfo(self, user, req):
+ html = req.load("http://www.easybytez.com/?op=my_account", decode=True)
+
validuntil = trafficleft = None
premium = False
-
+
found = re.search(self.VALID_UNTIL_PATTERN, html)
if found:
premium = True
@@ -56,18 +58,18 @@ class EasybytezCom(Account):
if "Unlimited" in trafficleft:
premium = True
else:
- trafficleft = parseFileSize(trafficleft) / 1024
-
- return ({"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium})
-
+ trafficleft = parseFileSize(trafficleft) / 1024
+
+ return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium}
+
def login(self, user, data, req):
- html = req.load('http://www.easybytez.com/login.html', decode = True)
+ html = req.load('http://www.easybytez.com/login.html', decode=True)
action, inputs = parseHtmlForm('name="FL"', html)
inputs.update({"login": user,
"password": data['password'],
"redirect": "http://www.easybytez.com/"})
-
- html = req.load(action, post = inputs, decode = True)
-
- if 'Incorrect Login or Password' in html or '>Error<' in html:
- self.wrongPassword() \ No newline at end of file
+
+ html = req.load(action, post=inputs, decode=True)
+
+ if 'Incorrect Login or Password' in html or '>Error<' in html:
+ self.wrongPassword()