From ec8f447719eb7b7ea7fb70e3da14230537b9dbd1 Mon Sep 17 00:00:00 2001 From: ngfchl Date: Tue, 27 Dec 2022 10:07:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=B7=E8=B1=B9=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E7=8E=87=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt_site/UtilityTool.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pt_site/UtilityTool.py b/pt_site/UtilityTool.py index 1fca8ea..abb909b 100644 --- a/pt_site/UtilityTool.py +++ b/pt_site/UtilityTool.py @@ -1731,7 +1731,8 @@ class PtSpider: stats = details_response.get('stats') downloaded = stats.get('downloaded') uploaded = stats.get('uploaded') - ratio = stats.get('ratio').replace(',', '') + ratio_str = stats.get('ratio').replace(',', '') + ratio = 'inf' if ratio_str == '∞' else ratio_str my_site.time_join = stats.get('joinedDate') my_site.latest_active = stats.get('lastAccess') my_site.my_level = details_response.get('personal').get('class') @@ -1767,7 +1768,7 @@ class PtSpider: site=my_site, created_at__date__gte=datetime.today(), defaults={ - 'ratio': 'inf' if ratio == '∞' else ratio, + 'ratio': float(ratio), 'downloaded': downloaded, 'uploaded': uploaded, 'my_sp': my_sp,