Add .im exception
This commit is contained in:
parent
f60115685b
commit
062e7c85b7
|
@ -5,11 +5,21 @@ import whois
|
|||
import argparse
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(description='Process some integers.')
|
||||
parser.add_argument('--domain', help='Give domain to check whois')
|
||||
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()
|
||||
print((w.expiration_date - today).days)
|
||||
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)
|
Loading…
Reference in New Issue