fix: adding json library to script
This commit is contained in:
parent
96f01541e2
commit
006b9d2c03
1 changed files with 5 additions and 3 deletions
|
|
@ -9,6 +9,7 @@ import argparse
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
import requests
|
import requests
|
||||||
|
import json
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
|
|
@ -51,9 +52,10 @@ def filterRecords():
|
||||||
ignoredSubdomains.append(subdomain)
|
ignoredSubdomains.append(subdomain)
|
||||||
|
|
||||||
for rrset in getSubDomains():
|
for rrset in getSubDomains():
|
||||||
IS_NOT_IGNORED = rrset["name"] not in ignoredSubdomains
|
rrset_loaded = json.loads(rrset)
|
||||||
CONTAINS_A_RECORD = rrset["type"] == "A"
|
IS_NOT_IGNORED = rrset_loaded["name"] not in ignoredSubdomains
|
||||||
NOT_CURRENT_IP = rrset["records"][0] != requestIP
|
CONTAINS_A_RECORD = rrset_loaded["type"] == "A"
|
||||||
|
NOT_CURRENT_IP = rrset_loaded["records"][0] != requestIP
|
||||||
|
|
||||||
if IS_NOT_IGNORED and CONTAINS_A_RECORD and NOT_CURRENT_IP:
|
if IS_NOT_IGNORED and CONTAINS_A_RECORD and NOT_CURRENT_IP:
|
||||||
filteredSubdomains.append(rrset["subname"])
|
filteredSubdomains.append(rrset["subname"])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue