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

No more country code? #116

Closed TilmanGuenther closed 4 months ago

TilmanGuenther commented 4 months ago

Not sure if this is a fixable problem or if this is something Google broke, but the data for "country_code" now always returns "None" rather than an actual country code.

My test code:

...
def publish(client):
    while True:
        time.sleep(update_interval)
        for person in service.get_all_people():
            for data in dir(person):
                if not data.startswith('_'):
                    print(topic + person.nickname + "/" + data, str(getattr(person, data)))
                    client.publish(topic + person.nickname + "/" + data, str(getattr(person, data)))
...
costastf commented 4 months ago

Hi @TilmanGuenther , that indeed seems to be the case, as in Google sends a None where the country code data used to be, at least in my location. I know that there is localization so it might not be true everywhere but it is true in your case and mine at least. Also indeed, nothing can be done about that, if there is no data it just is what it is. :(