kjkjava / garmin-connect-export

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

Error 410 and solution #29

Open jamesdunham opened 7 years ago

jamesdunham commented 7 years ago

Posting in case helpful. For a recent activity of mine, which I added to Connect manually, no GPX is available (see screenshot). Therefore with command-line defaults,

Traceback (most recent call last):
  File "./gcexport.py", line 231, in <module>
    raise Exception('Failed. Got an unexpected HTTP error (' + str(e.code) + ').')
Exception: Failed. Got an unexpected HTTP error (410).

When adding --format 'original', however, the export is successful.

Screenshot:

screenshot from 2017-02-08 14-07-10

micahwilli commented 7 years ago

I also used original to download the files, that downloaded as a .fit file. not as friendly as a GPX.

joetimmerman commented 7 years ago

I was running into a similar issue (except getting a 204 error). I fixed this for myself in my own fork if you'd like to check it out and modify it as necessary: https://github.com/joetimmerman/garmin-connect-export

I took the code from @moderation mentioned in one of the other issues, added exception handling for the 204 error, and added a "-n" switch which skips the xml validation step for .gpx files (otherwise I would get an uncaught exception from the parseString(data) call.) If you're still getting that same 410 error, it should be pretty easy to just add that check in the exception handling.

Also added a verbose option as suggested in the todo.

moderation commented 7 years ago

@joetimmerman cool to see some of my code in your fork. Considering the last commit to this repo was December 2015 and the code as is doesn't work it is probably time for @kjkjava to deprecate and point to some of the working forks.

joetimmerman commented 7 years ago

@moderation agreed. Looks like @ebrensi has a fork with Python 3 compatibility and fixes for a few other issues (although I suspect it probably doesn't actually work at the moment due to the Garmin problems you addressed in your code). Might be worth trying to merge these two versions into a new repo.