moderation/garmin-connect-export

Exception: Bad return code (204)

jaybe1966 opened this issue · 9 comments

When trying to download the file, I get a return code 204

        Downloading file...
Traceback (most recent call last):
  File "garmin-connect-export_moderation/gcexport.py", line 357, in <module>
    data = http_req(download_url)
  File "garmin-connect-export_moderation/gcexport.py", line 86, in http_req
    raise Exception('Bad return code (' + str(response.getcode()) + ') for: ' + url)
Exception: Bad return code (204) for: https://connect.garmin.com/modern/proxy/download-service/export/gpx/activity/1539681677?full=true

I just ran the script yesterday for one of my activities (biking) and was successfully able download the GPX file. What type of activity are you trying to retrieve.

The activity was of the type "swimming", today I tried again, the new activity which also fails is of the type "indoor cycling".
I tried the download with the web frontend, both activities didn't gave me a gpx-file to save. There happened just nothing. The download as a tcx file works well. Probably is it the problem that the download fails for all activities, that don't have GPS-Data because they are indoor activities.

I'll take a look to see if this is something we can check for. In the meantime for non-GPS activities you can run with the following option.

-f [{gpx,tcx,original}], --format [{gpx,tcx,original}]
                        export format; can be 'gpx', 'tcx', or 'original'

I need the gpx files for the nice tool GpxTrackPoster https://github.com/flopp/GpxTrackPoster, so I tried to batch download all the gpx files.
Maybe report the 204-error, ignore them and continue with downloading is an option?

I tried the download with the web frontend, both activities didn't gave me a gpx-file to save.

How can you download if they are not there or generated?

They didn't dave me a gpx-file to save locally.
When clicking on the gearwheel, there are two menuentries:
"Als TCX-Datei exportieren" -> the dialog appears to save the file on the local disk.
"Als GPX-Datei exportieren" -> nothing happens.

Hi!

This problem is still present. If there is an activity without GPS data (like swimming) downloading in gpx format results in the following error:

Traceback (most recent call last):
  File "gcexport3.py", line 344, in <module>
    data = http_req(download_url)
  File "gcexport3.py", line 104, in http_req
    raise Exception('Bad return code (' + str(response.getcode()) + ') for: ' + url)
Exception: Bad return code (204) for: https://connect.garmin.com/modern/proxy/download-service/export/gpx/activity/<id>?full=true

Maybe it could be detected by checking errs.code == 204 and ARGS.format == 'gpx' to prevent blocking the program and also writing an empty file to prevent re-downloading.

pe-st commented

@kukukk I think this is the same issue that was fixed by #8, but it got lost again in the refactoring from gcexport2.py to gcexport3.py

Fixed the regression with 74f0e34