Issue with the python upload script garminbadges-updater.py

The python upload script garminbadges-updater.py found here is currently not working. Garmin changed something on their side which breaks Garth (the python package that handles communication with Garmin Connect).

The issue is being discussed here: https://github.com/matin/garth/issues/73

Until it is fixed in Garth, released and the user updates the package there is a fix that works.

Locate the garth package on your computer. On my Windows machine it is found at this path:
C:\Users\[my user]\AppData\Roaming\Python\Python312\site-packages\garth

Open the file http.py in a text editor.

Locate this code:

USER_AGENT = {
    "User-Agent": (
        "Mozilla/5.0 (iPhone; CPU iPhone OS 16_5 like Mac OS X) "
        "AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
    ),
}

And change it to:

USER_AGENT = {
    "User-Agent": ("GCM-iOS-5.7.2.1"),
}

Save the file and everything should work again.



Garmin Badge Database
Garmin Connect
Change country setting


Comments

  1. Garth may be installed to `c:\Program Files\Python312\Lib\site-packages\garth\`

    ReplyDelete
  2. Found it there on Mac OS : /opt/homebrew/lib/python3.10/site-packages/garth/http.py

    ReplyDelete

Post a Comment

Popular posts from this blog

Dance Fitness has arrived

June 2024 - Challenges and Badges

August 2024 - Challenges and Badges