mirror of https://gitlab.com/bashrc2/epicyon
Default user agent blocks
parent
d72a27b5cc
commit
8fe8701414
10
daemon.py
10
daemon.py
|
@ -520,11 +520,19 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
def _blockedUserAgent(self, callingDomain: str, agentStr: str) -> bool:
|
def _blockedUserAgent(self, callingDomain: str, agentStr: str) -> bool:
|
||||||
"""Should a GET or POST be blocked based upon its user agent?
|
"""Should a GET or POST be blocked based upon its user agent?
|
||||||
"""
|
"""
|
||||||
|
agentStrLower = agentStr.lower()
|
||||||
|
defaultAgentBlocks = (
|
||||||
|
'fedilist.com'
|
||||||
|
)
|
||||||
|
for uaBlock in defaultAgentBlocks:
|
||||||
|
if uaBlock in agentStrLower:
|
||||||
|
print('Blocked User agent: ' + uaBlock)
|
||||||
|
return True
|
||||||
|
|
||||||
agentDomain = None
|
agentDomain = None
|
||||||
|
|
||||||
if agentStr:
|
if agentStr:
|
||||||
# is this a web crawler? If so the block it
|
# is this a web crawler? If so the block it
|
||||||
agentStrLower = agentStr.lower()
|
|
||||||
if 'bot/' in agentStrLower or 'bot-' in agentStrLower:
|
if 'bot/' in agentStrLower or 'bot-' in agentStrLower:
|
||||||
if self.server.newsInstance:
|
if self.server.newsInstance:
|
||||||
return False
|
return False
|
||||||
|
|
2
utils.py
2
utils.py
|
@ -715,7 +715,7 @@ def getStatusNumber(publishedStr: str = None) -> (str, str):
|
||||||
|
|
||||||
|
|
||||||
def evilIncarnate() -> []:
|
def evilIncarnate() -> []:
|
||||||
return ('gab.com', 'gabfed.com', 'spinster.xyz',
|
return ('fedilist.com', 'gab.com', 'gabfed.com', 'spinster.xyz',
|
||||||
'kiwifarms.cc', 'djitter.com')
|
'kiwifarms.cc', 'djitter.com')
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue