From fd69992f08bb70997a20f0d7c9deb7dca512d313 Mon Sep 17 00:00:00 2001 From: ngfchl Date: Sun, 11 Dec 2022 14:49:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=88=86=E4=BA=AB=E7=8E=87?= =?UTF-8?q?=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt_site/UtilityTool.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pt_site/UtilityTool.py b/pt_site/UtilityTool.py index 42c19ef..103911b 100644 --- a/pt_site/UtilityTool.py +++ b/pt_site/UtilityTool.py @@ -1586,6 +1586,8 @@ class PtSpider: # 做种体积 'seed_vol': seeding_size, }) + if ratio < 1: + self.send_request(f'{site.name} 分享率 {ratio} 过低,请注意') return CommonResponse.success(data=res_gpw) else: return CommonResponse.error(data=result) @@ -1766,6 +1768,9 @@ class PtSpider: replace('inf.', 'inf').replace( 'null', 'inf').replace('---', 'inf').replace('-', 'inf').strip( ']:').strip(':').strip() + if not ratio: + ratio = ''.join( + details_html.xpath('//font[@class="color_ratio"][1]/following-sibling::font[1]/text()[1]')) # 分享率告警通知 logger.info('ratio:{}'.format(ratio)) if ratio and ratio != 'inf' and float(ratio) <= 1: