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

Shared devices not appearing #90

Closed googanhiem closed 3 years ago

googanhiem commented 3 years ago

Hi @costastf, Thanks for you work with this library. I've been having an issue where some shared devices will not appear, while others will. I've tried generating the cookie from different machines and browsers (MacOS and Linux) without success.

from locationsharinglib import Service
cookies_file = '.google_maps_location_sharing.cookies.example_gmail_com'
google_email = 'example@gmail.com'
service = Service(cookies_file=cookies_file, authenticating_account=google_email)
for person in service.get_all_people():
    print(person)

This only returns one shared device (out of 2), it doesn't even return the authenticated person.

When I try to return the service.get_authenticated_person it gives this error TypeError: 'NoneType' object is not iterable

It worked in the past for all devices, but has now stopped. Any suggestions?

I believe this may be associated to the following issue https://github.com/home-assistant/core/issues/50044

costastf commented 3 years ago

Hi @googanhiem , could you please provide some debug logs with personal identifiable info retracted so i can see what is going on? I will try to make some time on sunday to have a look and reproduce it but google has a quite intensive geolocation service so things might be different per region and having your situation would probably help debugging.

googanhiem commented 3 years ago

Running debug on this it looks like the devices that didn't initiate returned this response,

DEBUG:locationsharinglib.Service:Missing essential info

These are dummy accounts used just for tracking, so there was blank account info, logging into these accounts on the device and updating the info got them working again. Specifically, looks like google maps requires more device permissions on iOS now (at least in the UK).

Also I cleaned up the cookie info a bit as well (exported it from freshly installed browser.. the google cookie really bloats after a while... 4k fresh, 16k after using a couple google services).