This commit is contained in:
@@ -52,6 +52,24 @@ def console_filter(record: logging.LogRecord) -> bool:
|
||||
):
|
||||
return False
|
||||
|
||||
# 🚫 Блокируем OAuth ошибки от ботов (GPTBot, crawlers)
|
||||
if (
|
||||
record.levelno == logging.ERROR
|
||||
and "Missing OAuth state parameter" in message
|
||||
and any(
|
||||
bot_phrase in message
|
||||
for bot_phrase in [
|
||||
"GPTBot",
|
||||
"gptbot",
|
||||
"crawler",
|
||||
"bot",
|
||||
"spider",
|
||||
"x-openai-host-hash",
|
||||
]
|
||||
)
|
||||
):
|
||||
return False
|
||||
|
||||
# Define `package` attribute with the relative path.
|
||||
record.package = record.pathname[_leng_path + 1 :].replace(".py", "")
|
||||
record.emoji = (
|
||||
|
||||
Reference in New Issue
Block a user