Skip to content

Commit

Permalink
path dispatch: support both "Location History" and "Location History …
Browse files Browse the repository at this point in the history
…(Timeline)" directories

in my case, locations were present in

- `Takeout/Location History/Location History.json` (since at least 2018)
- `Takeout/Location History/Records.json` (circa Apr 2022)
- `Takeout/Location History (Timeline)/Records.json` (circa Feb 2024)
- "Semantic Location History" appeared around Jan 2020 and also present under both paths

partially addresses #69
  • Loading branch information
karlicoss committed Sep 12, 2024
1 parent 80efc05 commit f5be039
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 5 additions & 3 deletions google_takeout_parser/locales/de.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
r"Chrome": None, # Ignore rest of Chrome stuff
r"Google Play Store/Installs.json": _parse_app_installs,
r"Google Play Store/": None, # ignore anything else in Play Store
r"Location History \(Timeline\)/Semantic Location History/.*/.*.json": _parse_semantic_location_history,
r"Location History \(Timeline\)/Records.json": _parse_location_history,
r"Location History \(Timeline\)/": None, # ignore anything else in Location History
# optional space to handle pre-2017 data
r"Location History/Location( )?History.json": _parse_location_history, # old path to Location History
r"Location History( \(Timeline\))?/Records.json": _parse_location_history,
r"Location History( \(Timeline\))?/Semantic Location History/.*/.*.json": _parse_semantic_location_history,
r"Location History( \(Timeline\))?/": None, # ignore anything else in Location History
# Youtube
r"YouTube( und YouTube Music)?/Verlauf/.*?.html": _parse_html_activity,
r"YouTube( und YouTube Music)?/Verlauf/.*?.json": _parse_json_activity,
Expand Down
7 changes: 3 additions & 4 deletions google_takeout_parser/locales/en.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@
r"Chrome": None, # Ignore rest of Chrome stuff
r"Google Play Store/Installs.json": _parse_app_installs,
r"Google Play Store/": None, # ignore anything else in Play Store
r"Location History/Semantic Location History/.*/.*.json": _parse_semantic_location_history,
# optional space to handle pre-2017 data
r"Location History/Location( )?History.json": _parse_location_history, # old path to Location History
r"Location History/Records.json": _parse_location_history, # new path to Location History
r"Location History/Settings.json": None,
r"Location History \(Timeline\)/Settings.json": None,
r"Location History( \(Timeline\))?/Records.json": _parse_location_history,
r"Location History( \(Timeline\))?/Semantic Location History/.*/.*.json": _parse_semantic_location_history,
r"Location History( \(Timeline\))?/": None, # ignore anything else in Location History
# HTML/JSON activity-like files which aren't in 'My Activity'
# optional " and Youtube Music" to handle pre-2017 data
r"YouTube( and YouTube Music)?/history/.*?.html": _parse_html_activity,
Expand Down

0 comments on commit f5be039

Please sign in to comment.