fix: remove demo speech service

The service is unreliable.
pull/73/head
dessant 5 years ago
parent 4a823f905c
commit f7b9554a5a

@ -5,11 +5,11 @@ about: Suggest an idea for this project
---
<!--
Full automation is outside of scope for this project due to its potential for misuse.
Full automation is not within the scope of this project due to its potential for misuse.
The solver must always be manually started from the extension button.
The extension helps solve reCAPTCHA challenges, other challenge types are not
considered at this time.
The extension helps solve reCAPTCHA audio challenges, other services
and challenge types are not within the scope of this project.
-->
**Is your feature request related to a problem? Please describe.**

@ -19,11 +19,6 @@
"description": "Title of the option."
},
"optionValue_speechService_googleSpeechApiDemo": {
"message": "Google Cloud Speech API (demo)",
"description": "Value of the option."
},
"optionValue_speechService_googleSpeechApi": {
"message": "Google Cloud Speech API",
"description": "Value of the option."

@ -162,7 +162,6 @@ export default {
selectOptions: getOptionLabels({
speechService: [
'googleSpeechApiDemo',
'witSpeechApiDemo',
'googleSpeechApi',
'witSpeechApi',

@ -465,27 +465,20 @@ async function solve(simulateUserInput, clickEvent) {
}
solution = await getWitSpeechApiResult(apiKey, audioContent);
}
} else if (
['googleSpeechApiDemo', 'googleSpeechApi'].includes(speechService)
) {
let apiUrl;
if (speechService === 'googleSpeechApiDemo') {
apiUrl =
'https://cxl-services.appspot.com/proxy?url=https://speech.googleapis.com/v1p1beta1/speech:recognize';
} else {
const {googleSpeechApiKey: apiKey} = await storage.get(
'googleSpeechApiKey',
'sync'
);
if (!apiKey) {
browser.runtime.sendMessage({
id: 'notification',
messageId: 'error_missingApiKey'
});
return;
}
apiUrl = `https://speech.googleapis.com/v1p1beta1/speech:recognize?key=${apiKey}`;
} else if (speechService === 'googleSpeechApi') {
const {googleSpeechApiKey: apiKey} = await storage.get(
'googleSpeechApiKey',
'sync'
);
if (!apiKey) {
browser.runtime.sendMessage({
id: 'notification',
messageId: 'error_missingApiKey'
});
return;
}
const apiUrl = `https://speech.googleapis.com/v1p1beta1/speech:recognize?key=${apiKey}`;
const language = captchaGoogleSpeechApiLangCodes[lang] || 'en-US';
const data = {

@ -0,0 +1,28 @@
import browser from 'webextension-polyfill';
const message = 'Revision description';
const revision = 'DlgF14Chrh';
const downRevision = 'X3djS8vZC';
const storage = browser.storage.local;
async function upgrade() {
const changes = {};
const {speechService} = await storage.get('speechService');
if (speechService === 'googleSpeechApiDemo') {
changes.speechService = 'witSpeechApiDemo';
}
changes.storageVersion = revision;
return storage.set(changes);
}
async function downgrade() {
const changes = {};
changes.storageVersion = downRevision;
return storage.set(changes);
}
export {message, revision, upgrade, downgrade};

@ -6,6 +6,7 @@
"nOedd0Txqd",
"ZtLMLoh1ag",
"t335iRDhZ8",
"X3djS8vZC"
"X3djS8vZC",
"DlgF14Chrh"
]
}

@ -0,0 +1,28 @@
import browser from 'webextension-polyfill';
const message = 'Revision description';
const revision = 'DlgF14Chrh';
const downRevision = 'X3djS8vZC';
const storage = browser.storage.sync;
async function upgrade() {
const changes = {};
const {speechService} = await storage.get('speechService');
if (speechService === 'googleSpeechApiDemo') {
changes.speechService = 'witSpeechApiDemo';
}
changes.storageVersion = revision;
return storage.set(changes);
}
async function downgrade() {
const changes = {};
changes.storageVersion = downRevision;
return storage.set(changes);
}
export {message, revision, upgrade, downgrade};

@ -6,6 +6,7 @@
"nOedd0Txqd",
"ZtLMLoh1ag",
"t335iRDhZ8",
"X3djS8vZC"
"X3djS8vZC",
"DlgF14Chrh"
]
}

Loading…
Cancel
Save