mirror of
https://github.com/wasrusgen/zov-tech.git
synced 2026-06-03 15:04:50 +00:00
ozon: fix false-positive challenge detector (was catching 'challenge' in normal JS)
This commit is contained in:
parent
e8b487891f
commit
1a948ebf02
@ -40,8 +40,9 @@ def search_ozon(query: str, limit: int = 3, timeout: float = 30.0,
|
||||
if not html:
|
||||
log.warning("OZON: no HTML for query=%r", query)
|
||||
return []
|
||||
if "robotcheck" in html.lower() or "challenge" in html.lower()[:5000]:
|
||||
log.warning("OZON: anti-bot challenge for query=%r", query)
|
||||
# Реальный anti-bot — это редирект на /robotcheck/ или специальная страница
|
||||
if "/robotcheck/" in html or "Доступ ограничен" in html[:5000]:
|
||||
log.warning("OZON: anti-bot block for query=%r", query)
|
||||
return []
|
||||
|
||||
return _parse_html(html, limit=limit)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user