update
This commit is contained in:
parent
7c4af5d548
commit
8988e0afe2
@ -97,19 +97,19 @@ class Analytics:
|
||||
|
||||
def _get_user_agent(self):
|
||||
# 获取系统信息
|
||||
os_name = platform.system() # 操作系统名称,如 'Windows', 'Linux', 'Darwin'
|
||||
os_version = platform.version() # 操作系统版本号
|
||||
architecture = platform.architecture()[0] # '32bit' or '64bit'
|
||||
machine = platform.machine() # 机器类型,如 'x86_64', 'arm64'
|
||||
# os_name = platform.system() # 操作系统名称,如 'Windows', 'Linux', 'Darwin'
|
||||
# os_version = platform.version() # 操作系统版本号
|
||||
# architecture = platform.architecture()[0] # '32bit' or '64bit'
|
||||
# machine = platform.machine() # 机器类型,如 'x86_64', 'arm64'
|
||||
|
||||
# 获取 Python 版本信息
|
||||
python_version = platform.python_version() # Python 版本
|
||||
# python_version = platform.python_version() # Python 版本
|
||||
|
||||
# 组合 User-Agent 字符串
|
||||
user_agent = (
|
||||
f"XiaoMusic/{__version__} "
|
||||
f"({os_name} {os_version}; {architecture}; {machine}) "
|
||||
f"Python/{python_version}"
|
||||
# f"({os_name} {os_version}; {architecture}; {machine}) "
|
||||
# f"Python/{python_version}"
|
||||
)
|
||||
|
||||
return user_agent
|
||||
|
@ -756,6 +756,7 @@ class XiaoMusic:
|
||||
analytics_task is not None
|
||||
) # to keep the reference to task, do not remove this
|
||||
async with ClientSession() as session:
|
||||
self.log.debug(f"set session:{session}")
|
||||
self.session = session
|
||||
await self.init_all_data(session)
|
||||
task = asyncio.create_task(self.poll_latest_ask())
|
||||
|
Loading…
Reference in New Issue
Block a user