Don't block crawlers on news instances

main
Bob Mottram 2021-06-28 18:28:14 +01:00
parent 97ec53143c
commit 784aca35f3
1 changed files with 2 additions and 0 deletions

View File

@ -466,6 +466,8 @@ class PubServer(BaseHTTPRequestHandler):
# is this a web crawler? If so the block it
agentStrLower = agentStr.lower()
if 'bot/' in agentStrLower or 'bot-' in agentStrLower:
if if self.server.newsInstance:
return False
print('Blocked Crawler: ' + agentStr)
return True
# get domain name from User-Agent