cyberjunky / python-garminconnect

Python 3 API wrapper for Garmin Connect to get activity statistics
MIT License
963 stars 149 forks source link

download.activity() error #202

Closed darroni closed 7 months ago

darroni commented 7 months ago

Exception thrown when .download_activity method is run:

Traceback (most recent call last):
  File "c:\Users\darroni\OneDrive\Source\Python\fitness\garmindl.py", line 50, in <module>
    client.download_activity(activity_id, filename, dl_fmt=client.ActivityDownloadFormat.ORIGINAL)
TypeError: Garmin.download_activity() got multiple values for argument 'dl_fmt'

On this code:

for activity in activities:
        if "Zwift" not in activity["activityName"] and "virtual_ride" in activity["activityType"]["typeKey"]:
            activity_id = activity["activityId"]
            filename = f"{folder}\\{activity_id}.fit"
            client.download_activity(activity_id, filename, dl_fmt=client.ActivityDownloadFormat.ORIGINAL)
darroni commented 7 months ago

Sorted this issue after reviewing the example.py. Realized that I couldn't pass the "filename" parameter inside the download_activity method.