fix(music_download): 增强下载日志,添加歌曲ID和URL信息

This commit is contained in:
Miyokiss 2025-06-07 20:43:58 +08:00
parent 78237a30a6
commit a9e873d15a

View file

@ -281,7 +281,7 @@ async def music_download(song_id):
async with async_client.stream("GET",song_url.text,headers=headers,follow_redirects=True) as response: async with async_client.stream("GET",song_url.text,headers=headers,follow_redirects=True) as response:
response.raise_for_status() response.raise_for_status()
if response.status_code == 200: if response.status_code == 200:
logger.debug(f"下载歌曲中...") logger.debug(f"下载歌曲ID:{song_id}\nURL:{song_url.text}\n开始下载中...")
file_path = os.path.join(save_path, f"{datetime.now().date()}-{uuid.uuid4().hex}-{song_id}.wav") file_path = os.path.join(save_path, f"{datetime.now().date()}-{uuid.uuid4().hex}-{song_id}.wav")
file_name = os.path.basename(f"{datetime.now().date()}-{uuid.uuid4().hex}-{song_id}.wav") file_name = os.path.basename(f"{datetime.now().date()}-{uuid.uuid4().hex}-{song_id}.wav")