From 3ef3e79e0de4b6a1e60daf50663ee9280ef80b65 Mon Sep 17 00:00:00 2001 From: pooneyy <85266337+pooneyy@users.noreply.github.com> Date: Tue, 26 Dec 2023 22:49:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=81=87=E5=88=B0=E6=9F=90?= =?UTF-8?q?=E4=BA=9B=E9=94=99=E8=AF=AF=E6=97=B6=E7=9A=84=E5=A4=84=E7=90=86?= =?UTF-8?q?=20(#33)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit “標題為空或標題太長”、“文章長度錯誤” --- AutoReply.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/AutoReply.py b/AutoReply.py index 258141f..7b72661 100644 --- a/AutoReply.py +++ b/AutoReply.py @@ -12,7 +12,7 @@ DEBUG = False -__verison__ = "0.23.11.06.1" +__verison__ = "0.23.12.26.1" def outputLog(projectName): log = logging.getLogger(f"{projectName}") @@ -361,13 +361,16 @@ def reply(self, url) -> bool: elif res.text.find("該貼已被鎖定") != -1: log.info(f"{self.username} reply failed , the thread is locked") return True + elif res.text.find("標題為空或標題太長") != -1 or res.text.find("文章長度錯誤") != -1 : + log.info(f"{self.username} reply failed , the title is {title} , the content is {content}") + return True elif res.text.find("403 Forbidden") != -1: log.info(f"{self.username} reply failed , HTTP 403 Error , 可能由于触发了风控 , IP被服务器拦截") return False elif res.text.find("500 Internal Server Error") != -1: log.info(f"{self.username} reply failed , HTTP 500 Error") return True - elif res.text.find("Bad Gateway") != -1: + elif res.text.find("Bad Gateway") != -1 or res.text.find("Bad gateway") != -1: log.info(f"{self.username} reply failed , HTTP 502 Error") return True elif res.text.find("520: Web server is returning an unknown error") != -1: