Hey! I'm running the code from the docker image and failing to import any.
For "Just Ride" workouts, using peloton
or peloton.ride
or other combinations of this in ?joins
causing the application to fail.
Here is the console log:
2020-12-10 04:24:26,696 - INFO - peloton-to-garmin: Get latest 1 workouts. 2020-12-10 04:24:26,756 - INFO - peloton-to-garmin: Get workout: 35b4d08262014fe58b77018388f151f7 2020-12-10 04:24:26,793 - ERROR - peloton-to-garmin.Util: handle_error - Url: https://api.pelotoncycle.com/api/workout/35b4d08262014fe58b77018388f151f7?joins=peloton,peloton.ride,peloton.ride.instructor,user 2020-12-10 04:24:26,794 - ERROR - peloton-to-garmin.Util: handle_error - Headers: {'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Cookie': '__cfduid=d15f9738116636a24bf3ca2a8190ef2d91607574266; __cfruid=241c31948516ce6bc439a7986a032f156c0ee809-1607574266; peloton_session_id=3e7d0d8db54d4988a690b7037acf4538; peloton_session_id=3e7d0d8db54d4988a690b7037acf4538', 'Content-Length': '2', 'Content-Type': 'application/json'} 2020-12-10 04:24:26,794 - ERROR - peloton-to-garmin.Util: Exception: 400: Request was invalid
I tried to curl https://api.pelotoncycle.com/api/workout/35b4d08262014fe58b77018388f151f7?joins=peloton,peloton.ride,peloton.ride.instructor,user
and got as response:
{ "status": 400, "error_code": 2120, "subcode": null, "message": "Bad joins", "details": null }
However, if I remove peloton
from the query - it works as expected:
https://api.pelotoncycle.com/api/workout/35b4d08262014fe58b77018388f151f7?joins=ride,ride.instructor,user
{ "created_at": 1607559539, "device_type": "home_bike_v1", "end_time": 1607563742, "fitbit_id": null, "fitness_discipline": "cycling", "has_pedaling_metrics": true, "has_leaderboard_metrics": false, "id": "35b4d08262014fe58b77018388f151f7", "is_total_work_personal_record": false, "metrics_type": "cycling", "name": "Cycling Workout", "peloton_id": null, "platform": "commercial_bike", "start_time": 1607559541, "strava_id": null, "status": "COMPLETE", "timezone": "America/New_York", "title": "70 min 1 sec Just Ride", "total_work": 974721.83, "user_id": "0724e6f65c88492fb963517c4b3fb9e9", "workout_type": "freestyle", "total_video_watch_time_seconds": 0, "total_video_buffering_seconds": 0, "v2_total_video_watch_time_seconds": null, "v2_total_video_buffering_seconds": null, "ride": { "id": "00000000000000000000000000000000", "is_archived": false, "instructor": { "name": "JUST RIDE", "image_url": "https://s3.amazonaws.com/peloton-ride-images/just-ride.png" }, "title": "70 min 1 sec Just Ride", "scheduled_start_time": 1607559539, "duration": 4201 }, "device_type_display_name": "Bike" }