diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2012-04-22 00:41:13 +0200 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2012-04-22 00:41:13 +0200 |
commit | 1d6c9adc791b62e3b236d118b55c34fc6b6e38ec (patch) | |
tree | 6914535d96bf98c2c2019c484336113c4441ebdf /module/plugins/accounts/UlozTo.py | |
parent | fix freakshare with python < 2.7 (diff) | |
download | pyload-1d6c9adc791b62e3b236d118b55c34fc6b6e38ec.tar.xz |
fix uloz.to & bitshare.com premium
Diffstat (limited to 'module/plugins/accounts/UlozTo.py')
-rw-r--r-- | module/plugins/accounts/UlozTo.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py index 0375337b0..0c4ecda6a 100644 --- a/module/plugins/accounts/UlozTo.py +++ b/module/plugins/accounts/UlozTo.py @@ -5,7 +5,7 @@ import re class UlozTo(Account): __name__ = "UlozTo" - __version__ = "0.02" + __version__ = "0.03" __type__ = "account" __description__ = """uloz.to account plugin""" __author_name__ = ("zoidberg") @@ -14,11 +14,14 @@ class UlozTo(Account): TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a href="/kredit/" title="[^"]*?GB = ([0-9.]+) MB">' def loadAccountInfo(self, user, req): - html = req.load("http://www.ulozto.net/statistiky", decode = True) + #this cookie gets lost somehow after each request + self.phpsessid = req.cj.getCookie("PHPSESSID") + html = req.load("http://www.ulozto.net/", decode = True) + req.cj.setCookie("www.ulozto.net", "PHPSESSID", self.phpsessid) found = re.search(self.TRAFFIC_LEFT_PATTERN, html) trafficleft = int(float(found.group(1).replace(' ','').replace(',','.')) * 1000 / 1.024) if found else 0 - self.premium = True if trafficleft else False + self.premium = True if trafficleft else False return {"validuntil": -1, "trafficleft": trafficleft} |