打开地址替换歌单ID
https://y.qq.com/musicmac/v6/playlist/detail.html?id=歌单ID
打开浏览器的检查->Console->执行代码
var songList = [];
Array.from(document.querySelectorAll(".songlist__item")).map((v) => {
var song = {};
song["singer"] = v.querySelector(".singer_name").title;
song["song"] = v.querySelector(".mod_songname__name").title;
songList.push(song);
});
console.log(JSON.stringify(songList));
测试
https://y.qq.com/musicmac/v6/playlist/detail.html?id=1135983683
[{"singer":"星弟","song":"最后一面"},{"singer":"姜玉阳","song":"最后一次相依偎"},{"singer":"优优","song":"爱到最后只剩下回忆"},{"singer":"宋孟君","song":"最后的安慰"},{"singer":"何安琪","song":"最后一次"},{"singer":"安苏羽","song":"最后的一句挽留"},{"singer":"胥拉齐","song":"最后一封信"},{"singer":"庄心妍","song":"最后的温柔"},{"singer":"夏婉安","song":"最后的晚安"},{"singer":"孙露","song":"最后一次"},{"singer":"单色凌","song":"最后的皇后"},{"singer":"格子兮","song":"最后的约定"},{"singer":"shelly佳","song":"最后一晚"},{"singer":"蒋雪儿","song":"最后的微笑"},{"singer":"田元","song":"最后的温柔"},{"singer":"本兮","song":"最后的最后"},{"singer":"胡文婧","song":"最后一刻才明白"},{"singer":"冷漠","song":"最后一次牵手"},{"singer":"夏婉安","song":"夜声带走最后一个我"}]
12.25更新
https://i.y.qq.com/n2/m/share/details/taoge.html?ADTAG=ryqq.playlist&id=歌单ID
打开浏览器的检查->Console->执行代码
var songList = [];
Array.from(document.querySelectorAll(".song_list__item")).map((v) => {
var song = {};
song["name"] = v.querySelector(".song_list__txt").textContent;
var artist = v.querySelector(".song_list__desc").textContent;
if(artist.indexOf(" · ")!=-1){
song["artist"] = artist.match(/(\S*) · /)[1];
}else{
song["artist"] = artist;
}
songList.push(song);
});
console.log(JSON.stringify(songList));
测试
https://i.y.qq.com/n2/m/share/details/taoge.html?ADTAG=ryqq.playlist&id=8390262816
评论区