Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no file named locations.json in the google download #57

Open
johnrsibert opened this issue Aug 24, 2022 · 3 comments
Open

There is no file named locations.json in the google download #57

johnrsibert opened this issue Aug 24, 2022 · 3 comments
Labels
Bug Something isn't working

Comments

@johnrsibert
Copy link

johnrsibert commented Aug 24, 2022

$ uname -a
Linux kihikihi 5.4.0-124-generic #140-Ubuntu SMP Thu Aug 4 02:23:37 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

$ python3 --version
Python 3.8.10

$ python3 geo_heatmap.py ~/Projects/Trips/Takeout/Location\ History/Semantic\ Location\ History/2022/2022_AUGUST.json

(1/3) Loading data from /home/jsibert/Projects/Trips/Takeout/Location History/Semantic Location History/2022/2022_AUGUST.json
Traceback (most recent call last):
File "geo_heatmap.py", line 327, in
generator.run(data_file, output_file, date_range, stream_data, settings)
File "geo_heatmap.py", line 258, in run
self.loadJSONData(json_file, date_range)
File "geo_heatmap.py", line 57, in loadJSONData
first_element = data["locations"][0]
KeyError: 'locations'

@johnrsibert johnrsibert added the Bug Something isn't working label Aug 24, 2022
@johnrsibert
Copy link
Author

The user misinterpreted the error message. This is a user problem not a bug and the user will track it down.

@johnrsibert
Copy link
Author

It seem in my cursory reading of the README, that I misunderstood the file names and directory structure. Also my takeout download from google does not contain files named "locations.json" or "Location History.json". Instead my takeout contains "Records.json." So the following command seems to work as expected in a bash terminal under linux:
./geo_heatmap.py ~/Projects/Trips/Takeout/Location\ History/Records.json --min-date 2022-08-19 --max-date 2022-08-19

Does google arbitrarily change file name? Or is it browser (I use Firefox) or OS (I use linux) dependent/

Note the '\' character to escape the space in the path name. Also it was necessary to convert the DOS line endings in the python source to unix line endings (with fromdos).

luka1199 added a commit that referenced this issue Sep 4, 2022
@luka1199
Copy link
Owner

luka1199 commented Sep 4, 2022

I think they changed the file name with the update of the location history format a couple of months ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants