From 7cd662c96f98a1de87a3d6e46ec6396c5709ac76 Mon Sep 17 00:00:00 2001 From: ValdikSS Date: Thu, 18 May 2017 20:26:32 +0300 Subject: [PATCH] Handle only A and AAAA records in Google API answers --- blockcheck.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blockcheck.py b/blockcheck.py index 7499057..76af22e 100755 --- a/blockcheck.py +++ b/blockcheck.py @@ -242,7 +242,8 @@ def _get_a_record_over_google_api(site, querytype='A'): response_js = json.loads(response[1]) try: for dnsanswer in response_js['Answer']: - result.append(dnsanswer['data']) + if dnsanswer['type'] in (1, 28): + result.append(dnsanswer['data']) except KeyError: pass return result