summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-12 18:07:20 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-12 18:07:20 +0200
commitf570bef8707ccb15aa859ac06faf2fe5b652fb70 (patch)
treec94f274809369ccb06c92c0e6a16279477ec0e6f /module/plugins
parentfixes just_header (diff)
downloadpyload-f570bef8707ccb15aa859ac06faf2fe5b652fb70.tar.xz
ul fix
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/accounts/UploadedTo.py7
-rw-r--r--module/plugins/hoster/UploadedTo.py2
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"))