diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index c4b65c8..8b65bda 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -312,7 +312,6 @@ class CommandorPage { async inputPhoneNumber(page) { logWithDevice("inputPhoneNumber", this.device) - try { if (this.browser.isConnected() && !this.isTerminated) { if (!this.isPhoneInput) { @@ -325,7 +324,7 @@ class CommandorPage { } }) await delay(1000); - await page.keyboard.type("0" + this.contact.phoneNumber); + await page.keyboard.type("+33 " + this.contact.phoneNumber); this.isPhoneInput = true; } } @@ -576,7 +575,7 @@ class CommandorPage { let pageContent = await page.content() let hasCaptcha = pageContent.includes("g-recaptcha-response") if (hasCaptcha) { - // await this.clickCheckbox() + await this.clickCheckbox() await delay(1000) this.captchaSolver = new SolveCaptcha(page); await this.captchaSolver.start((solution) => { @@ -701,7 +700,7 @@ class CommandorPage { } // save to mongoDb let reserve = ReserveResultPojo.create_from_contact(this.contact, id, url, this.choosedStore, publishType); - reserve.source_from = this.device.model(); + reserve.source_from = this.device.serial(); await this.mongoManager.saveReserveToDb(reserve.to_mongo_dict()) await this.page.close(); // await this.deleteFromBlackList() diff --git a/src/workers/SlidingCaptchaSolver.js b/src/workers/SlidingCaptchaSolver.js index d1a5754..a7d479e 100644 --- a/src/workers/SlidingCaptchaSolver.js +++ b/src/workers/SlidingCaptchaSolver.js @@ -62,7 +62,7 @@ class SlidingCaptchaSolver { let x1 = (targetPosition.x2 + targetPosition.x1) / 2.0; let width = targetPosition.x2 - targetPosition.x1; let randomTime = randomIntFromInterval(100, 500) - let cmd = `adb -s ${device.serial()} shell input swipe ${x0} ${y0} ${x1 + width * 0.5} ${y0} ${1000 + randomTime}` + let cmd = `adb -s ${device.serial()} shell input touchscreen swipe ${x0} ${y0} ${x1 + width * 0.5} ${y0} ${600 + randomTime}` await delay(2000); console.log("cmd is " + cmd); console.log("will slide captcha");