crash correction
This commit is contained in:
@@ -336,7 +336,7 @@ class CommandorPage {
|
|||||||
if (audioBtn) {
|
if (audioBtn) {
|
||||||
log("audioBtn found")
|
log("audioBtn found")
|
||||||
audioBtn.click()
|
audioBtn.click()
|
||||||
let captchaSolver = new GeoCaptchaSolver(this.page, this.device)
|
let captchaSolver = new GeoCaptchaSolver(this.page, this.device, this.isTerminated)
|
||||||
await captchaSolver.solve((isSuccessful) => {
|
await captchaSolver.solve((isSuccessful) => {
|
||||||
if (!isSuccessful) {
|
if (!isSuccessful) {
|
||||||
this.isTerminated = true
|
this.isTerminated = true
|
||||||
|
|||||||
@@ -51,8 +51,9 @@ async function sendRequest(fileName, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class GeoCaptchaSolver {
|
class GeoCaptchaSolver {
|
||||||
constructor(page, device) {
|
constructor(page, device, isTerminated) {
|
||||||
this.page = page;
|
this.page = page;
|
||||||
|
this.isTerminated = isTerminated
|
||||||
this.device = device;
|
this.device = device;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,11 +70,16 @@ class GeoCaptchaSolver {
|
|||||||
if (!html.includes("You have been blocked")) {
|
if (!html.includes("You have been blocked")) {
|
||||||
// find wav from html
|
// find wav from html
|
||||||
await this.findTextFromWavFile(html, async (number_list) => {
|
await this.findTextFromWavFile(html, async (number_list) => {
|
||||||
|
console.log("number_list size is " + number_list.length)
|
||||||
for (let i = 1; i <= number_list.length; i++) {
|
for (let i = 1; i <= number_list.length; i++) {
|
||||||
let selector = "#captcha__audio > div.audio-captcha-input-container > input:nth-child(" + i + ")"
|
let selector = "#captcha__audio > div.audio-captcha-input-container > input:nth-child(" + i + ")"
|
||||||
// console.log("selector is " + selector)
|
// console.log("selector is " + selector)
|
||||||
await iframeHandler.locator(selector).focus()
|
try {
|
||||||
await iframeHandler.locator(selector).fill("" + number_list[i - 1])
|
await iframeHandler.locator(selector).focus()
|
||||||
|
await iframeHandler.locator(selector).fill("" + number_list[i - 1])
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
// fieldInputs[i].value = number_list[i];
|
// fieldInputs[i].value = number_list[i];
|
||||||
await delay(800 + getRandomWaitTime());
|
await delay(800 + getRandomWaitTime());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ class LinkValidator {
|
|||||||
if (!this.isTerminated) {
|
if (!this.isTerminated) {
|
||||||
try {
|
try {
|
||||||
audioBtn.click()
|
audioBtn.click()
|
||||||
let captchaSolver = new GeoCaptchaSolver(this.page, this.device)
|
let captchaSolver = new GeoCaptchaSolver(this.page, this.device, this.isTerminated)
|
||||||
await captchaSolver.solve((isSuccessful) => {
|
await captchaSolver.solve((isSuccessful) => {
|
||||||
if (!isSuccessful) {
|
if (!isSuccessful) {
|
||||||
this.isTerminated = true
|
this.isTerminated = true
|
||||||
|
|||||||
Reference in New Issue
Block a user