mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix: 网易云歌单曲目过少 & 歌手专辑更新日期错误 (#6221)
This commit is contained in:
@@ -23,6 +23,10 @@ module.exports = async (ctx) => {
|
||||
title: `${item.name} - ${singer}`,
|
||||
description: `歌手:${singer}<br>专辑:${item.name}<br>日期:${new Date(item.publishTime).toLocaleDateString()}<br><img src="${item.picUrl}">`,
|
||||
link: `https://music.163.com/#/album?id=${item.id}`,
|
||||
pubDate: new Date(item.publishTime),
|
||||
published: new Date(item.publishTime),
|
||||
category: item.subType,
|
||||
author: singer,
|
||||
};
|
||||
}),
|
||||
};
|
||||
|
||||
+19
-10
@@ -15,20 +15,29 @@ module.exports = async (ctx) => {
|
||||
});
|
||||
|
||||
const data = response.data.playlist;
|
||||
const songinfo = await got({
|
||||
method: 'get',
|
||||
url: `https://music.163.com/api/song/detail?ids=[${data.trackIds.slice(0, 201).map((item) => item.id)}]`,
|
||||
headers: {
|
||||
Referer: 'https://music.163.com',
|
||||
},
|
||||
});
|
||||
const songs = songinfo.data.songs;
|
||||
|
||||
ctx.state.data = {
|
||||
title: data.name,
|
||||
link: `https://music.163.com/#/playlist?id=${id}`,
|
||||
description: `网易云音乐歌单 - ${data.name}`,
|
||||
item:
|
||||
data.tracks &&
|
||||
data.tracks.map((item) => {
|
||||
const singer = item.ar.length === 1 ? item.ar[0].name : item.ar.reduce((prev, cur) => (prev.name || prev) + '/' + cur.name);
|
||||
return {
|
||||
title: `${item.name} - ${singer}`,
|
||||
description: `歌手:${singer}<br>专辑:${item.al.name}<br>日期:${new Date(item.publishTime).toLocaleDateString()}<br><img src="${item.al.picUrl}">`,
|
||||
link: `https://music.163.com/#/song?id=${item.id}`,
|
||||
};
|
||||
}),
|
||||
item: data.trackIds.slice(0, 201).map((item) => {
|
||||
const thissong = songs.find((element) => element.id === item.id);
|
||||
const singer = thissong.artists.length === 1 ? thissong.artists[0].name : thissong.artists.reduce((prev, cur) => (prev.name || prev) + '/' + cur.name);
|
||||
return {
|
||||
title: `${thissong.name} - ${singer}`,
|
||||
description: `歌手:${singer}<br>专辑:${thissong.album.name}<br>发行日期:${new Date(thissong.album.publishTime).toLocaleDateString()}<br><img src="${thissong.album.picUrl}">`,
|
||||
link: `https://music.163.com/#/song?id=${item.id}`,
|
||||
pubDate: new Date(item.at),
|
||||
author: singer,
|
||||
};
|
||||
}),
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user