yannickcarer / endomondo-export

Export the most recent Endomondo workouts as TCX files.
31 stars 21 forks source link

Exporting stops after a few workouts #2

Open ghost opened 10 years ago

ghost commented 10 years ago

After exporting 18 workouts out of a total of 171 the script failed with a 403 error from the endomondo server. I suppose they have some scraping detection running, so in my local version i added a time.sleep(10) in the for loop and the accompanying import time at the top of export.py. It seems to run fine now. More patience is needed, but the 10 second sleep might be too generous. Further experimentation should be done.

appsforartists commented 10 years ago

3 seconds of sleeping isn't long enough. Just tested it.

ghost commented 10 years ago

Maybe the script should have an option. Then the users can set the delay themselves and experiment.

appsforartists commented 10 years ago

FWIW, 10 seconds didn't work for me either.

ghost commented 10 years ago

Interesting... How about making the script a bit more intelligent with the delay? Maybe catch the connection error and then increment the delay until the connection succeeds again.

appsforartists commented 10 years ago

Interesting idea. I was also thinking about randomizing the delay a bit. I don't know if the API 403s if it notices there are 10 requests in a row with identical frequency.