update
Some checks failed
ci / build-test-publish (push) Has been cancelled
fmt / format (push) Has been cancelled

This commit is contained in:
dev 2024-12-14 16:01:13 +00:00
parent 7c4af5d548
commit 8988e0afe2
2 changed files with 8 additions and 7 deletions

View File

@ -97,19 +97,19 @@ class Analytics:
def _get_user_agent(self): def _get_user_agent(self):
# 获取系统信息 # 获取系统信息
os_name = platform.system() # 操作系统名称,如 'Windows', 'Linux', 'Darwin' # os_name = platform.system() # 操作系统名称,如 'Windows', 'Linux', 'Darwin'
os_version = platform.version() # 操作系统版本号 # os_version = platform.version() # 操作系统版本号
architecture = platform.architecture()[0] # '32bit' or '64bit' # architecture = platform.architecture()[0] # '32bit' or '64bit'
machine = platform.machine() # 机器类型,如 'x86_64', 'arm64' # machine = platform.machine() # 机器类型,如 'x86_64', 'arm64'
# 获取 Python 版本信息 # 获取 Python 版本信息
python_version = platform.python_version() # Python 版本 # python_version = platform.python_version() # Python 版本
# 组合 User-Agent 字符串 # 组合 User-Agent 字符串
user_agent = ( user_agent = (
f"XiaoMusic/{__version__} " f"XiaoMusic/{__version__} "
f"({os_name} {os_version}; {architecture}; {machine}) " # f"({os_name} {os_version}; {architecture}; {machine}) "
f"Python/{python_version}" # f"Python/{python_version}"
) )
return user_agent return user_agent

View File

@ -756,6 +756,7 @@ class XiaoMusic:
analytics_task is not None analytics_task is not None
) # to keep the reference to task, do not remove this ) # to keep the reference to task, do not remove this
async with ClientSession() as session: async with ClientSession() as session:
self.log.debug(f"set session:{session}")
self.session = session self.session = session
await self.init_all_data(session) await self.init_all_data(session)
task = asyncio.create_task(self.poll_latest_ask()) task = asyncio.create_task(self.poll_latest_ask())