From a57510aa0d73eac37b09ff6a0f91e043d7fae1da Mon Sep 17 00:00:00 2001 From: ngosang Date: Sun, 10 Jan 2021 15:04:18 +0100 Subject: [PATCH] Allow to configure "none" captcha resolver --- README.md | 2 +- src/captcha/index.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b1a66ef..0df1e6c 100644 --- a/README.md +++ b/README.md @@ -225,7 +225,7 @@ LOG_LEVEL | info | Used to change the verbosity of the logging. Use `LOG_LEVEL=d LOG_HTML | false | Used for debugging. If `true` all HTML that passes through the proxy will be logged to the console in `debug` level. PORT | 8191 | Change this if you already have a process running on port `8191`. HOST | 0.0.0.0 | This shouldn't need to be messed with but if you insist, it's here! -CAPTCHA_SOLVER | None | This is used to select which captcha solving method it used when a captcha is encountered. +CAPTCHA_SOLVER | none | This is used to select which captcha solving method it used when a captcha is encountered. HEADLESS | true | This is used to debug the browser by not running it in headless mode. Environment variables are set differently depending on the operating system. Some examples: diff --git a/src/captcha/index.ts b/src/captcha/index.ts index 0c39568..0f950b0 100644 --- a/src/captcha/index.ts +++ b/src/captcha/index.ts @@ -18,7 +18,9 @@ const captchaSolvers: { [key: string]: Solver } = {} export default (): Solver => { const method = process.env.CAPTCHA_SOLVER - if (!method) { return null } + if (!method || method.toLowerCase() == 'none') { + return null; + } if (!(method in captchaSolvers)) { try {