screenshot when blocked

This commit is contained in:
2022-10-05 11:57:58 +02:00
parent 38ccbad3ea
commit 957991c811
2 changed files with 2 additions and 3 deletions
+1
View File
@@ -85,6 +85,7 @@ class GeoCaptchaSolver {
} }
) )
} else { } else {
await this.device.screenshot({path: crypto.randomUUID() + '.png'});
await this.resetBrowser() await this.resetBrowser()
onResult(false) onResult(false)
} }
+1 -3
View File
@@ -29,7 +29,6 @@ class SolveCaptcha {
let url_get = `http://2captcha.com/in.php?key=${API_KEY}&method=userrecaptcha&googlekey=${site_key}&pageurl=${this.page.url()}`; let url_get = `http://2captcha.com/in.php?key=${API_KEY}&method=userrecaptcha&googlekey=${site_key}&pageurl=${this.page.url()}`;
let res = await axios.get(url_get) let res = await axios.get(url_get)
console.log(`statusCode: ${res.status}`); console.log(`statusCode: ${res.status}`);
console.log(res);
let results = res.data.split("|"); let results = res.data.split("|");
this.captcha_id = results[1]; this.captcha_id = results[1];
let solution = CAPCHA_NOT_READY; let solution = CAPCHA_NOT_READY;
@@ -42,7 +41,7 @@ class SolveCaptcha {
}) })
} }
handle_solution_received(solution) handle_solution_received(solution)
}catch (e) { } catch (e) {
console.log(e) console.log(e)
handle_solution_received(TWO_CAPTCHA_CONNECTION_FAILED) handle_solution_received(TWO_CAPTCHA_CONNECTION_FAILED)
} }
@@ -56,7 +55,6 @@ class SolveCaptcha {
let url_response = `http://2captcha.com/res.php?key=${API_KEY}&action=get&id=${catcha_id}`; let url_response = `http://2captcha.com/res.php?key=${API_KEY}&action=get&id=${catcha_id}`;
let res = await axios.get(url_response) let res = await axios.get(url_response)
console.log(`statusCode: ${res.status}`); console.log(`statusCode: ${res.status}`);
// console.log(res);
let results = res.data.split("|"); let results = res.data.split("|");
let solution let solution
if (results.length > 1) if (results.length > 1)