今年2025的年度报告出来,不出所料好多的播放数都给了MyGO!!!!!。其中还有一个特别有意思的点就是最早我在23年底就听过迷星叫,原来我也是老资历了么?(乐
看到这里我也想知道其他歌曲首次播放时间,不过显然首次播放时间只会再年度报告之类地方能够看到。只能退而求其次,查询首次收藏时间了。值得注意的是,该脚本也可以查询歌曲加入歌单的时间。本脚本由哈基米Gemini编写而成。
接口:/api/v6/playlist/detail
使用说明
打开网易云音乐网页版并登录,按F12或者Ctrl + Shift + I 打开开发人员工具,切换到Console (控制台) ,粘贴并运行一下代码。注意替换需要查询的歌单以及歌曲的ID。
代码:
(function() {
// 你的歌单 ID
const playlistId = "1234567890";
// 你的目标歌曲 ID
const targetSongId = 2079882237;
console.log("🚀 正在尝试通过 v6 接口强行获取索引...");
// 使用 v6 接口,并加上 n=10000 参数防止分页截断
fetch(`https://music.163.com/api/v6/playlist/detail?id=${playlistId}&n=10000&s=8`)
.then(res => res.json())
.then(data => {
// 1. 检查数据结构
const playlist = data.playlist;
if (!playlist) {
console.error("❌ 接口未返回 playlist 对象,可能需要登录或 Cookie 失效。", data);
return;
}
// 2. 提取关键的 trackIds 数组
const trackIds = playlist.trackIds;
if (!trackIds || trackIds.length === 0) {
console.error("❌ 依然没有找到 trackIds,网易云后端可能针对此 IP 进行了限制。");
return;
}
console.log(`📊 获取成功!拿到 ${trackIds.length} 条索引数据。正在检索...`);
// 3. 在索引中查找目标
const target = trackIds.find(t => t.id === targetSongId);
if (target) {
console.log("----------------------------------------");
console.log(`✅ 命中歌曲 ID: ${target.id}`);
if (target.at) {
const date = new Date(target.at);
// 打印出超大的红字结果
console.log(`%c📅 收藏时间: ${date.toLocaleString()}`, "color: red; font-size: 24px; font-weight: bold; background: #ffff00; padding: 10px;");
console.log(`(时间戳: ${target.at})`);
} else {
console.warn("⚠️ 找到了索引,但 'at' 字段丢失。这通常意味着这首歌不是你收藏的,而是系统推荐插入的。");
}
console.log("----------------------------------------");
} else {
console.error(`❌ 遍历了 ${trackIds.length} 首歌,依然没找到 ID: ${targetSongId}。请确认歌曲是否真的在这个歌单里。`);
}
})
.catch(err => console.error("🔥 请求发生致命错误:", err));
})();