diff options
author | Nitzo <nitzo2001@yahoo.com> | 2016-07-31 00:16:54 +0200 |
---|---|---|
committer | Nitzo <nitzo2001@yahoo.com> | 2016-07-31 00:16:54 +0200 |
commit | 40cd5df129b42a2367b7bf1a181617e9d06869c7 (patch) | |
tree | aa7ea7c7568407655cb4e95efe729dee9ee43d88 /module | |
parent | [New Creapter] MirrorcreatorCom (fix #2200) (diff) | |
download | pyload-40cd5df129b42a2367b7bf1a181617e9d06869c7.tar.xz |
[UploadedTo] Fix #2554
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/accounts/UploadedTo.py | 61 |
1 files changed, 33 insertions, 28 deletions
diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py index 50c03041d..7e2468459 100644 --- a/module/plugins/accounts/UploadedTo.py +++ b/module/plugins/accounts/UploadedTo.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account class UploadedTo(Account): __name__ = "UploadedTo" __type__ = "account" - __version__ = "0.42" + __version__ = "0.43" __status__ = "testing" __description__ = """Uploaded.to account plugin""" @@ -25,37 +25,42 @@ class UploadedTo(Account): def grab_info(self, user, password, data): - validuntil = None - trafficleft = None - premium = None - html = self.load("http://uploaded.net/me") premium = True if re.search(self.PREMIUM_PATTERN, html) else False + if premium: + validuntil = None + trafficleft = None + premium = None - m = re.search(self.VALID_UNTIL_PATTERN, html, re.M) - if m is not None: - expiredate = m.group(1).lower().strip() - - if expiredate == "unlimited": - validuntil = -1 - else: - m = re.findall(r'(\d+) (week|day|hour)', expiredate) - if m is not None: - validuntil = time.time() - for n, u in m: - validuntil += float(n) * 60 * 60 * {'week': 168, 'day': 24, 'hour': 1}[u] - - m = re.search(self.TRAFFIC_LEFT_PATTERN, html) - if m is not None: - traffic = m.groupdict() - size = traffic['S'].replace('.', '') - unit = traffic['U'].lower() - trafficleft = self.parse_traffic(size, unit) - - return {'validuntil' : validuntil, - 'trafficleft': trafficleft, - 'premium' : premium} + m = re.search(self.VALID_UNTIL_PATTERN, html, re.M) + if m is not None: + expiredate = m.group(1).lower().strip() + + if expiredate == "unlimited": + validuntil = -1 + else: + m = re.findall(r'(\d+) (week|day|hour)', expiredate) + if m is not None: + validuntil = time.time() + for n, u in m: + validuntil += float(n) * 60 * 60 * {'week': 168, 'day': 24, 'hour': 1}[u] + + m = re.search(self.TRAFFIC_LEFT_PATTERN, html) + if m is not None: + traffic = m.groupdict() + size = traffic['S'].replace('.', '') + unit = traffic['U'].lower() + trafficleft = self.parse_traffic(size, unit) + + return {'validuntil' : validuntil, + 'trafficleft': trafficleft, + 'premium' : premium} + + else: + return {'validuntil' : -1, + 'trafficleft': -1, + 'premium' : premium} def signin(self, user, password, data): |