25 lines
711 B
Python
Executable File
25 lines
711 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import datetime
|
|
import whois
|
|
import argparse
|
|
|
|
|
|
parser = argparse.ArgumentParser(description="Process some integers.")
|
|
parser.add_argument("--domain", help="Give domain to check whois")
|
|
args = parser.parse_args()
|
|
|
|
if args.domain is not None:
|
|
w = whois.whois(f"{args.domain}")
|
|
expire_date = w.expiration_date
|
|
today = datetime.datetime.today()
|
|
if args.domain.endswith(".im"):
|
|
expire_date = datetime.datetime(
|
|
year=w.expiration_date.year,
|
|
month=w.expiration_date.day,
|
|
day=w.expiration_date.month,
|
|
hour=w.expiration_date.hour,
|
|
minute=w.expiration_date.minute,
|
|
)
|
|
|
|
print((expire_date - today).days) |