diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index 0324e1e..9f77f97 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -74,12 +74,13 @@ function logWithDevice(message, device) { const searchTexts = ['hermes+rdv+online+paris', 'hermes+rdv+enligne+paris', 'hermes+rdv+en+ligne+paris', 'hermes+rendezvous+en+ligne+paris', 'hermes+appointment+online+paris', 'hermes+appointment+online+paris', 'appointment+hermes+paris+on+line', 'hermes+rendez+vous+online+paris', 'hermes+rendez+vous+paris+en+ligne', 'hermes+rendez+vous+paris+enligne', 'hermes+rendez+vous+paris+online', 'online+appointment+hermes+paris', 'hermes+online+appointment+paris', 'paris+hermes+online+appointment'] class CommandorPage { - constructor(contact, device, sender, mongoManager, selectedStore = DEFAULT_STORE, audioAnalyse = false, alertBeep = false, port = 9000) { + constructor(contact, device, sender, mongoManager, selectedStore = DEFAULT_STORE, audioAnalyse = false, alertBeep = false, port = 9000, onlyForCookies = false) { this.contact = contact; this.device = device; this.mongoManager = mongoManager; this.selectedStore = selectedStore; this.choosedStore = selectedStore; + this.onlyForCookies = onlyForCookies; this.port = port; this.sender = sender; this.ocrChecker = new OCRChecker(this.device, this.contact); @@ -931,13 +932,12 @@ class CommandorPage { cookiesString = cookiesString + cookie.name + "=" + cookie.value + ";" }) console.log(cookiesString); - - if (this.contact.ipCountry === "DE") + if (this.onlyForCookies) { + // if (this.contact.ipCountry === "DE") this.sender.sendMessage(cookiesString, "REQUEST_DATA_DE") - else + this.isTerminated = true + } else this.sender.sendMessage(cookiesString) - // let content = await this.page.content() - // console.log(content) await this.page.bringToFront(); await this.fillFields(this.page) await delay(2 * 1000);