added better user opening
This commit is contained in:
@@ -2721,6 +2721,10 @@ def fetch_strava_workout(stravatoken,oauth_data,stravaid,csvfilename,userid,debu
|
||||
'Content-Type': 'application/json',
|
||||
'resolution': 'medium',}
|
||||
url = "https://www.strava.com/api/v3/activities/"+str(stravaid)
|
||||
response = requests.get(url,headers=headers)
|
||||
if response.status_code != 200:
|
||||
print(response,response.json())
|
||||
return 0
|
||||
workoutsummary = requests.get(url,headers=headers).json()
|
||||
try:
|
||||
startdatetime = workoutsummary['start_date']
|
||||
@@ -2738,7 +2742,10 @@ def fetch_strava_workout(stravatoken,oauth_data,stravaid,csvfilename,userid,debu
|
||||
if t is not None:
|
||||
nr_rows = len(t)
|
||||
else:
|
||||
duration = int(workoutsummary['elapsed_time'])
|
||||
try:
|
||||
duration = int(workoutsummary['elapsed_time'])
|
||||
except KeyError:
|
||||
duration = 0
|
||||
t = pd.Series(range(duration+1))
|
||||
|
||||
nr_rows = len(t)
|
||||
|
||||
Reference in New Issue
Block a user