It looks like recent changes to gmail authentication added a new cookie,
GALX, that breaks libgmail login. Here's the slight modifications I made
to the new login() function to deal with this change. libgmail is now
working for me again! For ease of reference, I'll just post the new
beginning of login(), from libgmail.py:
---
def login(self):
"""
"""
# TODO: Throw exception if we were instantiated with state?
if self.domain:
data_map = {'continue': URL_GMAIL,
'at' : 'null',
'service' : 'mail',
'Email': self.name,
'Passwd': self._pw,
}
else:
data_map = {'continue': URL_GMAIL,
'Email': self.name,
'Passwd': self._pw,
}
data = urllib.urlencode(data_map)
headers = {'Host': 'www.google.com',
'User-Agent': 'Mozilla/5.0 (Compatible;
libgmail-python)'}
req = ClientCookie.Request(URL_LOGIN, data=data, headers=headers)
pageData = self._retrievePage(req)
# We need to re-fetch the page with the proper GALX value.
data_map['GALX'] = self.getCookie('GALX')
data = urllib.urlencode(data_map)
req = ClientCookie.Request(URL_LOGIN, data=data, headers=headers)
pageData = self._retrievePage(req)
---
Everything past this point is the same.
Nobody/Anonymous ( nobody ) - 2009-10-01 07:56
5
Open
None
Nobody/Anonymous
None
None
Public
|
Date: 2009-11-22 01:28 It works! Nice Job! |
|
Date: 2009-10-20 16:15 It doesn't work using domains... at least for me. |
|
Date: 2009-10-15 09:49 yes, thank you; |
|
Date: 2009-10-01 19:04 Thanks a lot for posting this fix; |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use