FIX: attempted fix at invalid provider test returns (newznab-based)

This commit is contained in:
evilhero 2018-06-28 13:04:28 -04:00
parent 8932e6e665
commit 1d82dd0dfb
2 changed files with 3 additions and 2 deletions

View File

@ -3439,9 +3439,10 @@ def newznab_test(name, host, ssl, apikey):
host = host + 'api'
else:
host = host + '/api'
headers = {'User-Agent': str(mylar.USER_AGENT)}
logger.info('host: %s' % host)
try:
r = requests.get(host, params=params, verify=bool(ssl))
r = requests.get(host, params=params, headers=headers, verify=bool(ssl))
except Exception as e:
logger.warn('Unable to connect: %s' % e)
return

View File

@ -5436,7 +5436,7 @@ class WebInterface(object):
logger.info('Successfully tested %s [%s] - valid api response received' % (name, host))
return 'Successfully tested %s!' % name
else:
logger.warn('Testing failed to %s [HOST:%s][SSL:%s]' % (name, host, ssl))
logger.warn('Testing failed to %s [HOST:%s][SSL:%s]' % (name, host, bool(ssl)))
return 'Error - failed running test for %s' % name
testnewznab.exposed = True