From 45d375ca491a61de7d3c23b0ae12703572776615 Mon Sep 17 00:00:00 2001 From: KimgiaiiWuyi <444835641@qq.com> Date: Fri, 2 Sep 2022 01:18:32 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20`uigf=5Fgacha=5Ftype`=E6=98=A0?= =?UTF-8?q?=E5=B0=84=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- genshinuid_gachalog/export_and_import.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/genshinuid_gachalog/export_and_import.py b/genshinuid_gachalog/export_and_import.py index aebd69d7..5fc5325d 100644 --- a/genshinuid_gachalog/export_and_import.py +++ b/genshinuid_gachalog/export_and_import.py @@ -24,6 +24,11 @@ async def import_gachalogs(history_url: str, uid: str) -> str: raw_data = history_data['list'] result = {'新手祈愿': [], '常驻祈愿': [], '角色祈愿': [], '武器祈愿': []} for item in raw_data: + item['uid'] = uid + item['item_id'] = '' + item['count'] = '1' + item['lang'] = 'zh-cn' + del item['uigf_gacha_type'] result[INT_TO_TYPE[item['gacha_type']]].append(item) im = await save_gachalogs(uid, result) return im @@ -56,7 +61,10 @@ async def export_gachalogs(uid: str) -> dict: } for i in ['新手祈愿', '常驻祈愿', '角色祈愿', '武器祈愿']: for item in raw_data['data'][i]: - item['uigf_gacha_type'] = item['gacha_type'] + if item['gacha_type'] == '400': + item['uigf_gacha_type'] = '301' + else: + item['uigf_gacha_type'] = item['gacha_type'] result['list'].append(item) # 保存文件 with open(path / f'UIGF_{uid}.json', 'w', encoding='UTF-8') as file: