From 5687abf316aeadd2ab7208651909e585a6755072 Mon Sep 17 00:00:00 2001 From: PAN Lei Date: Fri, 20 Sep 2024 17:00:32 +0200 Subject: [PATCH 1/3] Add .gitignore --- .gitignore | 3 +++ schedule.js | 5 ++++- src/workers/SlidingCaptchaSolver.js | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..683bb60 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules +.idea +*.png \ No newline at end of file diff --git a/schedule.js b/schedule.js index e1489aa..a8c4479 100644 --- a/schedule.js +++ b/schedule.js @@ -1,9 +1,12 @@ const {startBookWithNumbers, scheduleBookWithNumbers} = require('./src/appointment') const schedule = require("node-schedule"); +const {homedir} = require("os"); +homeDir = homedir() + //faubourg, random schedule.scheduleJob('30 10 * * *', function () { console.log("start startBookWithNumbers") - startBookWithNumbers(1, 6000, "random", "/Users/panlei/Desktop/03_05_to_test.xlsx", true, false).then((r) => { + startBookWithNumbers(1, 6000, "random", homedir() + "/Desktop/contact_list_2024-09-11.xlsx", true, false).then((r) => { console.log(r) }) }) \ No newline at end of file diff --git a/src/workers/SlidingCaptchaSolver.js b/src/workers/SlidingCaptchaSolver.js index 66dc51f..73676b0 100644 --- a/src/workers/SlidingCaptchaSolver.js +++ b/src/workers/SlidingCaptchaSolver.js @@ -5,8 +5,8 @@ const axios = require("axios"); const {v4: uuidv4} = require('uuid'); const OCRResult = require("../models/OCRResult"); -// const DEEPLEARNING_CAPTCHA_HOST = "http://appointment.lpaconsulting.fr:9000" -const DEEPLEARNING_CAPTCHA_HOST = "http://192.168.0.36:9000" +const DEEPLEARNING_CAPTCHA_HOST = "http://appointment.lpaconsulting.fr:9000" +// const DEEPLEARNING_CAPTCHA_HOST = "http://192.168.0.36:9000" function delay(delayInMs) { return new Promise(resolve => { From 002705b36a7e94d143283bb95ce21656d7f493d1 Mon Sep 17 00:00:00 2001 From: PAN Lei Date: Fri, 20 Sep 2024 17:03:16 +0200 Subject: [PATCH 2/3] use homeDir() --- start.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/start.js b/start.js index 10aab8e..157a32d 100644 --- a/start.js +++ b/start.js @@ -2,7 +2,6 @@ const {startBookWithNumbers} = require('./src/appointment') const {homedir} = require("os"); homeDir = homedir() //faubourg, random -startBookWithNumbers(1, 10000, "random", homeDir + "/Desktop/contact_list_all.xlsx", true, false).then((r) => { +startBookWithNumbers(0, 10000, "random", homeDir + "/Desktop/contact_list_2024-09-11.xlsx", true, false).then((r) => { console.log(r) -}) - +}) \ No newline at end of file From 7e5134a0746ebe4e38cb8dce580804a7a0304181 Mon Sep 17 00:00:00 2001 From: PAN Lei Date: Fri, 20 Sep 2024 17:13:44 +0200 Subject: [PATCH 3/3] fix sliding captcha issue --- src/workers/CommandorPage.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index 0aea993..77196e1 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -730,7 +730,6 @@ class CommandorPage { } } - async slidingCaptcha(onResult) { logWithDevice("slidingCaptcha", this.device); if (this.device.model() === "MI 5s" || this.device.model() === "ASUS_X00QD" || this.device.model() === "ASUS_Z012D" || this.device.model() === "HUAWEI NXT-TL00") { @@ -875,6 +874,7 @@ class CommandorPage { logWithDevice("will recheck OCR", this.device) checkResult = await this.ocrChecker.get_result(); } + while (checkResult === OCRResult.SLIDING_CAPTCHA) { logWithDevice("will call this.slidingCaptcha()", this.device) await this.slidingCaptcha(async (isSuccessful) => { @@ -882,8 +882,8 @@ class CommandorPage { console.log(checkResult); if (isSuccessful) { await delay(5 * 1000) - // checkResult = await this.ocrChecker.get_result(); - await this.checkResultWithOcr() + checkResult = await this.ocrChecker.get_result(); + // await this.checkResultWithOcr() } else { if (checkResult === OCRResult.SLIDING_CAPTCHA) { checkResult = OCRResult.TERMINAED @@ -1025,9 +1025,11 @@ class CommandorPage { await this.tapForDevice(this.device, 360, 820) } else if (this.device.model() === "M2006C3LG" || this.device.model() === "220233L2G") { await this.tapForDevice(this.device, 350, 777) - } else if (this.device.model() === "KB2003" || this.device.model() === "DE2117") { + } else if (this.device.model() === "KB2003") { await this.tapForDevice(this.device, 500, 1200) await this.tapForDevice(this.device, 500, 1120) + } else if (this.device.model() === "DE2117") { + await this.tapForDevice(this.device, 545, 1130) } else try { await this.tapForDevice(this.device, 500, 1120)