Files
searxng/searx/engines
Aadniz b1918dd121 [fix] yandex engine: capture captcha from header instead of url path (#5417)
Yandex engine will return parsing error instead of informing that a CAPTCHA was found. It is confusing for the admin and the users (#5415).


This patch fixes an issue where the CAPTCHA response from Yandex wouldn't be detected, resulting in `ParserError` when trying to parse the response to DOM.

In this fix, I replaced the url condition and instead is checking if the `x-yandex-captcha` header is set, and is equal to `captcha`.

Alternatively, maybe something like `resp.headers.get('Location', '').startswith("https://yandex.com/showcaptcha")` could be done instead. Lastly, setting `params['allow_redirects'] = True` can also work, but this will waste an extra request. Just let me know.

Closes: https://github.com/searxng/searxng/issues/5415
2025-11-06 07:00:48 +01:00
..
2025-08-12 15:18:46 +02:00
2025-03-30 12:41:43 +02:00
2024-04-10 06:51:28 +02:00
2025-09-09 17:04:21 +02:00
2025-03-30 14:25:58 +02:00
2025-04-18 09:30:17 +02:00