diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2012-01-11 16:26:04 +0100 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2012-01-11 16:26:04 +0100 |
commit | 8334d649654f03b66ac2f6c2bb6fe2f1883173ef (patch) | |
tree | 637492fccdfe708107d08f50b14fd2d0a15260b4 /module/plugins/accounts/UlozTo.py | |
parent | fix filepost, mediafire closed #495 (diff) | |
download | pyload-8334d649654f03b66ac2f6c2bb6fe2f1883173ef.tar.xz |
uloz.to premium, update linkdecrypter.com
Diffstat (limited to 'module/plugins/accounts/UlozTo.py')
-rw-r--r-- | module/plugins/accounts/UlozTo.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py new file mode 100644 index 000000000..36e1ae342 --- /dev/null +++ b/module/plugins/accounts/UlozTo.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- + +from module.plugins.Account import Account +import re + +class UlozTo(Account): + __name__ = "UlozTo" + __version__ = "0.01" + __type__ = "account" + __description__ = """uloz.to account plugin""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + TRAFFIC_LEFT_PATTERN = r'<li class="credit"><a href="/kredit/" class="coins" title="[^"]* GB = ([^"]+) MB">' + + def loadAccountInfo(self, user, req): + html = req.load("http://www.uloz.to/statistiky/", decode = True) + + 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 + + return {"validuntil": -1, "trafficleft": trafficleft} + + def login(self, user, data, req): + html = req.load('http://www.uloz.to/?do=authForm-submit', post = { + "login": "Přihlásit", + "password": data['password'], + "trvale": "on", + "username": user + }, decode = True) + + if '<ul class="error">' in html: + self.wrongPassword()
\ No newline at end of file |