From 0fe61d5f44861e2a2d73f6c97f2f82b195344f6a Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sat, 8 Oct 2022 08:56:27 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E6=AF=8F=E6=97=A5=E7=B4=A0?= =?UTF-8?q?=E6=9D=90=E8=B7=B3=E8=BF=87=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=88=96?= =?UTF-8?q?=E8=80=85=E5=B7=B2=E5=BF=BD=E7=95=A5=E7=9A=84=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E3=80=81=E6=AD=A6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/daily/material.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/genshin/daily/material.py b/plugins/genshin/daily/material.py index 4ac1ca0..6dc0eb0 100644 --- a/plugins/genshin/daily/material.py +++ b/plugins/genshin/daily/material.py @@ -224,7 +224,11 @@ class DailyMaterial(Plugin, BasePlugin): added = True if added: continue - item = HONEY_DATA[type_][id_] + try: + item = HONEY_DATA[type_][id_] + except KeyError: # 跳过不存在或者已忽略的角色、武器 + logger.warning(f"未在 honey 数据中找到 {type_} {id_} 的信息") + continue if item[2] < 4: # 跳过 3 星及以下的武器 continue items.append(ItemData( # 添加角色数据中未找到的