🐛 从小助手导入抽卡记录, 导出抽卡记录到小助手

This commit is contained in:
KimigaiiWuyi 2024-08-29 11:35:00 +08:00
parent 1ad366529f
commit f62a1e56da
2 changed files with 6 additions and 1 deletions

View File

@ -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', '')

View File

@ -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: