Some checks failed
Deploy Trade-In / deploy (push) Blocked by required conditions
Deploy Trade-In / changes (push) Successful in 5s
Deploy Trade-In / build-frontend (push) Has been skipped
Deploy Trade-In / test (push) Successful in 24s
Deploy Trade-In / build-backend (push) Has been cancelled
Co-authored-by: bot-backend <bot-backend@gendsgn.local> Co-committed-by: bot-backend <bot-backend@gendsgn.local>
25 lines
843 B
Python
25 lines
843 B
Python
"""Avito-specific exceptions для anti-bot detection."""
|
|
|
|
|
|
class AvitoError(Exception):
|
|
"""Base для всех Avito scraper exceptions."""
|
|
|
|
|
|
class AvitoBlockedError(AvitoError):
|
|
"""HTTP 403 от Avito — IP-level block detected."""
|
|
|
|
|
|
class AvitoRateLimitedError(AvitoError):
|
|
"""HTTP 429 от Avito — rate limit triggered."""
|
|
|
|
|
|
class AvitoContentBlockedError(AvitoBlockedError):
|
|
"""HTTP 200 от Avito, но 0 карточек на первой странице — content-block / captcha.
|
|
|
|
Наследует AvitoBlockedError, чтобы существующие except-блоки на AvitoBlockedError
|
|
продолжали ловить этот сигнал (mark_banned, pipeline abort и т.д.).
|
|
"""
|
|
|
|
|
|
class AvitoParseError(AvitoError):
|
|
"""Cannot parse Avito HTML structure (selector changes)."""
|