1. 增加分享率警告,获取个人数据是发现分享率低于1的,发送分享率警告通知

This commit is contained in:
ngfchl
2022-09-02 20:00:51 +08:00
parent 4658329c05
commit 56aac69c0e

View File

@@ -855,6 +855,10 @@ class PtSpider:
ratio = ''.join(
details_html.xpath(site.ratio_rule)
).replace(',', '').replace('无限', 'inf').replace('', 'inf').replace('---', 'inf').strip(']:').strip()
# 分享率告警通知
if float(ratio) <= 1:
message = '# <font color="red">' + site.name + ' 站点分享率告警:' + str(ratio) + '</font> \n'
self.send_text(message)
downloaded = ''.join(
details_html.xpath(site.downloaded_rule)