Skip to content

Commit

Permalink
🐛 从小助手导入抽卡记录, 导出抽卡记录到小助手
Browse files Browse the repository at this point in the history
  • Loading branch information
KimigaiiWuyi committed Aug 29, 2024
1 parent 1ad3665 commit f62a1e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions GenshinUID/genshinuid_gachalog/export_and_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')
Expand Down
3 changes: 2 additions & 1 deletion GenshinUID/genshinuid_gachalog/lelaer_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f62a1e5

Please sign in to comment.