-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url #235
Comments
I dropped down to simply using the example.py file. Each time I login, the code setting the display_name triggers this error
|
I am having the same error for the AssertionError, seems someone has reported it as an API change by Garmin in the garth library matin/garth#73 |
Good find, @pblocz, it's so fun when Garmin changes things. I'll leave this issue open for the moment, but assuming a garth fix is forthcoming, the pyproject.toml here should pick it up. |
Unfortunately I have the same BR, |
confirm the same issue, tried on 2 machines and having the same problem |
The issue seems to be with garth, as a simple example triggers the same error: Test : email = input("Enter email address: ") If there's MFA, you'll be prompted during the logingarth.login(email, password) |
This issue can be fixed (thanks to the good work of the people over at garth) by going into the Garth package file you have as part of your environment and changing the following line in Line 15-17 From: 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"
),
} to USER_AGENT = {
"User-Agent": ("GCM-iOS-5.7.2.1"),
} There's a PR on that repo to update the user agent from our great maintainer @cyberjunky , but while we wait for that to get merged and everything to update, this will work |
It appears a fix is imminent. @cyberjunky already merged a USER_AGENT fix in their fork: cyberjunky/garth#1 Assuming a garth release is forthcoming, reinstalling python-garminconnect deps should pull in the fix. Thanks all for such a fast response! No one likes it when their fitness automations are brokwn. |
Thanks guys! |
thanks. |
I just tried it, but while matin/garth#74 is being merged and a new release of garth is created, this patch should do it: import garth.http
garth.http.USER_AGENT = {"User-Agent": "GCM-iOS-5.7.2.1",} |
Temp fixed in version 0.2.22! |
Hi all, I just started receiving an error today using this lib. I was on the 0.2.14 release prior to today, so I updated to the latest 0.2.21 release. I see that MFA is now included in the example code, so I incorporated the latest init_api function. Username & password challenge seems to work with the login method, as I am challenged for an MFA one-time code. After entering the code, I then get an exception:
I didn't see any related active issues. I've made no other changes to the Python setup using garminconnect for about 10 months. I've confirmed the same credentials work fine on the Garmin Connect website. Is anyone else having the same issue of late?
The text was updated successfully, but these errors were encountered: