diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-06-12 13:13:20 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-06-12 13:13:20 +0200 |
commit | 6a86b735fb9723239f4d109e2a2985b7782807dc (patch) | |
tree | eca7ced4fb3dd300611fc831c0eccb9a5536a64c /module/plugins/accounts/UploadedTo.py | |
parent | comment out filemanager (diff) | |
download | pyload-6a86b735fb9723239f4d109e2a2985b7782807dc.tar.xz |
erniebs fixes, ul lifetime fix
Diffstat (limited to 'module/plugins/accounts/UploadedTo.py')
-rw-r--r-- | module/plugins/accounts/UploadedTo.py | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py index 5fcc77498..6852e5243 100644 --- a/module/plugins/accounts/UploadedTo.py +++ b/module/plugins/accounts/UploadedTo.py @@ -30,27 +30,33 @@ class UploadedTo(Account): __author_mail__ = ("mkaay@mkaay.de") def loadAccountInfo(self, user, req): - html = req.load("http://uploaded.to/me", cookies=True) - premium = '<a href="me#premium"><em>Premium</em>' in html + req.load("http://uploaded.to/language/en") + html = req.load("http://uploaded.to/me") - if premium: - 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) - raw_valid = re.findall(r"\d+", raw_valid) + premium = '<a href="me#premium"><em>Premium</em>' in html or '<em>Premium</em></th>' in html - traffic = int(self.parseTraffic(raw_traffic)) + if premium: + #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() - validuntil = time() + 24 * 60 * 60 * int(raw_valid[0]) + 60 * 60 * int(raw_valid[1]) + 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":traffic, "maxtraffic":50*1024*1024} + + return {"validuntil":validuntil, "trafficleft": -1} else: return {"premium" : False, "validuntil" : -1} def login(self, user, data, req): - page = req.load("http://uploaded.to/io/login", post={ "id" : user, "pw" : data["password"], "_" : ""}) - if "User and password do not match!" in page: - self.wrongPassword() req.load("http://uploaded.to/language/en") req.cj.setCookie("uploaded.to", "lang", "en") + + page = req.load("http://uploaded.to/io/login", post={ "id" : user, "pw" : data["password"], "_" : ""}) + + if "User and password do not match!" in page: + self.wrongPassword() |