try except for date 2

This commit is contained in:
Justin 2023-04-27 18:51:52 +08:00 committed by GitHub
parent 949b64f28c
commit 150aa672ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1026,7 +1026,10 @@ def updateLeagueEvents(api_key, time, logf):
for d in all_data[league][ten_or_fifteen]:
event = {}
event['date'] = d['dateEvent']
try:
event['date2'] = d['dateEvent2']
except:
pass
if time == 'live':
event['progess'] = d['strProgress']
@ -1034,7 +1037,10 @@ def updateLeagueEvents(api_key, time, logf):
else:
if (league == 'PGA') or (league == 'LPGA') or (league == 'PGA_EU') or (league == 'LIV') or (league == 'F1') or (league == 'NASCAR'):
event['date'] = d['dateEvent']
try:
event['date2'] = d['dateEvent2']
except:
pass
event['event'] = d['strEvent'].replace("\u2019","'")
event['venue'] = d['strVenue'].replace("\u2019","'")
event['city'] = d['strCity'].replace("\u2019","'")