diff options
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/accounts/UploadedTo.py | 7 | ||||
-rw-r--r-- | module/plugins/hoster/UploadedTo.py | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py index 6852e5243..0bc7c2fd0 100644 --- a/module/plugins/accounts/UploadedTo.py +++ b/module/plugins/accounts/UploadedTo.py @@ -37,17 +37,18 @@ class UploadedTo(Account): premium = '<a href="me#premium"><em>Premium</em>' in html or '<em>Premium</em></th>' in html if premium: - #raw_traffic = re.search(r'<th colspan="2"><b class="cB">([^<]+)', html).group(1) + raw_traffic = re.search(r'<th colspan="2"><b class="cB">([^<]+)', html).group(1) raw_valid = re.search(r"<td>Duration:</td>\s*<th>([^<]+)", html, re.MULTILINE).group(1).strip() + traffic = int(self.parseTraffic(raw_traffic)) + if raw_valid == "unlimited": validuntil = -1 else: raw_valid = re.findall(r"\d+", raw_valid) validuntil = time() + 24 * 60 * 60 * int(raw_valid[0]) + 60 * 60 * int(raw_valid[1]) - - return {"validuntil":validuntil, "trafficleft": -1} + return {"validuntil":validuntil, "trafficleft":traffic, "maxtraffic":50*1024*1024} else: return {"premium" : False, "validuntil" : -1} diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index c1b3b9d05..c698800ec 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -116,7 +116,7 @@ class UploadedTo(Hoster): self.log.debug("%(name)s: Use Premium Account (%(left)sGB left)" % {"name" :self.__name__, "left" : info["trafficleft"]/1024/1024}) if int(self.data[1])/1024 > info["trafficleft"]: self.log.info(_("%s: Not enough traffic left" % self.__name__)) - self.account.empty() + self.account.empty(self.user) self.resetAccount() self.fail(_("Traffic exceeded")) |