mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-04 03:22:08 +08:00
修复云盘接口中文音乐信息乱码的问题 #1108
This commit is contained in:
parent
cc6551ca9a
commit
d64262676a
@ -1,4 +1,7 @@
|
|||||||
# 更新日志
|
# 更新日志
|
||||||
|
### 4.0.3 | 2021.1.28
|
||||||
|
- 修复云盘接口中文音乐信息乱码的问题 [#1108](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1108)
|
||||||
|
|
||||||
### 4.0.2 | 2021.1.18
|
### 4.0.2 | 2021.1.18
|
||||||
- 修复未绑定手机号对歌单添加或删除歌曲无响应的问题 [#1099](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1099)
|
- 修复未绑定手机号对歌单添加或删除歌曲无响应的问题 [#1099](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1099)
|
||||||
|
|
||||||
|
@ -42,25 +42,40 @@ module.exports = async (query, request) => {
|
|||||||
let songName = ''
|
let songName = ''
|
||||||
try {
|
try {
|
||||||
const metadata = await mm.parseBuffer(query.songFile.data, 'audio/mpeg')
|
const metadata = await mm.parseBuffer(query.songFile.data, 'audio/mpeg')
|
||||||
if (metadata.native.ID3v1) {
|
const info = metadata.common
|
||||||
metadata.native.ID3v1.forEach((item) => {
|
if (info.title) {
|
||||||
// console.log(item.id, item.value)
|
songName = info.title
|
||||||
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,
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
|
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) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "NeteaseCloudMusicApi",
|
"name": "NeteaseCloudMusicApi",
|
||||||
"version": "4.0.2",
|
"version": "4.0.3",
|
||||||
"description": "网易云音乐 NodeJS 版 API",
|
"description": "网易云音乐 NodeJS 版 API",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node app.js",
|
"start": "node app.js",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user