Merge pull request #302 from fmatray/noai

Update ohcapi.py
This commit is contained in:
Jayofelony
2025-01-16 07:37:10 +01:00
committed by GitHub

View File

@ -70,7 +70,12 @@ class ohcapi(plugins.Plugin):
return return
# Check if the internet is still available by pinging Google # Check if the internet is still available by pinging Google
response = requests.get('https://www.google.com', timeout=5) try:
response = requests.get('https://www.google.com', timeout=5)
except requests.ConnectionError:
self.internet_active = False
return
if response.status_code == 200: if response.status_code == 200:
self.internet_active = True self.internet_active = True
else: else: