open images in memory instead of saving them in temp files
This commit is contained in:
parent
ef6fdd6ca2
commit
b1f12228bf
1 changed files with 5 additions and 6 deletions
|
|
@ -25,8 +25,7 @@ from weboob.tools.browser import BasePage
|
||||||
__all__ = ['LoginPage', 'BadLoginPage', 'AccountDesactivate', 'Initident', 'CheckPassword', 'repositionnerCheminCourant']
|
__all__ = ['LoginPage', 'BadLoginPage', 'AccountDesactivate', 'Initident', 'CheckPassword', 'repositionnerCheminCourant']
|
||||||
|
|
||||||
|
|
||||||
def md5(file):
|
def md5(f):
|
||||||
f = open(file,'rb')
|
|
||||||
md5 = hashlib.md5()
|
md5 = hashlib.md5()
|
||||||
md5.update(f.read())
|
md5.update(f.read())
|
||||||
return md5.hexdigest()
|
return md5.hexdigest()
|
||||||
|
|
@ -43,7 +42,7 @@ class LoginPage(BasePage):
|
||||||
'163279f1a46082408613d12394e4042a', 'b0a9c740c4cada01eb691b4acda4daea',
|
'163279f1a46082408613d12394e4042a', 'b0a9c740c4cada01eb691b4acda4daea',
|
||||||
'3c4307ee92a1f3b571a3c542eafcb330', 'dbccecfa2206bfdb4ca891476404cc68']
|
'3c4307ee92a1f3b571a3c542eafcb330', 'dbccecfa2206bfdb4ca891476404cc68']
|
||||||
|
|
||||||
process = lambda i: md5(self.browser.retrieve(('https://voscomptesenligne.labanquepostale.fr/wsost/OstBrokerWeb/loginform?imgid=%d&0.25122230781963073' % i))[0])
|
process = lambda i: md5(self.browser.openurl(('https://voscomptesenligne.labanquepostale.fr/wsost/OstBrokerWeb/loginform?imgid=%d&0.25122230781963073' % i))[0])
|
||||||
keypad = [process(i) for i in range(10)]
|
keypad = [process(i) for i in range(10)]
|
||||||
correspondance = [keypad.index(i) for i in LOCAL_HASH]
|
correspondance = [keypad.index(i) for i in LOCAL_HASH]
|
||||||
newpassword = ''.join(str(correspondance[int(c)]) for c in pwd)
|
newpassword = ''.join(str(correspondance[int(c)]) for c in pwd)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue