From a0170c97541648bcaeaea736adef3f3b7f53255c Mon Sep 17 00:00:00 2001 From: protokey Date: Tue, 22 Sep 2026 13:48:34 +0400 Subject: [PATCH] =?UTF-8?q?chore:=20=D1=80=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8F=20=D0=B4=D0=B5=D1=82=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B0=20=D0=BE=D0=B1=D1=8F=D0=B7=D0=B0=D0=BD=D0=B0?= =?UTF-8?q?=20=D1=83=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=B8=D1=82=D1=8C?= =?UTF-8?q?=20stage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit типо сигнал, что детект отработал корректно --- src/antibot/base.py | 3 ++- src/antibot/known_providers/recaptcha.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/antibot/base.py b/src/antibot/base.py index 7cb6cdd..71ded06 100644 --- a/src/antibot/base.py +++ b/src/antibot/base.py @@ -97,7 +97,7 @@ class AntiBotProvider: async def detect(self, page: Page) -> ChallengeInfo: info = ChallengeInfo( - stage=Stage.INTERSTITIAL, + stage=None, # noqa provider=self.provider, success_locator=self._success_locator, detect_locator=self._detect_locator, @@ -107,6 +107,7 @@ class AntiBotProvider: return info async def solve(self, page: Page, info: ChallengeInfo): + assert info.stage, "Unknown stage" await self.solver.solve(page, info) def configure(self, success_locator=None, detect_locator=None, **kwargs): diff --git a/src/antibot/known_providers/recaptcha.py b/src/antibot/known_providers/recaptcha.py index b3949eb..ece9423 100644 --- a/src/antibot/known_providers/recaptcha.py +++ b/src/antibot/known_providers/recaptcha.py @@ -114,6 +114,7 @@ class ReCaptchaDetector(Detector): iframe = page.frame_locator("iframe[title='reCAPTCHA']") # ожидаем когда будет загружен чекбокс + info.stage = Stage.INTERSTITIAL checkbox = iframe.locator(checkbox_selector) try: await checkbox.wait_for(state="attached")