fix detect proxy

This commit is contained in:
Yuriy Yuriev
2026-05-19 12:56:38 +07:00
parent 5f8d5e8834
commit 9da35e60f3
3 changed files with 39 additions and 34 deletions
+2 -11
View File
@@ -53,7 +53,7 @@ def _patch_camoufox():
def _patched_ip(proxy_string: str) -> str:
global _socks5_real_ip
if _socks5_real_ip and "127.0.0.1" in str(proxy_string):
if _socks5_real_ip:
return _socks5_real_ip
return _orig_ip(proxy_string)
@@ -160,16 +160,7 @@ class BrowserService:
reading_time
)
else:
async with AsyncCamoufox(
headless=True,
geoip=False,
humanize=True,
locale="ru-RU",
exclude_addons=[DefaultAddons.UBO]
) as browser:
result = await self._browse_page(
browser, url, "direct", reading_time
)
return VisitResult(url=url, success=False, error="No proxy available")
if proxy:
await self.proxy_manager.release_proxy(proxy, result.success)