Skip to content

Commit

Permalink
feat: 检查到验证码的时候,等到一段时间,留出手动处理验证码的时间
Browse files Browse the repository at this point in the history
  • Loading branch information
fzls committed Jul 17, 2024
1 parent 85c6154 commit 566000f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions qq_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -1864,8 +1864,6 @@ def _try_auto_resolve_captcha(self):
WebDriverWait(self.driver, self.cfg.login.open_url_wait_time).until(
expected_conditions.visibility_of_element_located((By.ID, iframe_id))
)
tcaptcha_iframe = self.driver.find_element(By.ID, iframe_id)
self.driver.switch_to.frame(tcaptcha_iframe)

logger.info(
color("bold_green")
Expand All @@ -1876,10 +1874,21 @@ def _try_auto_resolve_captcha(self):
color("bold_yellow")
+ "新版滑动验证码限制最大滑动次数为3次,之前的暴力尝试策略不再可用,请先手动操作。待日后有空时,会改用图像识别的方式来进行处理"
)

logger.info(
f"{self.name} 等待手动处理验证码中,最大等待时长为{self.cfg.login.login_finished_timeout}"
)
WebDriverWait(self.driver, self.cfg.login.login_finished_timeout).until(
expected_conditions.invisibility_of_element_located((By.ID, iframe_id))
)

if self.cfg.run_in_headless_mode and self.login_slow_retry_index == 1:
raise RequireVerifyMessageButInHeadlessMode("新版滑动验证码")
return

tcaptcha_iframe = self.driver.find_element(By.ID, iframe_id)
self.driver.switch_to.frame(tcaptcha_iframe)

# 新版中,三个组件的位置随机的,需要根据其样式去判断是哪个
selectors = [
"#tcOperation > div:nth-child(6)",
Expand Down

0 comments on commit 566000f

Please sign in to comment.