From a046c69662944138f912aaf1278f3654c45422a6 Mon Sep 17 00:00:00 2001 From: sqzw-x Date: Sun, 4 Feb 2024 19:33:21 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E7=A7=BB=E9=99=A4=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=97=B6=E4=BB=85=E7=A7=BB=E9=99=A4=E9=83=A8=E5=88=86=20(#78)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/core/crawler.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/models/core/crawler.py b/src/models/core/crawler.py index 04a5360..4e3d078 100644 --- a/src/models/core/crawler.py +++ b/src/models/core/crawler.py @@ -490,7 +490,7 @@ def _deal_each_field(all_json_data, json_data, website_list, field_name, field_c def _call_crawlers(all_json_data, json_data, website_list, field_name, field_cnname, field_language, config, - file_number, short_number, mosaic): # 4 + file_number, short_number, mosaic): # 4 """ 按照设置的网站顺序获取各个字段信息 """ @@ -852,10 +852,12 @@ def _deal_json_data(json_data): # 标签 tag = str(json_data['tag']).strip(" [ ]").replace("'", '').replace(', ', ',') # 列表转字符串(避免个别网站刮削返回的是列表) - tag = re.sub(r',\d+[kKpP]', '', tag) + tag = re.sub(r',\d+[kKpP],', ',', tag) tag_rep_word = [',HD高画质', ',HD高畫質', ',高画质', ',高畫質'] for each in tag_rep_word: - tag = tag.replace(each, '') + if tag.endswith(each): + tag = tag.replace(each, '') + tag = tag.replace(each + ",", ',') json_data['tag'] = tag # poster图