diff --git a/pynyaata/config.py b/pynyaata/config.py index 33b1824..06a8607 100644 --- a/pynyaata/config.py +++ b/pynyaata/config.py @@ -14,10 +14,14 @@ ADMIN_PASSWORD = generate_password_hash(environ.get('ADMIN_PASSWORD', 'secret')) APP_PORT = environ.get('FLASK_PORT', 5000) CACHE_TIMEOUT = environ.get('CACHE_TIMEOUT', 60 * 60) REQUESTS_TIMEOUT = environ.get('REQUESTS_TIMEOUT', 5) -TWOCAPTCHA_API_KEY = environ.get('2CAPTCHA_API_KEY') BLACKLIST_WORDS = environ.get('BLACKLIST_WORDS', '').split(',') if environ.get('BLACKLIST_WORDS', '') else [] MYSQL_ENABLED = False +TWOCAPTCHA_API_KEY = { + 'provider': '2captcha', + 'api_key': environ.get('2CAPTCHA_API_KEY') +} if environ.get('2CAPTCHA_API_KEY') else None + app = Flask(__name__) app.name = 'PyNyaaTa' app.secret_key = urandom(24).hex() diff --git a/pynyaata/connectors/core.py b/pynyaata/connectors/core.py index 56bf6bb..a874a62 100644 --- a/pynyaata/connectors/core.py +++ b/pynyaata/connectors/core.py @@ -13,10 +13,7 @@ from ..config import CACHE_TIMEOUT, IS_DEBUG, REQUESTS_TIMEOUT, TWOCAPTCHA_API_K scraper = CloudScraperWrapper.create_scraper(browser={ 'custom': 'ScraperBot/1.0' -}, recaptcha={ - 'provider': '2captcha', - 'api_key': TWOCAPTCHA_API_KEY -}) +}, recaptcha=TWOCAPTCHA_API_KEY) class ConnectorReturn(Enum):