The whois_lookups script is not reliable for international zones Therefore, we want to trim the list to ones that we know work. This is the more traditional (.com, .net, .org, etc.) This list of trust will be expanded over time.
(logger, zones)
| 34 | |
| 35 | |
| 36 | def get_primary_zones(logger, zones): |
| 37 | """ |
| 38 | The whois_lookups script is not reliable for international zones |
| 39 | Therefore, we want to trim the list to ones that we know work. |
| 40 | This is the more traditional (.com, .net, .org, etc.) |
| 41 | This list of trust will be expanded over time. |
| 42 | """ |
| 43 | supported_tld_list = ["com", "net", "org"] |
| 44 | new_zones = [] |
| 45 | for zone in zones: |
| 46 | try: |
| 47 | tld = get_tld(zone, fix_protocol=True) |
| 48 | except: |
| 49 | logger.warning(zone + " was not compatible with TLD") |
| 50 | continue |
| 51 | |
| 52 | if tld in supported_tld_list: |
| 53 | new_zones.append(zone) |
| 54 | |
| 55 | return new_zones |
| 56 | |
| 57 | |
| 58 | def main(logger=None): |