diff --git a/src/music/netease.test.ts b/src/music/netease.test.ts index fafa95e..b37501d 100644 --- a/src/music/netease.test.ts +++ b/src/music/netease.test.ts @@ -262,7 +262,7 @@ describe("NeteaseProvider.getPlaylistSongs (#200)", () => { expect(post).toHaveBeenCalledTimes(Math.ceil(size / 1000)); for (let offset = 0; offset < size; offset += 1000) { expect(post).toHaveBeenNthCalledWith(offset / 1000 + 1, "/song/detail", { - ids: ids.slice(offset, offset + 1000).join(","), cookie: "MUSIC_U=test", + ids: ids.slice(offset, offset + 1000).join(","), cookie: "MUSIC_U=test", crypto: "eapi", }, { headers: { "x-apicache-bypass": "1" } }); } }); diff --git a/src/music/netease.ts b/src/music/netease.ts index 0d4cd80..fd7d792 100644 --- a/src/music/netease.ts +++ b/src/music/netease.ts @@ -368,8 +368,13 @@ export class NeteaseProvider implements MusicProvider { const songs: Song[] = []; for (let offset = 0; offset < trackIds.length; offset += batchSize) { const ids = trackIds.slice(offset, offset + batchSize).map(track => String(track.id)); - // The sidecar's URL-based cache cannot distinguish POST bodies. - const details = await this.api.post("/song/detail", { ids: ids.join(","), ...cookie }, { + const details = await this.api.post("/song/detail", { + ids: ids.join(","), + // Match /playlist/track/all's detail lookup; /song/detail defaults to weapi. + crypto: "eapi", + ...cookie, + }, { + // The sidecar's URL-based cache cannot distinguish POST bodies. headers: { "x-apicache-bypass": "1" }, }); if (!Array.isArray(details.data?.songs)) throw new Error("网易云返回的歌曲详情无效");