2 Commits

Author SHA1 Message Date
panleicim 703ca3d694 change include mode 2024-12-04 10:59:45 +01:00
panleicim 7cc4f87e0b stop when need to refresh captcha 2024-11-15 22:20:03 +01:00
3 changed files with 11 additions and 11 deletions
+9 -6
View File
@@ -11,15 +11,15 @@ const SEVEN_DAYS_IN_S = 3600 * 24 * 7;
const NINETY_DAYS_IN_S = 30 * 3; const NINETY_DAYS_IN_S = 30 * 3;
let excelUtil = new ExcelUtil(); let excelUtil = new ExcelUtil();
let collectionName = formatDate(new Date()) let collectionName = formatDate(new Date())
// let includeMode = DeviceExcludeMode.ZERO let includeMode = DeviceExcludeMode.ZERO
let includeMode = DeviceExcludeMode.APPOINTMENT // let includeMode = DeviceExcludeMode.APPOINTMENT
let three_to_include = [] let three_to_include = []
let four_to_include = ["bec11752", "4e8ca027", "hi7ljr5xduyt9pfi", "EPHUT20825001518"] let four_to_include = ["bec11752", "4e8ca027", "hi7ljr5xduyt9pfi", "EPHUT20825001518"]
let seven_to_excludes = ["4e8ca027", "hi7ljr5xduyt9pfi", "EPHUT20825001518", "bec11752", "fuljaueqguugf6pn", "EPHUT20825001518"] let seven_to_excludes = ["4e8ca027", "hi7ljr5xduyt9pfi", "EPHUT20825001518", "bec11752", "fuljaueqguugf6pn", "EPHUT20825001518"]
let appointment_to_include = ["bec11752", "07fbd156", "71a0371d", "J4AXB761H2322WJ", "W8GMFELRHIKZS84T", "ZY32GLBN5P", "ZY32GVW4NC", "becb6e99", "b41c1b72"] // let appointment_to_include = ["ai9xv8hy599hvkee", "07fbd156", "71a0371d", "J4AXB761H2322WJ", "W8GMFELRHIKZS84T", "fy65eqs4wkvcpf9h", "p7d6nbw8cu7duous", "fuljaueqguugf6pn", "fmiz5pa6rsx4u4ts"]
let appointment_to_include = ["ai9xv8hy599hvkee", "07fbd156", "71a0371d", "J4AXB761H2322WJ", "W8GMFELRHIKZS84T", "fy65eqs4wkvcpf9h", "p7d6nbw8cu7duous", "fmiz5pa6rsx4u4ts"]
let nine_to_include = ["bec11752", "4e8ca027", "hi7ljr5xduyt9pfi", "47e7e36b", "p7d6nbw8cu7duous", "njzxojhim7gedyvw", "fmiz5pa6rsx4u4ts", "fuljaueqguugf6pn", "EPHUT20825001518"] let nine_to_include = ["bec11752", "4e8ca027", "hi7ljr5xduyt9pfi", "47e7e36b", "p7d6nbw8cu7duous", "njzxojhim7gedyvw", "fmiz5pa6rsx4u4ts", "fuljaueqguugf6pn", "EPHUT20825001518"]
let for_scrpay = ["07fbd156", "47e7e36b", "4f55c3d4", "5ac879a2", "69db59f0", "71a0371d", "774687ff", "7b71fb20", "8f76f9e7", "99cyfiaebqcy6poj", "EPHUT20825001518", "J4AXB761H2322WJ", "W8GMFELRHIKZS84T", "ai9xv8hy599hvkee", "b41c1b72", "bec11752", "becb6e99", "c3ba032e", "d54e946", "fmiz5pa6rsx4u4ts", "fuljaueqguugf6pn", "fy65eqs4wkvcpf9h", "hi7ljr5xduyt9pfi", "njzxojhim7gedyvw", "p7d6nbw8cu7duous"]
attributedPorts = [] attributedPorts = []
const device_port_info = new Map(); const device_port_info = new Map();
startPort = 9000 startPort = 9000
@@ -129,8 +129,6 @@ function getContactListForDevice(device, allContactList) {
} }
async function startBookWithNumbers(startNumber, endNumber, selectedStore, pathToExcelFile = '/Users/lpan/Desktop/contact_all.xlsx', audioAnalyse = true, alertBeep = false) { async function startBookWithNumbers(startNumber, endNumber, selectedStore, pathToExcelFile = '/Users/lpan/Desktop/contact_all.xlsx', audioAnalyse = true, alertBeep = false) {
console.log("startBookWithNumbers() called, with alertBeep:" + alertBeep)
console.log("startBookWithNumbers() called, with audioAnalyse:" + audioAnalyse)
let allContactList = excelUtil.readContacts(pathToExcelFile); let allContactList = excelUtil.readContacts(pathToExcelFile);
let contactList; let contactList;
if (endNumber <= allContactList.length) { if (endNumber <= allContactList.length) {
@@ -194,7 +192,12 @@ async function startBookWithNumbers(startNumber, endNumber, selectedStore, pathT
} else if (includeMode === DeviceExcludeMode.ZERO) { } else if (includeMode === DeviceExcludeMode.ZERO) {
device_to_excludes = [] device_to_excludes = []
} }
let filteredDeviceList;
if (includeMode === DeviceExcludeMode.ZERO) {
filteredDeviceList = devices
} else {
filteredDeviceList = devices.filter(device => device_to_excludes.includes(device.serial)) filteredDeviceList = devices.filter(device => device_to_excludes.includes(device.serial))
}
let segmentNumber = listWithoutBlackContact.length / filteredDeviceList.length; let segmentNumber = listWithoutBlackContact.length / filteredDeviceList.length;
console.log("connected device number:" + filteredDeviceList.length) console.log("connected device number:" + filteredDeviceList.length)
console.log("segmentNumber:" + segmentNumber) console.log("segmentNumber:" + segmentNumber)
+1 -1
View File
@@ -886,7 +886,7 @@ class CommandorPage {
this.isTerminated = true; this.isTerminated = true;
break; break;
case OCRResult.SLIDING_CAPTCHA_REFRESH: case OCRResult.SLIDING_CAPTCHA_REFRESH:
await this.connect_to_browser(checkResult) this.isTerminated = true;
break; break;
case OCRResult.SLIDING_CAPTCHA: case OCRResult.SLIDING_CAPTCHA:
logWithDevice("will call this.slidingCaptcha()", this.device) logWithDevice("will call this.slidingCaptcha()", this.device)
-3
View File
@@ -148,9 +148,6 @@ class OCRChecker {
} else { } else {
await this.deleteFile(fileName) await this.deleteFile(fileName)
} }
// await this.deleteFile(screenShot)
// if (result.includes("rac"))
// return OCRResult.SLIDING_CAPTCHA_REFRESH
return OCRResult.SLIDING_CAPTCHA return OCRResult.SLIDING_CAPTCHA
} else if (result.includes(SLIDING_CAPTCHA_RETRY_FR) } else if (result.includes(SLIDING_CAPTCHA_RETRY_FR)
) { ) {