jonathang commited on
Commit
3ce46e4
1 Parent(s): 655f886

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -278,9 +278,12 @@ Do not include specific numbers.'''.replace('\n', ' '))
278
  icon_url = 'https://forecast.weather.gov/newimages/medium/'+weather_data['now']['Weatherimage']
279
  else:
280
  icon_url = weather_data[time]['iconLink']
281
- print(time, icon_url)
282
- response = requests.get(icon_url)
283
- icon = PIL.Image.open(io.BytesIO(response.content))
 
 
 
284
  # Resize the icon
285
  icon = icon.resize((60, 60))
286
  # Paste the icon on the image
 
278
  icon_url = 'https://forecast.weather.gov/newimages/medium/'+weather_data['now']['Weatherimage']
279
  else:
280
  icon_url = weather_data[time]['iconLink']
281
+ try:
282
+ response = requests.get(icon_url)
283
+ icon = PIL.Image.open(io.BytesIO(response.content))
284
+ except:
285
+ print(time, icon_url)
286
+ continue
287
  # Resize the icon
288
  icon = icon.resize((60, 60))
289
  # Paste the icon on the image