1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-24 08:43:01 +00:00

Fix for anti-captcha class defined even if credentials are empty.

This commit is contained in:
Louis Vézina 2019-05-10 09:39:47 -04:00
parent 12d942125d
commit 7029639014

View file

@ -17,10 +17,10 @@ from utils import get_binary
os.environ["SZ_USER_AGENT"] = "Bazarr/1" os.environ["SZ_USER_AGENT"] = "Bazarr/1"
# set anti-captcha provider and key # 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_CLASS"] = 'AntiCaptchaProxyLess'
os.environ["ANTICAPTCHA_ACCOUNT_KEY"] = settings.anticaptcha.anti_captcha_key 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_CLASS"] = 'DeathByCaptchaProxyLess'
os.environ["ANTICAPTCHA_ACCOUNT_KEY"] = ':'.join({settings.deathbycaptcha.username, settings.deathbycaptcha.password}) os.environ["ANTICAPTCHA_ACCOUNT_KEY"] = ':'.join({settings.deathbycaptcha.username, settings.deathbycaptcha.password})
else: else: