fix: 完善 ScoreSaber 歌曲哈希查询的错误处理

This commit is contained in:
lixiangwuxian 2025-03-08 21:02:44 +08:00
parent 78afc9005f
commit 48ed4e8569

View File

@ -411,6 +411,9 @@ func GetSongIdsByHash(hashs []string) (hashToSongId map[string]string, err error
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
return nil, fmt.Errorf("获取歌曲ID失败状态码%d,url:%s", resp.StatusCode, queryUrl)
}
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err