From 807bee886a26eab1ae9e318a9a162ce73547523b Mon Sep 17 00:00:00 2001 From: ngfchl Date: Tue, 6 Sep 2022 09:42:56 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E7=8E=87=E6=97=B6=E4=BB=8E=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E8=BD=AC=E5=8C=96=E4=B8=BA=E6=95=B0=E5=AD=97=E5=87=BA?= =?UTF-8?q?=E9=94=99=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt_site/UtilityTool.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pt_site/UtilityTool.py b/pt_site/UtilityTool.py index 14d0e9c..d04ee7f 100644 --- a/pt_site/UtilityTool.py +++ b/pt_site/UtilityTool.py @@ -703,10 +703,9 @@ class PtSpider: print('leechers:', leechers) print('H&R:', hr) print('completers:', completers) - result = TorrentInfo.objects.update_or_create(magnet_url=magnet_url, defaults={ + result = TorrentInfo.objects.update_or_create(magnet_url=magnet_url, site=site, defaults={ 'category': category, 'download_url': download_url, - 'site': site, 'name': name, 'title': title, 'poster_url': poster_url, # 海报链接 @@ -979,7 +978,7 @@ class PtSpider: ).replace(',', '').replace('无限', 'inf').replace('∞', 'inf').replace('---', 'inf').strip(']:').strip() # 分享率告警通知 print('ratio', ratio) - if ratio != 'inf' and float(ratio) <= 1: + if ratio and ratio != 'inf' and float(ratio) <= 1: message = '# ' + site.name + ' 站点分享率告警:' + str(ratio) + ' \n' self.send_text(message) # 检查邮件 @@ -1019,8 +1018,8 @@ class PtSpider: except Exception as e: message = my_site.site.name + '解析个人主页信息:失败!原因:' + str(e) logging.error(message) - raise - self.send_text(site.name + '解析个人主页信息:失败!原因:' + str(e)) + self.send_text('# ' + message + ' \n') + # raise return CommonResponse.error(msg=message) def get_hour_sp(self, my_site: MySite):