diff options
author | Stefano <l.stickell@yahoo.it> | 2013-07-23 20:22:42 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2013-07-23 20:40:59 +0200 |
commit | 4a81799278ae003bfbd7897f7bcd1ef46642d953 (patch) | |
tree | 59e580fc761103cfacd9190bc9c55a5a01367f47 /pyload/plugins/accounts/MultishareCz.py | |
parent | little cleanup, added some tests (diff) | |
download | pyload-4a81799278ae003bfbd7897f7bcd1ef46642d953.tar.xz |
Fixed PEP 8 violations in Accounts
(cherry picked from commit f5535809bebc6cc343475704832c8fd8674d2d06)
Conflicts:
pyload/plugins/accounts/AlldebridCom.py
pyload/plugins/accounts/Premium4Me.py
pyload/plugins/accounts/PremiumizeMe.py
pyload/plugins/accounts/RealdebridCom.py
Diffstat (limited to 'pyload/plugins/accounts/MultishareCz.py')
-rw-r--r-- | pyload/plugins/accounts/MultishareCz.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/pyload/plugins/accounts/MultishareCz.py b/pyload/plugins/accounts/MultishareCz.py index 39439cbbe..273936615 100644 --- a/pyload/plugins/accounts/MultishareCz.py +++ b/pyload/plugins/accounts/MultishareCz.py @@ -23,6 +23,7 @@ from module.plugins.Account import Account import re from module.utils import parseFileSize + class MultishareCz(Account): __name__ = "MultishareCz" __version__ = "0.02" @@ -30,29 +31,29 @@ class MultishareCz(Account): __description__ = """multishare.cz account plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - + TRAFFIC_LEFT_PATTERN = r'<span class="profil-zvyrazneni">Kredit:</span>\s*<strong>(?P<S>[0-9,]+) (?P<U>\w+)</strong>' ACCOUNT_INFO_PATTERN = r'<input type="hidden" id="(u_ID|u_hash)" name="[^"]*" value="([^"]+)">' def loadAccountInfo(self, user, req): #self.relogin(user) - html = req.load("http://www.multishare.cz/profil/", decode = True) - - found = re.search(self.TRAFFIC_LEFT_PATTERN, html) + html = req.load("http://www.multishare.cz/profil/", decode=True) + + found = re.search(self.TRAFFIC_LEFT_PATTERN, html) trafficleft = parseFileSize(found.group('S'), found.group('U')) / 1024 if found else 0 - self.premium = True if trafficleft else False - - html = req.load("http://www.multishare.cz/", decode = True) + self.premium = True if trafficleft else False + + html = req.load("http://www.multishare.cz/", decode=True) mms_info = dict(re.findall(self.ACCOUNT_INFO_PATTERN, html)) return dict(mms_info, **{"validuntil": -1, "trafficleft": trafficleft}) - + def login(self, user, data, req): - html = req.load('http://www.multishare.cz/html/prihlaseni_process.php', post = { - "akce": "Přihlásit", + html = req.load('http://www.multishare.cz/html/prihlaseni_process.php', post={ + "akce": "Přihlásit", "heslo": data['password'], "jmeno": user - }, decode = True) - + }, decode=True) + if '<div class="akce-chyba akce">' in html: self.wrongPassword()
\ No newline at end of file |