Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Did google change the way logging in works? #24

Open
jwerardi opened this issue Aug 23, 2016 · 18 comments

Comments

Projects
None yet
9 participants
@jwerardi
Copy link

commented Aug 23, 2016

My scripts worked fine on Friday. I ran them again today, and I'm facing an error when the API is trying to login.

googlevoice\voice.py", line 95, in login
raise LoginError
googlevoice.util.LoginError

@alexcushing

This comment has been minimized.

Copy link

commented Aug 23, 2016

wow Im having the exact same issue! help!

@woodyl

This comment has been minimized.

Copy link

commented Aug 23, 2016

Worked for me yesterday, failing today. If anybody figures out what changed, please post here!

@tom-slick

This comment has been minimized.

Copy link

commented Aug 24, 2016

They added a new input type on the login form "gxf"

you can try editing voice.py

        # holy hackjob
        galx = re.search(r"type=\"hidden\"\s+name=\"GALX\"\s+value=\"(.+)\"", content).group(1)
        gxf = re.search(r"type=\"hidden\"\s+name=\"gxf\"\s+value=\"(.+)\"", content).group(1)
        result = self.__do_page('login', {'Email': email, 'Passwd': passwd, 'GALX': galx, 'gxf':gxf})

@ErinMorelli

This comment has been minimized.

Copy link
Contributor

commented Aug 24, 2016

It's more than just the new input type, it looks like they've changed the login POST URL as well. I have committed working changed to my fork of this repo and I've submitted it as a pull request (#25)

@tom-slick

This comment has been minimized.

Copy link

commented Aug 24, 2016

With the version I'm using I only needed to add the gxf bit

@jwerardi

This comment has been minimized.

Copy link
Author

commented Aug 24, 2016

Thank you so much @ErinMorelli ! Your fixes worked perfectly :)

How did you figure this out, if you don't mind me asking? I was suspicious that it was the post parameters being changed, but I'm still fairly new to all of this and I didn't know how to diagnose the problem.

@woodyl

This comment has been minimized.

Copy link

commented Aug 24, 2016

Like tom-slick, I was able to fix my (heavily hacked) version by just adding the 'gxf" field to the existing code.

@chris001

This comment has been minimized.

Copy link

commented Sep 28, 2016

@woodyl
What else have you modified besides the 'gxf' field?
Could you share your heavily hacked version?
Because the "master" version here is failing to login.

@woodyl

This comment has been minimized.

Copy link

commented Sep 28, 2016

This is probably the relevant section:

        content = self.__do_page('login').read()
        # holy hackjob
        galx = re.search(b'type="hidden"\s*name="GALX"\s*value="([^"]+)"', content).group(1)
        gxf = re.search(b'type=\"hidden\"\s*name=\"gxf\"\s*value=\"([^"]+)"', content).group(1)
        # galx = re.search(b'name="GALX"\s*type="hidden"\n\s*value="([^"]+)"', content).group(1)
        # self.__do_page('login', {'Email': email, 'Passwd': passwd, 'GALX': galx})
        self.__do_page('login', {'Email': email, 'Passwd': passwd, 'GALX': galx, 'gxf': gxf})

I have borrowed snippets of code from various versions of pygooglevoice to keep my installation running and I didn't document where the code came from or what changes I made over time. The result is that the version I'm running is mostly the same as the pettazz version, but diverges sometimes. Let me know if this snippet gets yours running again. Also, note that this snippet was adapted for Python3 and might not be backward compatible with Python2.

@chris001

This comment has been minimized.

Copy link

commented Sep 28, 2016

Thanks for that tip! @woodyl 🍻
FYI for anyone else with this issue. The master code from the pettazz repo is working.
The problem is gvoice security.
You must do the "gvoice reset procedure", which allows the gvoice app to login from the new "Device," when you're running this code on a device which is different device from your usual pc/device.
GVoice reset procedure: https://accounts.google.com/DisplayUnlockCaptcha

    Allow access to your Google account
    As a security precaution, Google may require you to complete this additional step when signing into a new device or application.

    To allow access, click the Continue button below.
@nalipaz

This comment has been minimized.

Copy link

commented Nov 24, 2016

I am unable to get the login to work using the suggested procedure by @chris001, and I also tested a few other possible solutions found here. Nothing seems to authenticate me, but maybe I differ from some of you in that this is the first time I have set this up. I am using 2-factor authentication. I do initially get my sms to verify the code. I am however never prompted to input it when the voice.login() method runs. I attempt to input it manually in the ~/.gvoice file which does get me further only to receive:

$ python2 examples/phones.py
DEBUG:PyGoogleVoice:e.com/ServiceLogin?service=grandcentral&passive=1209600&continue=https://www.google.com/voice&followup=https://www.google.com/voice&ltmpl=open? - {'User-Agent': 'PyGoogleVoice/0.5'}
DEBUG:PyGoogleVoice:e.com/signin/challenge/sl/password?service=grandcentral&continue=https://www.google.com/voice&followup=https://www.google.com/voice&ltmpl=open?Passwd=[censored]&gxf=AFoagUVc900kmoK4BIol84l-J990ANsHmw%3A1479973777423&GALX=MVDLdmI1Dac&Email=[censored] - {'User-Agent': 'PyGoogleVoice/0.5'}
Traceback (most recent call last):
  File "examples/phones.py", line 4, in <module>
    voice.login()
  File "/usr/local/lib/python2.7/dist-packages/googlevoice/voice.py", line 96, in login
    raise LoginError
googlevoice.util.LoginError

note I have censored some sensitive data in the debug output above

@nalipaz

This comment has been minimized.

Copy link

commented Nov 24, 2016

I spent my evening trying to sort this out. However, I made very little progress. I did attempt using lynx to do all browser authentication from the server I am running pygooglevoice on. That seemed like it would work, but ultimately it seemed like the same issue. I generated an app password at the recommendation of google which stops the sms code messages (2-factor verification), but still does not make any of this work.

@chris001

This comment has been minimized.

Copy link

commented Nov 24, 2016

@nalipaz I'm not running 2 factor auth here, so it's possibly a bug. When you temporarily disable 2 factor auth does it work.

@nalipaz

This comment has been minimized.

Copy link

commented Nov 25, 2016

Okay, yes disabling two-factor authentication causes everything to work. So I guess I will have to jump on the band-wagon with the report of two-factor authentication not working.

@extrem0

This comment has been minimized.

Copy link

commented Feb 6, 2017

Did anyone noticed it stop worked recently? I'm afraid it's related to the recent changes Google did with Google voice layout. For those who aren't affected, avoid logging in you gvoice account, otherwise you'll lose the ability to use this script. Legacy's Google voice page is now Google.com/voice/b/0. I tried changing it in settings.py but it didn't fix. There is something else needed.

@nalipaz

This comment has been minimized.

Copy link

commented Feb 7, 2017

@extrem0 I haven't yet noticed it stopped working but looking at the new UI (just saw it a moment after reading your post) I bet this is broken. From what I gathered looking at the code it is loading up the pages and parsing through, so id's, form names, and classes likely changed.

@nalipaz

This comment has been minimized.

Copy link

commented Feb 7, 2017

I can confirm my script for toggling a phone's enabled state no longer works.

@jaronphillips

This comment has been minimized.

Copy link

commented Feb 21, 2019

Looks like this might not be working again. it was working fine this morning, i have not changed code and i am getting this again.
googlevoice.util.LoginError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.