raise ValueError(f"Parameter domain[]='{type(domain)}' is not 'str'")
elif domain == "":
raise ValueError("Parameter 'domain' is empty")
+ elif domain.endswith(".tld"):
+ raise ValueException(f"domain='{domain}' is a fake domain, please don't crawl them!")
elif not isinstance(headers, dict):
raise ValueError(f"Parameter headers[]='{type(headers)}' is not 'dict'")
if not validators.domain(domain):
print(f"WARNING: domain='{domain}' is not a valid domain - SKIPPED!")
return False
- elif domain.split(".")[-1] == "arpa":
+ elif domain.endswith(".arpa"):
print(f"WARNING: domain='{domain}' is a reversed .arpa domain and should not be used generally.")
return False
elif blacklist.is_blacklisted(domain):
raise ValueError(f"Parameter domain[]='{type(domain)}' is not 'str'")
elif domain == "":
raise ValueError("Parameter 'domain' is empty")
+ elif domain.endswith(".tld"):
+ raise ValueException(f"domain='{domain}' is a fake domain, please don't crawl them!")
elif not isinstance(origin, str) and origin is not None:
raise ValueError(f"Parameter origin[]='{type(origin)}' is not 'str'")
elif software is None:
raise ValueError(f"Parameter command[]='{type(command)}' is not 'str'")
elif command == "":
raise ValueError("Parameter 'command' is empty")
-
- if domain.split(".")[-1] == "arpa":
+ elif domain.endswith(".arpa"):
print(f"WARNING: domain='{domain}' is a reversed .arpa domain and should not be used generally.")
return
elif not instances.is_registered(domain):
elif not validators.domain(instance.split("/")[0]):
print(f"WARNING: Bad instance='{instance}' from domain='{domain}',origin='{origin}',software='{software}'")
continue
- elif instance.split(".")[-1] == "arpa":
+ elif instance.endswith(".arpa"):
print(f"WARNING: instance='{instance}' is a reversed .arpa domain and should not be used generally.")
continue
elif blacklist.is_blacklisted(instance):
continue
# DEBUG: print("DEBUG: Handling instance:", instance)
- if instance.split(".")[-1] == "arpa":
+ if instance.endswith(".arpa"):
print(f"WARNING: instance='{instance}' is a reversed .arpa domain and should not be used generally.")
continue
elif not instances.is_registered(instance):
raise ValueError(f"command[]='{type(command)}' is not 'str'")
elif command == "":
raise ValueError("Parameter 'command' is empty")
- elif not validators.domain(domain.split("/")[0]) or domain.split(".")[-1] == "arpa":
+ elif not validators.domain(domain.split("/")[0]):
raise ValueError(f"Bad domain name='{domain}'")
+ elif domain.endswith(".arpa"):
+ raise ValueError(f"Please don't crawl .arpa domains: domain='{domain}'")
elif origin is not None and not validators.domain(origin.split("/")[0]):
raise ValueError(f"Bad origin name='{origin}'")
elif blacklist.is_blacklisted(domain):
raise ValueError(f"Parameter domain[]='{type(domain)}' is not 'str'")
elif domain == "":
raise ValueError("Parameter 'domain' is empty")
+ elif domain.endswith(".tld"):
+ raise ValueException(f"domain='{domain}' is a fake domain, please don't crawl them!")
elif not isinstance(path, str):
raise ValueError(f"path[]='{type(path)}' is not 'str'")
elif path == "":
raise ValueError(f"Parameter domain[]='{type(domain)}' is not 'str'")
elif domain == "":
raise ValueError("Parameter 'domain' is empty")
+ elif domain.endswith(".tld"):
+ raise ValueException(f"domain='{domain}' is a fake domain, please don't crawl them!")
elif not isinstance(path, str):
raise ValueError(f"path[]='{type(path)}' is not 'str'")
elif path == "":
raise ValueError(f"Parameter domain[]='{type(domain)}' is not 'str'")
elif domain == "":
raise ValueError("Parameter 'domain' is empty")
+ elif domain.endswith(".tld"):
+ raise ValueException(f"domain='{domain}' is a fake domain, please don't crawl them!")
elif not isinstance(blocklist, dict):
raise ValueError(f"Parameter blocklist[]='{type(blocklist)}' is not 'dict'")
raise ValueError(f"Parameter domain[]='{type(domain)}' is not 'str'")
elif domain == "":
raise ValueError("Parameter 'domain' is empty")
+ elif domain.endswith(".tld"):
+ raise ValueException(f"domain='{domain}' is a fake domain, please don't crawl them!")
elif not isinstance(path, str):
raise ValueError(f"Parameter path[]='{type(path)}' is not 'str'")
elif path == "":
if not validators.domain(blocked):
print(f"WARNING: blocked='{blocked}',software='mastodon' is not a valid domain name - SKIPPED!")
continue
- elif blocked.split(".")[-1] == "arpa":
+ elif blocked.endswith(".arpa"):
print(f"WARNING: blocked='{blocked}' is a reversed .arpa domain and should not be used generally.")
continue
elif not instances.is_registered(blocked):
if not validators.domain(blocked):
print(f"WARNING: blocked='{blocked}',software='mastodon' is not a valid domain name - SKIPPED!")
continue
- elif blocked.split(".")[-1] == "arpa":
+ elif blocked.endswith(".arpa"):
print(f"WARNING: blocked='{blocked}' is a reversed .arpa domain and should not be used generally.")
continue
elif not instances.is_registered(blocked):
if not validators.domain(blocked):
print(f"WARNING: blocked='{blocked}',software='pleroma' is not a valid domain name - SKIPPED!")
continue
- elif blocked.split(".")[-1] == "arpa":
+ elif blocked.endswith(".arpa"):
print(f"WARNING: blocked='{blocked}' is a reversed .arpa domain and should not be used generally.")
continue
elif not instances.is_registered(blocked):
if not validators.domain(blocked):
print(f"WARNING: blocked='{blocked}',software='pleroma' is not a valid domain name - SKIPPED!")
continue
- elif blocked.split(".")[-1] == "arpa":
+ elif blocked.endswith(".arpa"):
print(f"WARNING: blocked='{blocked}' is a reversed .arpa domain and should not be used generally.")
continue
elif not instances.is_registered(blocked):