pe-st / garmin-connect-export

Download a copy of your Garmin Connect data, including stats and GPX tracks.
MIT License
364 stars 75 forks source link

Exporting untitled activity raises "KeyError: 'activityName'" #113

Closed gustav-b closed 1 month ago

gustav-b commented 2 months ago

Version used: 364d46b658a626e485ad6acce7779d2cafb6436e Python version: 3.8.19

Trying to export some old Garmin Connect running activities without names (displayed as “Untitled” in Garmin’s web interface) leads to the following exception:

$> python gcexport.py -f original --count 1 --start_date 2013-01-01 --end_date 2014-01-01
Welcome to Garmin Connect Exporter!
[WARNING] Output directory ./2024-07-01_garmin_connect_export already exists. Will skip already-downloaded files and append to the CSV file.
Authenticating... Done.
Getting display name... Done. displayName=<redacted>
Fetching user stats... Done.
[…]
Downloading: Garmin Connect activity Traceback (most recent call last):
  File "/tmp/garmin-connect-export/gcexport.py", line 1327, in <module>
    main(sys.argv)
  File "/tmp/garmin-connect-export/gcexport.py", line 1311, in main
    process_activity_item(
  File "/tmp/garmin-connect-export/gcexport.py", line 1164, in process_activity_item
    print(f"({current_index}/{number_of_items}) [{actvty['activityId']}] {actvty['activityName']}")
KeyError: 'activityName'

It’s only the printout Downloading: Garmin Connect activity … that bugs out on the missing activity name, the rest of the code seems to handle it just fine.

pe-st commented 1 month ago

Fix integrated in main branch, released in v4.4.0

I noticed the problem also in some of my old activities that were exported still without issues a couple of months ago. No idea if something changed on Garmin Connect....