Closed kenthua closed 6 years ago
This looks like you get presented with multiple forms for redirection which was is not expected. Sadly I don't have time to work on this before next Thursday but then I will make a version that logs this so we can troubleshoot and fix it. Thanks for reporting this and sorry for the delay in reacting to it.
Could you please give v.2.0.5 a test and let me know? I have handled that error and we can see the debug message. Please be careful in pasting anything since the message might contain personal information.
Thanks for looking into this. I'm still getting the same error on v2.0.7 as well.
Traceback (most recent call last):
File "/usr/local/bin/get-maps-cookies", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.6/site-packages/locationsharinglib/cli.py", line 81, in main
CookieGetter(args.email, args.password, args.cookies_file)
File "/usr/local/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 314, in __init__
cookies_file=cookies_file)
File "/usr/local/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 197, in __init__
self._authenticate()
File "/usr/local/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 323, in _authenticate
selection_form = self._skip_challenge(response)
File "/usr/local/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 282, in _skip_challenge
form = self._get_required_form(response, '/signin/challenge/skip')
File "/usr/local/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 268, in _get_required_form
if form.get('action', '') == action], None)
TypeError: 'list' object is not an iterator
Here is the normal path from a browser. Email -> Password -> 2FA number
One thing I noticed is after trying to run the get-maps-cookies or cli.py once, that the login prompt does change.
Email -> Password -> Password + Captcha -> 2FA
Not sure if in the flow of your code it triggers the captcha path which may need to be accounted for.
I still get this, any progress ?
I get this on an account without 2FA.
Could you please try v2.0.9? I had a moronic issue on the previous version and that is why we got the exception. With this version we should get a nice logging of the actual response with the failure so we can troubleshoot and fix the issue. Please pay attention in providing the output for personal data, and excuses for the really long reply time but I was on vacation.
Still an issue, but as you noted more info. This is with 2.0.11
Traceback (most recent call last):
File "/opt/homeassistant_venv/bin/get-maps-cookies", line 11, in <module>
sys.exit(main())
File "/opt/homeassistant_venv/lib64/python3.6/site-packages/locationsharinglib/cli.py", line 83, in main
CookieGetter(args.email, args.password, args.cookies_file)
File "/opt/homeassistant_venv/lib64/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 315, in __init__
cookies_file=cookies_file)
File "/opt/homeassistant_venv/lib64/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 198, in __init__
self._authenticate()
File "/opt/homeassistant_venv/lib64/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 324, in _authenticate
selection_form = self._skip_challenge(response)
File "/opt/homeassistant_venv/lib64/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 283, in _skip_challenge
form = self._get_required_form(response, '/signin/challenge/skip')
File "/opt/homeassistant_venv/lib64/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 272, in _get_required_form
raise NoExpectedFormOption
locationsharinglib.locationsharinglibexceptions.NoExpectedFormOption
Do you mind running that with debugging on so we can see the actual response and try to figure things out?
i'll comment on #27 , seems like we are having similar issues
Looks like the action / form may have changed? Using get-maps-cookies on an account with 2FA enabled.