diff options
author | guidobelix <guidobelix@hotmail.it> | 2014-10-15 20:28:28 +0200 |
---|---|---|
committer | guidobelix <guidobelix@hotmail.it> | 2014-10-15 20:28:28 +0200 |
commit | 90c4bf19a6b03e28c9be69a20ce6330391dcb839 (patch) | |
tree | b215ee9d0ff7824ffae28623833b3916797bf73c /module/plugins/accounts | |
parent | [XFSPAccount] Fix TRAFFIC_LEFT_PATTERN (diff) | |
download | pyload-90c4bf19a6b03e28c9be69a20ce6330391dcb839.tar.xz |
Sinplified after the improvements to XFSPAccount
modified: module/plugins/accounts/TusfilesNet.py
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r-- | module/plugins/accounts/TusfilesNet.py | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/module/plugins/accounts/TusfilesNet.py b/module/plugins/accounts/TusfilesNet.py index a1b3613b2..775aab9c0 100644 --- a/module/plugins/accounts/TusfilesNet.py +++ b/module/plugins/accounts/TusfilesNet.py @@ -11,7 +11,7 @@ from module.utils import parseFileSize class TusfilesNet(XFSPAccount): __name__ = "TusfilesNet" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """ Tusfile.net account plugin """ __license__ = "GPLv3" @@ -22,37 +22,3 @@ class TusfilesNet(XFSPAccount): VALID_UNTIL_PATTERN = r'<span class="label label-default">([^<]+)</span>' TRAFFIC_LEFT_PATTERN = r'<td><img src="//www\.tusfiles\.net/i/icon/meter\.png" alt=""/></td>\n<td> (?P<S>[^<]+)</td>' - - - def loadAccountInfo(self, user, req): - html = req.load(self.HOSTER_URL, get={'op': "my_account"}, decode=True) - - validuntil = None - trafficleft = None - premium = False - - m = re.search(self.VALID_UNTIL_PATTERN, html) - if m: - expiredate = m.group(1) - self.logDebug("Expire date: " + expiredate) - - try: - validuntil = mktime(strptime(expiredate, "%d %B %Y")) - except Exception, e: - self.logError(e) - - if validuntil > mktime(gmtime()): - premium = True - else: - premium = False - validuntil = None - - m = re.search(self.TRAFFIC_LEFT_PATTERN, html) - if m: - trafficleft = m.group(1) - if "Unlimited" in trafficleft: - trafficleft = -1 - else: - trafficleft = parseFileSize(trafficleft) * 1024 - - return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} |