summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/FastshareCz.py
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-05-14 14:08:14 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-05-14 14:08:14 +0200
commit3dbde9107d6886cdd4cabfdb752cdaec3935d4c3 (patch)
tree08feccf5c703a3ac0085f12b88a8380dafb927d4 /module/plugins/accounts/FastshareCz.py
parentFastshareCz: fixed account login and info retrieve (diff)
downloadpyload-3dbde9107d6886cdd4cabfdb752cdaec3935d4c3.tar.xz
FastshareCz: code cleanup
Diffstat (limited to 'module/plugins/accounts/FastshareCz.py')
-rw-r--r--module/plugins/accounts/FastshareCz.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py
index d7886f437..69bbb0827 100644
--- a/module/plugins/accounts/FastshareCz.py
+++ b/module/plugins/accounts/FastshareCz.py
@@ -21,33 +21,34 @@ import re
from module.plugins.Account import Account
from module.utils import parseFileSize
+
class FastshareCz(Account):
__name__ = "FastshareCz"
__version__ = "0.02"
__type__ = "account"
__description__ = """fastshare.cz account plugin"""
- __author_name__ = ("zoidberg" , "stickell")
+ __author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
-
+
def loadAccountInfo(self, user, req):
- html = req.load("http://www.fastshare.cz/user", decode = True)
-
+ html = req.load("http://www.fastshare.cz/user", decode=True)
+
found = re.search(r'(?:Kredit|Credit)\s*: </td><td>(.+?)&nbsp;', html)
if found:
- trafficleft = parseFileSize(found.group(1)) / 1024
+ trafficleft = parseFileSize(found.group(1)) / 1024
premium = True if trafficleft else False
else:
trafficleft = None
- premium = False
+ premium = False
return {"validuntil": -1, "trafficleft": trafficleft, "premium": premium}
-
+
def login(self, user, data, req):
req.load('http://www.fastshare.cz/login') # Do not remove or it will not login
- html = req.load('http://www.fastshare.cz/sql.php', post = {
+ html = req.load('http://www.fastshare.cz/sql.php', post={
"heslo": data['password'],
"login": user
- }, decode = True)
-
+ }, decode=True)
+
if u'>Špatné uživatelské jméno nebo heslo.<' in html:
self.wrongPassword() \ No newline at end of file