From 73ade882aca77c2375fafbd631d4e0b564db6394 Mon Sep 17 00:00:00 2001 From: ngfchl Date: Fri, 26 Aug 2022 12:22:27 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E8=87=AA=E5=8A=A8=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E4=BC=9A=E5=8D=95=E7=AB=99=E5=8F=91=E9=80=81?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + pt_site/UtilityTool.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index bb4bf2d..f1e7e7b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /venv/ /db/ +*/__pycache__ diff --git a/pt_site/UtilityTool.py b/pt_site/UtilityTool.py index 2b5c73b..8b3a553 100644 --- a/pt_site/UtilityTool.py +++ b/pt_site/UtilityTool.py @@ -218,6 +218,7 @@ class PtSpider: except Exception as e: print(str(e)) # raise + self.send_text('OCR识别失败:' + str(e)) return CommonResponse.error( status=StatusCodeEnum.OCR_ACCESS_ERR, msg=StatusCodeEnum.OCR_ACCESS_ERR.errmsg + str(e) @@ -469,6 +470,7 @@ class PtSpider: return CommonResponse.success(msg=message) except Exception as e: # raise + self.send_text(site.name + '签到失败!原因:' + str(e)) return CommonResponse.error(msg='签到失败!' + str(e)) @staticmethod @@ -488,6 +490,7 @@ class PtSpider: else: return CommonResponse.error(msg="网站访问失败") except Exception as e: + self.send_text(site.name + '网站访问失败!原因:' + str(e)) return CommonResponse.error(msg="网站访问失败" + str(e)) @transaction.atomic @@ -655,6 +658,7 @@ class PtSpider: return CommonResponse.success(data=(new_count, count)) except Exception as e: # raise + self.send_text(site.name + '解析种子信息:失败!原因:' + str(e)) return CommonResponse.error(msg='解析种子页面失败!' + str(e)) # 从种子详情页面爬取种子HASH值 @@ -732,6 +736,7 @@ class PtSpider: except Exception as e: message = my_site.site.name + '访问个人主页信息:失败!原因:' + str(e) logging.error(message) + self.send_text(message) # raise return CommonResponse.error(msg=message) @@ -908,6 +913,7 @@ class PtSpider: message = my_site.site.name + '解析个人主页信息:失败!原因:' + str(e) logging.error(message) # raise + self.send_text(site.name + '解析个人主页信息:失败!原因:' + str(e)) return CommonResponse.error(msg=message) def get_hour_sp(self, my_site: MySite):