fix(NFLmusic.py): 修复歌词时间显示错误

- 将 total_time 转换为浮点数,确保时间计算准确- 使用 int() 函数将分钟数转换为整数,避免小数点后的时间显示
This commit is contained in:
2025-03-23 14:56:13 +08:00
parent 155b0be096
commit 3bc1cc8b69

View File

@ -153,9 +153,9 @@ def download_music(song_name, choose):
lrclist = resp_lrc.json()["data"]["lrclist"] lrclist = resp_lrc.json()["data"]["lrclist"]
for i in lrclist: for i in lrclist:
total_time = i["time"] total_time = i["time"]
min = total_time // 60 min = float(total_time) // 60
sec = total_time % 60 sec = float(total_time) % 60
lrc += f'[{min}:{sec}]{i["lineLyric"]}\n' lrc += f'[{int(min)}:{sec}]{i["lineLyric"]}\n'
except Exception as e: except Exception as e:
print(f"download_kw_lrc: {e}") print(f"download_kw_lrc: {e}")
lrc = "" lrc = ""