diff --git a/CHANGES.md b/CHANGES.md index 9aefab6e..08fab68e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ * Change if old scandir binary module is installed, fallback to slow Python module and inform user to upgrade binary * Update SimpleJSON 3.13.2 (6ffddbe) to 3.16.0 (e2a54f7) * Update unidecode module 1.0.22 (81f938d) to 1.0.22 (578cdb9) +* Change site services tester to fallback to http if error with SSL [develop changelog] diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 901095d6..5b1e72a5 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -5347,7 +5347,19 @@ class History(MainHandler): result = {} if site_url: - resp = helpers.getURL('https://www.isitdownrightnow.com/check.php?domain=%s' % site_url) + import requests + down_url = 'www.isitdownrightnow.com' + proto = 'https' + try: + requests.head('%s://%s' % (proto, down_url), timeout=5) + except (StandardError, Exception): + proto = 'http' + try: + requests.head('%s://%s' % (proto, down_url), timeout=5) + except (StandardError, Exception): + return json.dumps(result) + + resp = helpers.getURL('%s://%s/check.php?domain=%s' % (proto, down_url, site_url)) if resp: check = resp.lower() day = re.findall(r'(\d+)\s*(?:day)', check)