diff --git a/CHANGES.md b/CHANGES.md index c3be39c1..35ff0bb4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ * Change improve security with DNS rebinding prevention, set "Allowed browser hostnames" at config/General/Web Interface * Change improve test for creating self-signed SSL cert * Change force restart when switching SSL on/off +* Change disable SSL cert verification for logins in pp-scripts * Change hachoir targa and mpeg_ts mime parser tags so they validate * Update backports/ssl_match_hostname 3.5.0.1 (r18) to 3.7.0.1 (r28) * Update cachecontrol library 0.12.3 (db54c40) to 0.12.4 (bd94f7e) diff --git a/autoProcessTV/SickGear-NG/SickGear-NG.py b/autoProcessTV/SickGear-NG/SickGear-NG.py index 08bd61b6..02348085 100755 --- a/autoProcessTV/SickGear-NG/SickGear-NG.py +++ b/autoProcessTV/SickGear-NG/SickGear-NG.py @@ -156,7 +156,7 @@ import os import re import sys -__version__ = '1.3' +__version__ = '1.4' verbose = 0 or 'yes' == os.environ.get('NZBPO_SG_VERBOSE', 'no') @@ -485,7 +485,7 @@ def call_sickgear(nzb_name, dir_name, test=False): s = requests.Session() if username or password: login = '%s%s:%s%s/login' % (protocol, host, port, webroot) - r = s.get(login) + r = s.get(login, verify=False) login_params = {'username': username, 'password': password} if 401 == r.status_code and r.cookies.get('_xsrf'): login_params['_xsrf'] = r.cookies.get('_xsrf') diff --git a/autoProcessTV/autoProcessTV.py b/autoProcessTV/autoProcessTV.py index 2c91bc21..b39fae7b 100755 --- a/autoProcessTV/autoProcessTV.py +++ b/autoProcessTV/autoProcessTV.py @@ -133,7 +133,7 @@ def processEpisode(dir_to_process, org_NZB_name=None, status=None): try: sess = requests.Session() if username or password: - r = sess.get(login_url) + r = sess.get(login_url, verify=False) login_params = {'username': username, 'password': password} if 401 == r.status_code and r.cookies.get('_xsrf'): login_params['_xsrf'] = r.cookies.get('_xsrf') diff --git a/autoProcessTV/mediaToSickbeard.py b/autoProcessTV/mediaToSickbeard.py index 24174365..836778c5 100755 --- a/autoProcessTV/mediaToSickbeard.py +++ b/autoProcessTV/mediaToSickbeard.py @@ -181,7 +181,12 @@ def main(): try: sess = requests.Session() - sess.post(login_url, data={'username': username, 'password': password}, stream=True, verify=False) + if username or password: + r = sess.get(login_url, verify=False) + login_params = {'username': username, 'password': password} + if 401 == r.status_code and r.cookies.get('_xsrf'): + login_params['_xsrf'] = r.cookies.get('_xsrf') + sess.post(login_url, data=login_params, stream=True, verify=False) response = sess.get(url, auth=(username, password), params=params, verify=False, allow_redirects=False) except Exception as e: scriptlogger.error(u': Unknown exception raised when opening url: ' + str(e))