diff options
author | Stefano <l.stickell@yahoo.it> | 2014-05-03 22:24:38 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2014-05-03 22:24:58 +0200 |
commit | bd4ead18e025c6aff3d37b74cacae2731e738aa2 (patch) | |
tree | 3b1bf1dc667c226ae20f4186ebbd26863efa0784 /module/plugins/internal/XFSPAccount.py | |
parent | 1Fichier: premium support (diff) | |
download | pyload-bd4ead18e025c6aff3d37b74cacae2731e738aa2.tar.xz |
File4safe premium
+ XFSPAccount improved
Resolves #431
Diffstat (limited to 'module/plugins/internal/XFSPAccount.py')
-rw-r--r-- | module/plugins/internal/XFSPAccount.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/module/plugins/internal/XFSPAccount.py b/module/plugins/internal/XFSPAccount.py index 787e7fa9e..76aff54f0 100644 --- a/module/plugins/internal/XFSPAccount.py +++ b/module/plugins/internal/XFSPAccount.py @@ -26,7 +26,7 @@ from module.utils import parseFileSize class XFSPAccount(Account): __name__ = "XFSPAccount" - __version__ = "0.05" + __version__ = "0.06" __type__ = "account" __description__ = """XFileSharingPro base account plugin""" __author_name__ = "zoidberg" @@ -36,12 +36,14 @@ class XFSPAccount(Account): VALID_UNTIL_PATTERN = r'>Premium.[Aa]ccount expire:</TD><TD><b>([^<]+)</b>' TRAFFIC_LEFT_PATTERN = r'>Traffic available today:</TD><TD><b>([^<]+)</b>' + LOGIN_FAIL_PATTERN = r'Incorrect Login or Password|>Error<' + PREMIUM_PATTERN = r'>Renew premium<' def loadAccountInfo(self, user, req): html = req.load(self.MAIN_PAGE + "?op=my_account", decode=True) validuntil = trafficleft = None - premium = True if '>Renew premium<' in html else False + premium = True if re.search(self.PREMIUM_PATTERN, html) else False found = re.search(self.VALID_UNTIL_PATTERN, html) if found: @@ -61,7 +63,7 @@ class XFSPAccount(Account): else: trafficleft = parseFileSize(trafficleft) / 1024 - return ({"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium}) + return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} def login(self, user, data, req): html = req.load('%slogin.html' % self.MAIN_PAGE, decode=True) @@ -76,5 +78,5 @@ class XFSPAccount(Account): html = req.load(self.MAIN_PAGE, post=inputs, decode=True) - if 'Incorrect Login or Password' in html or '>Error<' in html: + if re.search(self.LOGIN_FAIL_PATTERN, html): self.wrongPassword() |