delete wav file after request successfully
This commit is contained in:
@@ -38,16 +38,22 @@ async function sendRequest(fileName, callback) {
|
||||
if (response.status === 200) {
|
||||
let result = response.data;
|
||||
console.log(result);
|
||||
callback(result)
|
||||
callback(result);
|
||||
console.log("will delete wav file: " + fileName);
|
||||
await fs.unlink(fileName, (err) => {
|
||||
if (err) throw err;
|
||||
console.log(fileName + ' was deleted');
|
||||
})
|
||||
} else {
|
||||
console.log("error")
|
||||
callback([])
|
||||
console.log("error");
|
||||
callback([]);
|
||||
console.log("will delete wav file: " + fileName);
|
||||
}
|
||||
}
|
||||
|
||||
class GeoCaptchaSolver {
|
||||
constructor(page) {
|
||||
this.page = page
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +67,6 @@ class GeoCaptchaSolver {
|
||||
let captcha_container = await iframeHandler.locator(CAPTCHA_CONTAINER)
|
||||
let html = await captcha_container.innerHTML()
|
||||
console.log("audio_tag: " + html);
|
||||
let fieldInputs = await iframeHandler.locator("#captcha__audio > div.audio-captcha-input-container > input:nth-child(1)")
|
||||
// find wav from html
|
||||
await this.findTextFromWavFile(html, async (number_list) => {
|
||||
for (let i = 1; i <= number_list.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user