fixing premier league

This commit is contained in:
Justin 2022-03-03 23:01:42 +08:00 committed by GitHub
parent b320c49505
commit 46f42a388b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -379,8 +379,8 @@ def updateLeagueTables(api_key):
leagues_info = {} leagues_info = {}
for league in leagues: for league in leagues:
if league == 'Premier League': if league == 'PREMIERLEAGUE':
url += 'PL,' url += 'premierleague,'
else: else:
url += league + ',' url += league + ','
@ -450,8 +450,8 @@ def updateLeagueEvents(api_key, time):
for league in leagues: for league in leagues:
if league == 'Premier League': if league == 'PREMIERLEAGUE':
url += 'PL,' url += 'premierleague,'
else: else:
url += league + ',' url += league + ','
url = url[:-1] # remove last comma url = url[:-1] # remove last comma
@ -487,7 +487,7 @@ def updateLeagueEvents(api_key, time):
event['home_score'] = d['intHomeScore'] event['home_score'] = d['intHomeScore']
events.append(event) events.append(event)
leagues_info[league] = events leagues_info[league.upper()] = events
all_settings['leagues'] = leagues_info all_settings['leagues'] = leagues_info
json.dump(all_settings, open( "csv/{}_games.json".format(time), 'w+' )) json.dump(all_settings, open( "csv/{}_games.json".format(time), 'w+' ))