From 702963901482bc140d43d5d6cf78ff2b78e0033a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Fri, 10 May 2019 09:39:47 -0400 Subject: [PATCH] Fix for anti-captcha class defined even if credentials are empty. --- bazarr/init.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bazarr/init.py b/bazarr/init.py index 2ee74877b..b53755bee 100644 --- a/bazarr/init.py +++ b/bazarr/init.py @@ -17,10 +17,10 @@ from utils import get_binary os.environ["SZ_USER_AGENT"] = "Bazarr/1" # set anti-captcha provider and key -if settings.general.anti_captcha_provider == 'anti-captcha': +if settings.general.anti_captcha_provider == 'anti-captcha' and settings.anticaptcha.anti_captcha_key != "": os.environ["ANTICAPTCHA_CLASS"] = 'AntiCaptchaProxyLess' os.environ["ANTICAPTCHA_ACCOUNT_KEY"] = settings.anticaptcha.anti_captcha_key -elif settings.general.anti_captcha_provider == 'death-by-captcha': +elif settings.general.anti_captcha_provider == 'death-by-captcha' and settings.deathbycaptcha.username != "" and settings.deathbycaptcha.password != "": os.environ["ANTICAPTCHA_CLASS"] = 'DeathByCaptchaProxyLess' os.environ["ANTICAPTCHA_ACCOUNT_KEY"] = ':'.join({settings.deathbycaptcha.username, settings.deathbycaptcha.password}) else: