ZennoLab

Automate everything

User Tools

Site Tools


en:addons:capmonster:rc-audio

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
en:addons:capmonster:rc-audio [2017/06/30 12:29]
afameless
en:addons:capmonster:rc-audio [2017/07/31 14:51] (current)
afameless
Line 143: Line 143:
  break;  break;
  }  }
- + 
  // подождём загрузки элементов  // подождём загрузки элементов
  System.Threading.Thread.Sleep(waitTime);​  System.Threading.Thread.Sleep(waitTime);​
Line 184: Line 184:
  }  }
  }  }
 + 
  var audioChallenge = tab.FindElementByAttribute("​a",​ "​class",​ "​rc-audiochallenge-tdownload-link",​ "​regexp",​ 0);  var audioChallenge = tab.FindElementByAttribute("​a",​ "​class",​ "​rc-audiochallenge-tdownload-link",​ "​regexp",​ 0);
  // if found, getting link to audio file  // if found, getting link to audio file
Line 308: Line 308:
  System.Threading.Thread.Sleep(waitTime);​  System.Threading.Thread.Sleep(waitTime);​
 }; };
 + 
 // Checking if answer is correct for ReCaptcha 2 // Checking if answer is correct for ReCaptcha 2
 Action Check= () => { Action Check= () => {
  project.SendInfoToLog("​Verifying answer",​ needShowMessages);​  project.SendInfoToLog("​Verifying answer",​ needShowMessages);​
  tab.WaitDownloading();​  tab.WaitDownloading();​
- + 
  for (int k = 0; k < tryLoadElement;​ k++)  for (int k = 0; k < tryLoadElement;​ k++)
  {  {
  System.Threading.Thread.Sleep(waitTime);​  System.Threading.Thread.Sleep(waitTime);​
- + 
  var checkAnswer = tab.FindElementByAttribute("​div",​ "​class",​ "​recaptcha-checkbox-checkmark",​ "​regexp",​ coincidenceReCaptcha2Index);​  var checkAnswer = tab.FindElementByAttribute("​div",​ "​class",​ "​recaptcha-checkbox-checkmark",​ "​regexp",​ coincidenceReCaptcha2Index);​
- + 
  // проверка исчезновения формы  // проверка исчезновения формы
  var loadedForm = tab.FindElementByAttribute("​div",​ "​class",​ "​primary-controls",​ "​regexp",​ 0);  var loadedForm = tab.FindElementByAttribute("​div",​ "​class",​ "​primary-controls",​ "​regexp",​ 0);
Line 329: Line 329:
  else  else
  {  {
 + int xPrimaryControlsDisplaysment = loadedForm.DisplacementInTabWindow.X;​
 + int yPrimaryControlsDisplaysment = loadedForm.DisplacementInTabWindow.Y;​
 + 
 + if (xPrimaryControlsDisplaysment < 0 || yPrimaryControlsDisplaysment < 0) // there are no visible recaptcha
 + {
 + success = true;
 + break;
 + }
 +
  if (checkAnswer.IsVoid)  if (checkAnswer.IsVoid)
  break;  break;
  }  }
- + 
  var recaptchas = tab.FindElementsByAttribute("​div",​ "​class",​ "​recaptcha-checkbox-checkmark",​ "​regexp"​);​  var recaptchas = tab.FindElementsByAttribute("​div",​ "​class",​ "​recaptcha-checkbox-checkmark",​ "​regexp"​);​
  if (recaptchas.Count == 0)  if (recaptchas.Count == 0)
Line 339: Line 348:
  return;  return;
  }  }
-  + 
  if (!checkAnswer.IsVoid)  if (!checkAnswer.IsVoid)
  {  {
Line 381: Line 390:
  }  }
  }  }
 + 
  if (isRecaptcha1) return "​ok";​  if (isRecaptcha1) return "​ok";​
  SubmitAnswer();​  SubmitAnswer();​
en/addons/capmonster/rc-audio.txt · Last modified: 2017/07/31 14:51 by afameless