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

Missing essential info #91

Closed inverse closed 3 years ago

inverse commented 3 years ago

I raised this https://github.com/home-assistant/core/issues/54171 issue on the Home Assistant project.

I decided to investigate the issue against this library (4.1.8) and noticed when running:

from locationsharinglib import Service
import logging

logging.basicConfig(level=logging.DEBUG)

cookies_file = 'cookies.txt'
google_email = '<redacted>@gmail.com'
service = Service(cookies_file=cookies_file, authenticating_account=google_email)
persons = service.get_all_people()
for person in persons:
    print(person)

The following error:

Missing essential info, cannot instantiate authenticated person <redacted>@gmail.com: list index out of range

Any idea what's up? The output list only has 8 elements. What's expected in the 9th?

Looks related to #88

inverse commented 3 years ago

Okays - looks like my cookie was invalid for whatever reason. Going through the whole flow again seemed to work. It looks like while logging into my "hassio" account through private mode it was leaking cookies through the plugin (ouch) as It was listing all accounts in my main account.

Getting the cookies through Firefox which I don't use that often solved it for me.

costastf commented 3 years ago

Glad you sorted this out ☺️