提交 d6426267 编写于 作者: B binaryify

修复云盘接口中文音乐信息乱码的问题 #1108

上级 cc6551ca
# 更新日志
### 4.0.3 | 2021.1.28
- 修复云盘接口中文音乐信息乱码的问题 [#1108](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1108)
### 4.0.2 | 2021.1.18
- 修复未绑定手机号对歌单添加或删除歌曲无响应的问题 [#1099](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1099)
......
......@@ -42,25 +42,40 @@ module.exports = async (query, request) => {
let songName = ''
try {
const metadata = await mm.parseBuffer(query.songFile.data, 'audio/mpeg')
if (metadata.native.ID3v1) {
metadata.native.ID3v1.forEach((item) => {
// console.log(item.id, item.value)
if (item.id === 'title') {
songName = item.value
}
if (item.id === 'artist') {
artist = item.value
}
if (item.id === 'album') {
album = item.value
}
})
// console.log({
// songName,
// album,
// songName,
// })
const info = metadata.common
if (info.title) {
songName = info.title
}
if (info.album) {
album = info.album
}
if (info.artist) {
artist = info.artist
}
// if (metadata.native.ID3v1) {
// metadata.native.ID3v1.forEach((item) => {
// // console.log(item.id, item.value)
// if (item.id === 'title') {
// songName = item.value
// }
// if (item.id === 'artist') {
// artist = item.value
// }
// if (item.id === 'album') {
// album = item.value
// }
// })
// // console.log({
// // songName,
// // album,
// // songName,
// // })
// }
// console.log({
// songName,
// album,
// songName,
// })
} catch (error) {
console.log(error)
}
......
{
"name": "NeteaseCloudMusicApi",
"version": "4.0.2",
"version": "4.0.3",
"description": "网易云音乐 NodeJS 版 API",
"scripts": {
"start": "node app.js",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册