- Регистрация
- 10.11.2020
- Сообщения
- 8
- Благодарностей
- 0
- Баллы
- 1
I'm trying to use cap monster inside my program but each time I create a task it returns an error like this
and this my code :
can someone help me with this?
error key:
{
"errorId": 1,
"errorCode": "ERROR_KEY_DOES_NOT_EXIST",
"errorDescription": "Account authorization key not found in the system or has incorrect format",
"taskId": 0
}
capmonster captcha:
private static readonly string Token = "61b33c5ec0b443efb83020a9023c3546";
private static readonly CapMonsterClient client = new CapMonsterClient(Token);
private async Task RecaptchaAsync(string img)
{
string base64=GetBase64StringForImage(img);
var captchaTask = new ImageToTextTask
{
Body= base64,
CapMonsterModule= "yandexnew"
};
int taskId;
try
{
taskId = await client.CreateTaskAsync(captchaTask);
}
catch (CapMonsterException er)
{
Program.loger("RecaptchaAsync Erorr" + er.ErrorCode + "\r\n" + er.ErrorDescription);
return;
}
try
{
var solution = await client.GetTaskResultAsync<ImageToTextTaskResult>(taskId);
var solinput = FindElement("//html//body//div[2]//div[9]//div//div//div[1]//div//div[2]//div//div[1]//div[4]//div//div//div//div//div[2]//div//div//div[2]//input", new FindElementBy(), true);
solinput.SendKeys(solution.Text);
var sendbtn = FindElement("//html//body//div[2]//div[9]//div//div//div[1]//div//div[2]//div//div[1]//div[4]//div//div//div//div//div[3]//button", FindElementBy.XPath, true);
sendbtn.Click();
}
catch (CapMonsterException er)
{
Program.loger("RecaptchaAsync Erorr" + er.ErrorCode + "\r\n" + er.ErrorDescription);
return;
}
}