Skip to content

Commit afd9e25

Browse files
committed
minor
1 parent ca86cb9 commit afd9e25

4 files changed

Lines changed: 4 additions & 6 deletions

File tree

pyaterochka_api/endpoints/general.py

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

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

pyaterochka_api/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ async def _warmup(self) -> None:
8585
br = await AsyncCamoufox(
8686
locale="ru-RU",
8787
headless=self.headless,
88-
proxy=Proxy(self.proxy).as_dict() if self.proxy else None,
88+
proxy=Proxy(self.proxy).as_dict(),
8989
block_images=True
9090
#**self.browser_opts,
9191
).start()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ classifiers = [
2828
"Topic :: Utilities",
2929
]
3030
dependencies = [
31-
"camoufox[geoip]",
31+
"camoufox",
3232
"human_requests",
3333
"aiohttp",
3434
"aiohttp-retry"

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)