pe-st / garmin-connect-export

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

HTTP Error 400: Bad Request when using "--count all" #15

Closed telefunker closed 6 years ago

telefunker commented 6 years ago

Hi pe-st! I've tryed to download with the "--count all" parameter and got an error; in my case it was an Error 400: Bad Request. This will happens only in conjunction with the "all" parm. Every other eg. "--count 10" or whatever else is working fine. Except when I set "--count 1732" the limit will be set to 1000 (1732 are my count of activities in GC). See the error message output:

python gcexport.py --username telefunker --password xxx --count all -f tcx -d ../garmin

Welcome to Garmin Connect Exporter! Warning: Output directory already exists. Will skip already-downloaded files and append to the CSV file. openCreateAccount=false&createAccountShown=true&consumeServiceTicket=false&embedWidget=false&service=https%3A%2F%2Fconnect.garmin.com%2Fpost-auth%2Flogin&webhost=https%3A%2F%2Fconnect.garmin.com&redirectAfterAccountCreationUrl=https%3A%2F%2Fconnect.garmin.com%2Fpost-auth%2Flogin&rememberMeShown=true&gauthHost=https%3A%2F%2Fsso.garmin.com%2Fsso&usernameShown=false&clientId=GarminConnect&id=gauth-widget&source=http%3A%2F%2Fconnect.garmin.com%2Fen-US%2Fsignin&initialFocus=true&cssUrl=https%3A%2F%2Fstatic.garmincdn.com%2Fcom.garmin.connect%2Fui%2Fcss%2Fgauth-custom-v1.2-min.css&rememberMeChecked=false&locale=en_US&displayNameShown=false&generateExtraServiceTicket=false&redirectAfterAccountLoginUrl=https%3A%2F%2Fconnect.garmin.com%2Fpost-auth%2Flogin Request login page Finish login page Post login data Finish login post login ticket=ST-0375575-xxxxxxxxxxxx-cas Request authentication URL: https://connect.garmin.com/modern/activities?ticket=ST-xxxxxxxxxxxx-cas Finished authentication Making result summary request ~~~~~~~~~~ https://connect.garmin.com/proxy/activity-search-service-1.2/json/activities?start=0&limit=1 Traceback (most recent call last): File "gcexport.py", line 710, in main(sys.argv) File "gcexport.py", line 577, in main result = http_req(URL_GC_SEARCH) File "gcexport.py", line 158, in http_req response = OPENER.open(request, data=post) # This line may throw a urllib2.HTTPError. File "/usr/lib/python2.7/urllib2.py", line 435, in open response = meth(req, response) File "/usr/lib/python2.7/urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python2.7/urllib2.py", line 473, in error return self._call_chain(args) File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain result = func(args) File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 400: Bad Request

Any idea about this? Btw. great work and many thanks for that script. Greets

pe-st commented 6 years ago

Duplicate of #14