From db6c7fd8110e1941f60af1f18e1006bf931efa5c Mon Sep 17 00:00:00 2001 From: Ground-Zerro Date: Sat, 5 Oct 2024 13:13:38 +1100 Subject: [PATCH] solutions @WonderCRM --- main.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 02ed515..85e30e2 100644 --- a/main.py +++ b/main.py @@ -226,9 +226,13 @@ async def get_cloudflare_ips(): async def load_dns_names(url_or_file): if url_or_file.startswith("http"): async with httpx.AsyncClient() as client: - response = await client.get(url_or_file) - response.raise_for_status() - return response.text.splitlines() + try: + response = await client.get(url_or_file) + response.raise_for_status() + return response.text.splitlines() + except httpx.HTTPStatusError as e: + print(f"Ошибка при загрузке DNS имен: {e}") + return [] else: # Локальный файл with open(url_or_file, 'r', encoding='utf-8') as file: