(self)
| 3061 | try: |
| 3062 | await page.close() |
| 3063 | except Exception: |
| 3064 | pass |
| 3065 | self._solve_inflight = max(0, self._solve_inflight - 1) |
| 3066 | self.note_idle() |
| 3067 | |
| 3068 | async def get_token( |
| 3069 | self, |
| 3070 | project_id: str, |
| 3071 | website_key: str, |
| 3072 | action: str = "IMAGE_GENERATION", |
| 3073 | token_proxy_url: Optional[str] = None, |
| 3074 | token_id: Optional[int] = None, |
| 3075 | ) -> tuple[Optional[str], Optional[str]]: |
| 3076 | """Get a token from the shared browser unless a fatal browser error occurs.""" |
| 3077 | async with self._semaphore: |
| 3078 | self._solve_inflight += 1 |
| 3079 | max_retries = max( |
| 3080 | 1, int(getattr(config, "browser_captcha_max_retries", 5) or 5) |
| 3081 | ) |
| 3082 |
nothing calls this directly
no outgoing calls
no test coverage detected