mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-Nonebot.git
synced 2026-04-01 22:04:51 +00:00
feat(cloud_music): 添加保存cookies功能
在登录流程结束后,将cookies保存到本地文件`cloud_music_cookies.cookie`中,以便后续使用。
This commit is contained in:
parent
72ab72071c
commit
f6239e67ae
1 changed files with 2 additions and 1 deletions
|
|
@ -32,7 +32,6 @@ async def handle_function(msg: MessageEvent):
|
|||
"""是否要发送到QQ上面登录 """
|
||||
# await clover_music.send(MessageSegment.file_image(Path(path)))
|
||||
"""是否要发送到QQ上面登录 """
|
||||
|
||||
while True:
|
||||
code = await check_qr_code(unikey, session)
|
||||
if '801' in str(code):
|
||||
|
|
@ -45,6 +44,8 @@ async def handle_function(msg: MessageEvent):
|
|||
else:
|
||||
break
|
||||
await asyncio.sleep(2)
|
||||
with open('cloud_music_cookies.cookie', 'wb') as f:
|
||||
pickle.dump(session.cookies, f)
|
||||
|
||||
#搜索歌曲
|
||||
song_id,song_name,singer,song_url = await netease_music_search(keyword,session)
|
||||
|
|
|
|||
Loading…
Reference in a new issue