summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-03-15 14:37:42 +0100
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-03-15 14:37:42 +0100
commite50ae73744ef9cb3341e328fdee2adbd3032b7c9 (patch)
tree540f6db036fae287c684c3bd940f1d9291501f77
parentImport cleanup for datetime and time modules (diff)
downloadpyload-e50ae73744ef9cb3341e328fdee2adbd3032b7c9.tar.xz
Fix https://github.com/pyload/pyload/issues/945 (thx https://github.com/mikkiste)
-rw-r--r--module/plugins/accounts/FastshareCz.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py
index d6e94f2e3..b946e29ba 100644
--- a/module/plugins/accounts/FastshareCz.py
+++ b/module/plugins/accounts/FastshareCz.py
@@ -8,7 +8,7 @@ from module.plugins.Account import Account
class FastshareCz(Account):
__name__ = "FastshareCz"
__type__ = "account"
- __version__ = "0.05"
+ __version__ = "0.06"
__description__ = """Fastshare.cz account plugin"""
__license__ = "GPLv3"
@@ -16,13 +16,13 @@ class FastshareCz(Account):
("stickell", "l.stickell@yahoo.it")]
- CREDIT_PATTERN = r'My account\s*\((.+?)\)'
+ CREDIT_PATTERN = r'Credit\s*:\s*</td>\s*<td>(.+?)\s*<'
def loadAccountInfo(self, user, req):
- validuntil = None
+ validuntil = -1
trafficleft = None
- premium = None
+ premium = False
html = req.load("http://www.fastshare.cz/user", decode=True)
@@ -30,13 +30,11 @@ class FastshareCz(Account):
if m:
trafficleft = self.parseTraffic(m.group(1))
- if trafficleft:
- premium = True
- validuntil = -1
- else:
- premium = False
+ premium = bool(trafficleft)
- return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium}
+ return {'validuntil' : validuntil,
+ 'trafficleft': trafficleft,
+ 'premium' : premium}
def login(self, user, data, req):