From f62a1e56da93690cb29152b8c1587be9e0d1b4da Mon Sep 17 00:00:00 2001 From: KimigaiiWuyi <444835641@qq.com> Date: Thu, 29 Aug 2024 11:35:00 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20`=E4=BB=8E=E5=B0=8F=E5=8A=A9?= =?UTF-8?q?=E6=89=8B=E5=AF=BC=E5=85=A5=E6=8A=BD=E5=8D=A1=E8=AE=B0=E5=BD=95?= =?UTF-8?q?`,=20`=E5=AF=BC=E5=87=BA=E6=8A=BD=E5=8D=A1=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=88=B0=E5=B0=8F=E5=8A=A9=E6=89=8B`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GenshinUID/genshinuid_gachalog/export_and_import.py | 4 ++++ GenshinUID/genshinuid_gachalog/lelaer_tools.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/GenshinUID/genshinuid_gachalog/export_and_import.py b/GenshinUID/genshinuid_gachalog/export_and_import.py index 415e2367..def9b569 100644 --- a/GenshinUID/genshinuid_gachalog/export_and_import.py +++ b/GenshinUID/genshinuid_gachalog/export_and_import.py @@ -67,6 +67,10 @@ async def import_gachalogs(history_url: str, type: str, uid: str) -> str: history_data = json.loads(data_bytes.decode('gbk')) except json.decoder.JSONDecodeError: return '请传入正确的JSON格式文件!' + + if 'info' in history_data and 'uigf_version' in history_data['info']: + history_data['info']['version'] = history_data['info']['uigf_version'] + if 'info' in history_data and 'version' in history_data['info']: _version: str = str(history_data['info']['version']) _version = _version.replace('version', '').replace('v', '') diff --git a/GenshinUID/genshinuid_gachalog/lelaer_tools.py b/GenshinUID/genshinuid_gachalog/lelaer_tools.py index e1baa1fe..84ca1692 100644 --- a/GenshinUID/genshinuid_gachalog/lelaer_tools.py +++ b/GenshinUID/genshinuid_gachalog/lelaer_tools.py @@ -43,13 +43,14 @@ async def get_lelaer_gachalog(uid: str): history_data = await client.post( 'https://www.lelaer.com/outputGacha.php', data=data ) + logger.debug(history_data.content) history_log = history_data.text return await import_gachalogs(history_log, 'json', uid) async def export_gachalog_to_lelaer(uid: str): gachalog_url = await get_gachaurl(uid) - export = await export_gachalogs(uid) + export = await export_gachalogs(uid, '2') if export['retcode'] == 'ok': file_path = export['url'] else: