summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/account/UlozTo.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugins/account/UlozTo.py')
-rw-r--r--pyload/plugins/account/UlozTo.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/pyload/plugins/account/UlozTo.py b/pyload/plugins/account/UlozTo.py
index 913ddc56f..105a962cd 100644
--- a/pyload/plugins/account/UlozTo.py
+++ b/pyload/plugins/account/UlozTo.py
@@ -6,23 +6,24 @@ from pyload.plugins.base.Account import Account
class UlozTo(Account):
- __name__ = "UlozTo"
- __type__ = "account"
+ __name__ = "UlozTo"
+ __type__ = "account"
__version__ = "0.06"
__description__ = """Uloz.to account plugin"""
- __authors__ = [("zoidberg", "zoidberg@mujmail.cz"),
- ("pulpe", None)]
+ __license__ = "GPLv3"
+ __authors__ = [("zoidberg", "zoidberg@mujmail.cz"),
+ ("pulpe", None)]
- TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a href="/kredit" title="[^"]*?GB = ([0-9.]+) MB"'
+ TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a href="/kredit" title="[^"]*?GB = ([\d.]+) MB"'
def loadAccountInfo(self, user, req):
#this cookie gets lost somehow after each request
self.phpsessid = req.cj.getCookie("ULOSESSID")
html = req.load("http://www.ulozto.net/", decode=True)
- req.cj.setCookie("www.ulozto.net", "ULOSESSID", self.phpsessid)
+ req.cj.setCookie(".ulozto.net", "ULOSESSID", self.phpsessid)
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
trafficleft = int(float(m.group(1).replace(' ', '').replace(',', '.')) * 1000 * 1.048) if m else 0
@@ -30,6 +31,7 @@ class UlozTo(Account):
return {"validuntil": -1, "trafficleft": trafficleft}
+
def login(self, user, data, req):
login_page = req.load('http://www.ulozto.net/?do=web-login', decode=True)
action = re.findall('<form action="(.+?)"', login_page)[1].replace('&amp;', '&')