Skip to content

Commit

Permalink
Fixes authentication error at log in
Browse files Browse the repository at this point in the history
(found in kkleidal-pygooglevoiceupdate and else ware)
  • Loading branch information
msg4real committed Jun 8, 2015
1 parent 0a66234 commit 44d3065
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions googlevoice/voice.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def special(self):
except NameError:
regex = r"('_rnr_se':) '(.+)'"
try:
sp = re.search(regex, urlopen(settings.INBOX).read()).group(2)
content = urlopen(settings.INBOX).read()
sp = re.search(regex, content).group(2)
except AttributeError:
sp = None
self._special = sp
Expand Down Expand Up @@ -67,8 +68,13 @@ def login(self, email=None, passwd=None):

content = self.__do_page('login').read()
# holy hackjob
galx = re.search(r"name=\"GALX\"\s+value=\"(.+)\"", content).group(1)
self.__do_page('login', {'Email': email, 'Passwd': passwd, 'GALX': galx})
galx = re.search(r"name=\"GALX\" type=\"hidden\"\n *value=\"(.+)\"", content).group(1)
service = re.search(r"name=\"service\" type=\"hidden\" value=\"(.+)\"", content).group(1)
utf8 = re.search(r"type=\"hidden\" id=\"_utf8\" name=\"_utf8\" value=\"(.+)\"", content).group(1)
bgresponse = re.search(r"type=\"hidden\" name=\"bgresponse\" id=\"bgresponse\" value=\"(.+)\"", content).group(1)
pstMsg = "1"

self.__do_page('login', {'Email': email, 'Passwd': passwd, 'GALX': galx, '_utf8': utf8, 'bgresponse': bgresponse, 'pstMsg': pstMsg, 'service': service, 'continue': 'https://www.google.com/voice/', 'followup': 'https://www.google.com/voice/'})

del email, passwd

Expand Down

0 comments on commit 44d3065

Please sign in to comment.