mirror of
https://github.com/Ground-Zerro/DomainMapper.git
synced 2025-12-10 01:47:18 +07:00
косметика, пользовательский список
В файл "my-dns-list.txt" можно добавить свои DNS имена для резолва. Если положить его рядом со скриптом - он его подцепит последним пунктом. В config.ini пока его настройка не добавлена.
This commit is contained in:
10
main.py
10
main.py
@@ -11,7 +11,7 @@ import httpx
|
|||||||
from colorama import Fore, Style
|
from colorama import Fore, Style
|
||||||
from colorama import init
|
from colorama import init
|
||||||
|
|
||||||
#Цвета
|
# Цвета
|
||||||
init(autoreset=True)
|
init(autoreset=True)
|
||||||
def yellow(text):
|
def yellow(text):
|
||||||
return f"{Fore.YELLOW}{text}{Style.RESET_ALL}"
|
return f"{Fore.YELLOW}{text}{Style.RESET_ALL}"
|
||||||
@@ -51,7 +51,7 @@ def read_config(filename):
|
|||||||
print(f"Файл результатов: {filename}")
|
print(f"Файл результатов: {filename}")
|
||||||
print(f"Формат сохранения: {'только IP' if filetype == 'ip' else 'Linux route' if filetype == 'unix' else 'CIDR-нотация' if filetype == 'cidr' else 'Windows route' if filetype == 'win' else 'не указан'}")
|
print(f"Формат сохранения: {'только IP' if filetype == 'ip' else 'Linux route' if filetype == 'unix' else 'CIDR-нотация' if filetype == 'cidr' else 'Windows route' if filetype == 'win' else 'не указан'}")
|
||||||
print(f"Шлюз для маршрутов: {gateway if gateway else 'не указан'}")
|
print(f"Шлюз для маршрутов: {gateway if gateway else 'не указан'}")
|
||||||
print(f"Выполнить при завершении: {run_command if run_command else 'не указано'}")
|
print(f"Выполнить по завершению: {run_command if run_command else 'не указано'}")
|
||||||
return service, request_limit, filename, cloudflare, filetype, gateway, run_command, dns_server_indices
|
return service, request_limit, filename, cloudflare, filetype, gateway, run_command, dns_server_indices
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -146,10 +146,10 @@ async def resolve_domain(domain, resolver, semaphore, dns_server_name, null_ips_
|
|||||||
elif ip_address in cloudflare_ips:
|
elif ip_address in cloudflare_ips:
|
||||||
cloudflare_ips_count[0] += 1
|
cloudflare_ips_count[0] += 1
|
||||||
else:
|
else:
|
||||||
print(f"{Fore.CYAN}{domain} IP адрес: {ip_address} получен от - {dns_server_name}{Style.RESET_ALL}")
|
print(f"{Fore.CYAN}{domain} IP-адрес: {ip_address} - {dns_server_name}{Style.RESET_ALL}")
|
||||||
return ips
|
return ips
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"{Fore.RED}Не удалось разрешить {domain} через {dns_server_name}{Style.RESET_ALL}")
|
print(f"{Fore.RED}Не удалось получить IP-адрес: {domain} - {dns_server_name}{Style.RESET_ALL}")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@@ -352,7 +352,7 @@ async def main():
|
|||||||
tasks.append(resolve_dns(service, local_dns_names, selected_dns_servers, cloudflare_ips, unique_ips_all_services,
|
tasks.append(resolve_dns(service, local_dns_names, selected_dns_servers, cloudflare_ips, unique_ips_all_services,
|
||||||
semaphore, null_ips_count, cloudflare_ips_count))
|
semaphore, null_ips_count, cloudflare_ips_count))
|
||||||
else:
|
else:
|
||||||
# Загрузка DNS имен служб
|
# Загрузка DNS имен сервисов
|
||||||
dns_names_url = urls[service]
|
dns_names_url = urls[service]
|
||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient() as client:
|
||||||
response = await client.get(dns_names_url)
|
response = await client.get(dns_names_url)
|
||||||
|
|||||||
Reference in New Issue
Block a user