diff options
author | Nitzo <nitzo2001@yahoo.com> | 2016-02-21 22:48:32 +0100 |
---|---|---|
committer | Nitzo <nitzo2001@yahoo.com> | 2016-02-21 22:48:32 +0100 |
commit | e82141f755e296651ef333eaef6b9f10a0858eb6 (patch) | |
tree | 8512a23d7741f75a059e3520d2bd7c966e2be9ba /module | |
parent | [OneFichierCom] fix #2352 (diff) | |
download | pyload-e82141f755e296651ef333eaef6b9f10a0858eb6.tar.xz |
[OneFichierCom] Update
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/accounts/OneFichierCom.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index 4b5bba9e2..b590374ac 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -6,6 +6,7 @@ import time import pycurl from module.plugins.internal.Account import Account +from module.network.HTTPRequest import BadHeader class OneFichierCom(Account): @@ -50,12 +51,20 @@ class OneFichierCom(Account): def signin(self, user, password, data): self.req.http.c.setopt(pycurl.REFERER, "https://1fichier.com/login.pl?lg=en") - html = self.load("https://1fichier.com/login.pl?lg=en", - post={'mail' : user, - 'pass' : password, - 'It' : "on", - 'purge' : "off", - 'valider': "Send"}) - - if '>Invalid email address' in html or '>Invalid password' in html: - self.fail_login() + try: + html = self.load("https://1fichier.com/login.pl?lg=en", + post={'mail' : user, + 'pass' : password, + 'It' : "on", + 'purge' : "off", + 'valider': "Send"}) + + if any(_x in html for _x in + ('>Invalid username or Password', '>Invalid email address', '>Invalid password')): + self.fail_login() + + except BadHeader, e: + if e.code == 403: + self.fail_login() + else: + raise |