Skip to content

Commit f3c9dd0

Browse files
committed
minor
1 parent 7ae40a8 commit f3c9dd0

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

chizhik_api/endpoints/general.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,12 @@ async def download_image(
2525
self, url: str, retry_attempts: int = 3, timeout: float = 10
2626
) -> BytesIO:
2727
"""Скачать изображение по URL."""
28-
proxy = Proxy(self._parent.proxy).as_str() if self._parent.proxy else None
29-
3028
retry_options = ExponentialRetry(
3129
attempts=retry_attempts, start_timeout=3.0, max_timeout=timeout
3230
)
3331

3432
async with RetryClient(retry_options=retry_options) as retry_client:
35-
async with retry_client.get(url, raise_for_status=True, proxy=proxy) as resp:
33+
async with retry_client.get(url, raise_for_status=True, proxy=Proxy(self._parent.proxy).as_str()) as resp:
3634
body = await resp.read()
3735
file = BytesIO(body)
3836
file.name = url.split("/")[-1]

chizhik_api/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async def _warmup(self) -> None:
7676
"""Прогрев сессии через браузер для получения человекоподобности."""
7777
br = await AsyncCamoufox(
7878
headless=self.headless,
79-
proxy=Proxy(self.proxy).as_dict() if self.proxy else None,
79+
proxy=Proxy(self.proxy).as_dict(),
8080
**self.browser_opts,
8181
).start()
8282

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
camoufox[geoip]
1+
camoufox
22
human_requests
33
aiohttp
44
aiohttp-retry

0 commit comments

Comments
 (0)