Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
282 |
-
|
283 |
-
|
|
|
|
|
|
|
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
|