send more data for request data

This commit is contained in:
2024-03-16 11:36:30 +01:00
parent a52d7c8426
commit c9e316c5ab
4 changed files with 208 additions and 18 deletions
+106 -2
View File
@@ -9,6 +9,8 @@ const SlidingCaptchaSolver = require("./SlidingCaptchaSolver");
const OCRChecker = require("./OCRChecker");
const {exec} = require("child_process");
const {openUrlWithAdb} = require("../utiles/CmdUtils");
const RequestDataPojo = require("../models/RequestDataPojo");
const {REQUEST_DATA_OBJECT} = require("../queue/Sender");
// const RDV_URL = "http://192.168.0.44:8000/test_appointment.html"
const RDV_URL = "https://rendezvousparis.hermes.com/client/register";
const BLANK_URL = "about:blank"
@@ -74,7 +76,7 @@ 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, onlyForCookies = false) {
constructor(contact, device, sender, mongoManager, selectedStore = DEFAULT_STORE, audioAnalyse = false, alertBeep = false, port = 9000, onlyForCookies = true) {
this.contact = contact;
this.device = device;
this.mongoManager = mongoManager;
@@ -1159,6 +1161,106 @@ class CommandorPage {
}
}
async getRequestData() {
const {
glvd,
glrd,
hc,
br_oh,
br_ow,
br_h,
br_w,
rs_h,
rs_w,
rs_cd,
ars_h,
ars_w,
plg,
eva,
vnd,
plu, ua, dvm, acw
} = await this.page.evaluate(() => {
let webglContext = document.createElement('canvas').getContext("webgl")
let webglDebugRenderInfo = webglContext.getExtension("WEBGL_debug_renderer_info")
let glvd = webglContext.getParameter(webglDebugRenderInfo.UNMASKED_VENDOR_WEBGL)
let glrd = webglContext.getParameter(webglDebugRenderInfo.UNMASKED_RENDERER_WEBGL)
let hc = navigator.hardwareConcurrency
let br_oh = window.outerHeight
let br_ow = window.outerWidth
let br_h = Math.max(
document.documentElement.clientHeight,
window.innerHeight || 0
)
let br_w = Math.max(
document.documentElement.clientWidth,
window.innerWidth || 0
)
let rs_h = window.screen.height
let rs_w = window.screen.width
let rs_cd = window.screen.colorDepth
let ars_h = screen.availHeight || 0
let ars_w = screen.availWidth || 0
let plg = navigator.plugins.length
let eva = eval.toString().length
let vnd = window.navigator.vendor
let plugins = navigator.plugins
let pluginsName = []
for (let i = 0; i < plugins.length; i++) {
name = plugins[i].name;
pluginsName.push(name)
}
let plu = pluginsName
let ua = navigator.userAgent
let dvm = navigator['deviceMemory'] || -1
let audio = document['createElement']("audio")
let acw = audio.canPlayType(('audio/wav; codecs="1"'))
return {
glvd,
glrd,
hc,
br_oh,
br_ow,
br_h,
br_w,
rs_h,
rs_w,
rs_cd,
ars_h,
ars_w,
plg,
eva,
vnd,
plu,
ua,
dvm, acw
}
})
logWithDevice("glvd:" + glvd, this.device)
logWithDevice("glrd:" + glrd, this.device)
logWithDevice("hc:" + hc, this.device)
logWithDevice("br_oh:" + br_oh, this.device)
logWithDevice("br_ow:" + br_ow, this.device)
logWithDevice("br_h:" + br_h, this.device)
logWithDevice("br_w:" + br_w, this.device)
logWithDevice("rs_h:" + rs_h, this.device)
logWithDevice("rs_w:" + rs_w, this.device)
logWithDevice("rs_cd:" + rs_cd, this.device)
logWithDevice("ars_h:" + ars_h, this.device)
logWithDevice("ars_w:" + ars_w, this.device)
logWithDevice("plg:" + plg, this.device)
logWithDevice("eva:" + eva, this.device)
logWithDevice("vnd:" + vnd, this.device)
logWithDevice("plu:" + plu, this.device)
logWithDevice("ua:" + ua, this.device)
logWithDevice("dvm:" + dvm, this.device)
logWithDevice("acw:" + acw, this.device)
return new RequestDataPojo(glvd, glrd, hc, br_oh, br_ow, br_h, br_w, rs_h, rs_w, rs_cd, ars_h, ars_w, plg, eva, vnd, plu, ua, dvm, acw)
}
async sendCookiesToQueue() {
try {
@@ -1169,7 +1271,9 @@ class CommandorPage {
})
console.log(cookiesString);
if (this.onlyForCookies) {
this.sender.sendMessage(cookiesString, "REQUEST_DATA_DE")
let pojoToSend = await this.getRequestData()
pojoToSend.cookiesStr = cookiesString
this.sender.sendMessage(JSON.stringify(pojoToSend), REQUEST_DATA_OBJECT)
} else
this.sender.sendMessage(cookiesString)
} catch (e) {