Closed liuhangbin closed 7 months ago
#!/bin/env python3 import asyncio from pyqqmusicapi import QQMusic async def async_main(): # 初始化Api,可传入musicid,musickey api = QQMusic() # 可用api:SongApi,TopApi,SearchApi,MvApi,PlaylistApi,AlbumApi,LoginApi result = await api.song.detail("0039MnYb0qxYhV") song_name = result['track_info']['info']['name'] time_public = result['track_info']['info']['timePublic'] album_name = result['track_info']['album']['name'] print(f"{song_name}, album {album_name}, public {time_public}") asyncio.run(async_main())
执行后返回错误
晴天, album 叶惠美, public 2003-07-31 Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7fa8c3175950> Unclosed connector connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7fa8c238c050>, 2580.640299335)]'] connector: <aiohttp.connector.TCPConnector object at 0x7fa8c3134f50>
我看 pyqqmusicapi/qqmusic.py 有定义 def __clean(). 是我代码少了 close session 吗?
pyqqmusicapi/qqmusic.py
def __clean()
原本是想要复用aiohttp.seesion,但是相关资料较少,可能出错了
aiohttp.seesion
目前没有问题了
执行后返回错误
我看
pyqqmusicapi/qqmusic.py
有定义def __clean()
. 是我代码少了 close session 吗?