This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ipaddress | |
import requests | |
def verify_googlebot_ips( | |
list_of_ips, | |
google_ips_list_url="https://developers.google.com/static/search/apis/ipranges/googlebot.json", | |
): | |
"""Checks if each IP address in given list is in Google's official list of IP ranges. | |
Args: | |
- list_of_ips: list of ipv4 or ipv6 to check, |