costastf / locationsharinglib

A library to retrieve coordinates from an google account that has been shared locations of other accounts.
MIT License
170 stars 29 forks source link

get-maps-cookies throwing NoExpectedFormOption #34

Closed jawilson closed 6 years ago

jawilson commented 6 years ago

I'm receiving the following:

root@8d39e5becd4b:~# get-maps-cookies -e [redacted] -p [redacted]
Traceback (most recent call last):
  File "/usr/local/bin/get-maps-cookies", line 11, in <module>
    load_entry_point('locationsharinglib==2.0.11', 'console_scripts', 'get-maps-cookies')()
  File "/usr/local/lib/python3.6/site-packages/locationsharinglib/cli.py", line 83, in main
    CookieGetter(args.email, args.password, args.cookies_file)
  File "/usr/local/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 315, in __init__
    cookies_file=cookies_file)
  File "/usr/local/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 198, in __init__
    self._authenticate()
  File "/usr/local/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 324, in _authenticate
    selection_form = self._skip_challenge(response)
  File "/usr/local/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 283, in _skip_challenge
    form = self._get_required_form(response, '/signin/challenge/skip')
  File "/usr/local/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 272, in _get_required_form
    raise NoExpectedFormOption
locationsharinglib.locationsharinglibexceptions.NoExpectedFormOption
costastf commented 6 years ago

Hi @jawilson . I am on vacation until the 24th so I will not be able to look into this until then. If you have any python skills what you could do is edit that last exception to print the response received so we can see what goes on.

phdelodder commented 6 years ago

I have the same issue, see attachment. reponse.txt

costastf commented 6 years ago

Please read #27 and make sure you have enabled push 2fa.I will look into this after the 24th.

phdelodder commented 6 years ago

Currenlty 2fa is disabled for the specific account. When I open the response in a browser, I get this: image

costastf commented 6 years ago

That means that your phone is not set up for your account. Seems like you have 2fa enabled but not a mobile connected, or something.

phdelodder commented 6 years ago

I have now fixed it by adding the account to my phone and using push prompt.

I do have to make a remark, if the device is unknown I need to chose a number, when you select the wrong number the device is blocked.

costastf commented 6 years ago

That is google process I am afraid and has nothing to do with this library. I am glad that things now work for you!

costastf commented 6 years ago

@jawilson could it be that your issue is the same?

kdanthony commented 6 years ago

I'm actually having the same issue and when dumping out the response.text the form has a captcha response in it. I don't get that on any other browser. It's not showing up in the device activity either.

costastf commented 6 years ago

Are you sure you are using the latest version of the library?

kdanthony commented 6 years ago

I'm specifically using this within homeassistant but moved on to testing lower level with the cookie retrieval since it doesn't seem to be working in homeassistant. It's a virtualenv that has 2.0.11 installed as part of homeassistant:

homeassistant) homeassistant@homeautomation:~/.homeassistant$ pip3.6 show locationsharinglib Name: locationsharinglib Version: 2.0.11

jawilson commented 6 years ago

I'm also getting the captcha, I checked out from GitHub to be sure.

costastf commented 6 years ago

I will have a look at the captcha prompt issue after I am back from vacation after the 24th, so please be patient.

kdanthony commented 6 years ago

So after waiting a few days and trying again I finally did get a sign-in alert from google to be able to approve and things look good now. Unsure why it was not showing up before but all works well now. Thanks.

costastf commented 6 years ago

Closing this as it seems that it is a missing google account setting from the user's side.