use remote server
This commit is contained in:
@@ -9,6 +9,7 @@ const AUDIO_CAPTCHA_TRACK = ".audio-captcha-track";
|
||||
const CAPTCHA_CONTAINER = "#captcha-container";
|
||||
const WAV_URL_REGEX = "https:.+.wav";
|
||||
const re = new RegExp(WAV_URL_REGEX);
|
||||
const SPEECH_TO_TEXT_HOST = "http://appointment.lpaconsulting.fr:8000"
|
||||
|
||||
function delay(delayInMs) {
|
||||
return new Promise(resolve => {
|
||||
@@ -29,9 +30,10 @@ function getRandomWaitTime() {
|
||||
|
||||
async function sendRequest(fileName, callback) {
|
||||
const fileStream = fs.createReadStream(fileName);
|
||||
let response = await axios.post('http://127.0.0.1:8000', fileStream, {
|
||||
let response = await axios.post(SPEECH_TO_TEXT_HOST, fileStream, {
|
||||
headers: {
|
||||
'Content-Type': 'wav'
|
||||
'Content-Type': 'wav',
|
||||
'Authorization': 'Bearer 97e36f7e-340e-4c02-b329-9415faee38c3'
|
||||
}
|
||||
})
|
||||
if (response.status === 200) {
|
||||
|
||||
Reference in New Issue
Block a user