logo_files list

This commit is contained in:
Justin 2023-04-18 15:23:24 +08:00 committed by GitHub
parent 154121b3d9
commit c850d0233c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -917,6 +917,7 @@ def updateLeagueEvents(api_key, time, logf):
events.append(event)
if time == 'upcoming':
try:
logo_files = []
for each in all_data['UFC'][0]['fights']:
if each['fighter1pic'].split('/')[-1] not in os.listdir('logos/ufc/'):
urllib.request.urlretrieve(each['fighter1pic'],'logos/ufc/' + each['fighter1pic'].split('/')[-1])
@ -937,6 +938,7 @@ def updateLeagueEvents(api_key, time, logf):
pass
elif time == 'past':
try:
logo_files = []
for each in all_data['UFC'][0]['fights']:
if each['fighter1pic'].split('/')[-1] not in os.listdir('logos/ufc_past/'):
urllib.request.urlretrieve(each['fighter1pic'],'logos/ufc_past/' + each['fighter1pic'].split('/')[-1])