Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/modules/whois/domain.py

22 lines
458 B
Python
Raw Normal View History

2023-01-19 06:39:06 +00:00
from typing import Any, Union
import json
import socket
import ipaddress
from core.utils import get_url
import os
import whois
iso = json.load(open(os.path.dirname(os.path.abspath(
__file__)) + './iso.json', 'r', encoding='utf-8'))
async def check_domain(domain: str):
return whois.whois(domain)
async def format_domain(info: whois.WhoisEntry):
res = ''
for key, value in info.items():
res += f'\n{key}{value}'
return res