feat(tradein/scraper-kit): shared base/utils для providers/* (#2358, Foundation) #2360

Merged
lekss361 merged 2 commits from feat/tradein-scraper-kit-base-2358 into main 2026-07-04 00:56:14 +00:00
Showing only changes of commit 51e2e545b7 - Show all commits

View file

@ -80,13 +80,17 @@ DOCUMENT_HEADERS: dict[str, str] = {
def http_proxies(proxy_url: str | None) -> dict[str, str] | None:
"""curl_cffi/httpx-совместимый `proxies=` dict из одного url.
"""curl_cffi-совместимый `proxies=` dict из одного url.
`None`/пустая строка `None` (прямое подключение без прокси).
Извлечено из идентичной идиомы `{"http": url, "https": url} if url else None`,
продублированной в avito/serp.py, avito/detail.py, avito/imv.py, cian/detail.py,
cian/newbuilding.py (дважды), cian/session.py.
ВАЖНО: не для httpx начиная с httpx 0.28 `Client`/`AsyncClient` больше не
принимают dict в `proxies=` (только одиночный `proxy=` строкой). Не передавай
этот dict в httpx-клиент `TypeError`.
"""
return {"http": proxy_url, "https": proxy_url} if proxy_url else None