beep when datadome
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
|
"beepbeep": "^1.3.0",
|
||||||
"mongodb": "^4.9.1",
|
"mongodb": "^4.9.1",
|
||||||
"mongoose": "^6.5.4",
|
"mongoose": "^6.5.4",
|
||||||
"node-xlsx": "^0.21.0",
|
"node-xlsx": "^0.21.0",
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
const {_android: android, devices} = require("playwright");
|
const {_android: android, devices} = require("playwright");
|
||||||
|
|
||||||
const {SolveCaptcha, TWO_CAPTCHA_CONNECTION_FAILED} = require("./SolveCaptcha");
|
const {SolveCaptcha, TWO_CAPTCHA_CONNECTION_FAILED} = require("./SolveCaptcha");
|
||||||
const ReserveResultPojo = require("../models/ReserveResultPojo");
|
const ReserveResultPojo = require("../models/ReserveResultPojo");
|
||||||
const PublishType = require("../models/PublishType");
|
const PublishType = require("../models/PublishType");
|
||||||
@@ -174,14 +173,15 @@ class CommandorPage {
|
|||||||
async clickValid(page) {
|
async clickValid(page) {
|
||||||
await delay(getRandomWaitTime())
|
await delay(getRandomWaitTime())
|
||||||
try {
|
try {
|
||||||
if (!this.page.isClosed()){
|
if (!this.page.isClosed()) {
|
||||||
this.page.evaluate(() => {
|
this.page.evaluate(() => {
|
||||||
document.getElementsByClassName("btn")[0].focus();
|
document.getElementsByClassName("btn")[0].focus();
|
||||||
})
|
})
|
||||||
await delay(getRandomWaitTime())
|
await delay(getRandomWaitTime())
|
||||||
this.page.evaluate(() => {
|
this.page.evaluate(() => {
|
||||||
document.getElementsByClassName("btn")[0].click();
|
document.getElementsByClassName("btn")[0].click();
|
||||||
})}
|
})
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
@@ -195,13 +195,14 @@ class CommandorPage {
|
|||||||
this.captchaSolver = new SolveCaptcha(page);
|
this.captchaSolver = new SolveCaptcha(page);
|
||||||
await this.captchaSolver.start((solution) => {
|
await this.captchaSolver.start((solution) => {
|
||||||
console.log("solution is: " + solution);
|
console.log("solution is: " + solution);
|
||||||
if (solution !== ERROR_CAPTCHA_UNSOLVABLE&&solution!==TWO_CAPTCHA_CONNECTION_FAILED) {
|
if (solution !== ERROR_CAPTCHA_UNSOLVABLE && solution !== TWO_CAPTCHA_CONNECTION_FAILED) {
|
||||||
try {
|
try {
|
||||||
if (!page.isClosed()){
|
if (!page.isClosed()) {
|
||||||
page.evaluate((solution) => {
|
page.evaluate((solution) => {
|
||||||
document.getElementById("g-recaptcha-response").innerHTML = solution;
|
document.getElementById("g-recaptcha-response").innerHTML = solution;
|
||||||
}, solution)
|
}, solution)
|
||||||
this.clickValid();}
|
this.clickValid();
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
this.isTerminated = true;
|
this.isTerminated = true;
|
||||||
@@ -218,6 +219,7 @@ class CommandorPage {
|
|||||||
|
|
||||||
if (content.toString().includes(captcha_url)) {
|
if (content.toString().includes(captcha_url)) {
|
||||||
await this.checkAudioBtn();
|
await this.checkAudioBtn();
|
||||||
|
beep(20)
|
||||||
console.log("发现datadome");
|
console.log("发现datadome");
|
||||||
} else {
|
} else {
|
||||||
if (currentPage.url() === RDV_URL) {
|
if (currentPage.url() === RDV_URL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user