Skip to content

添加 XEAPI 响应解密支持 - #1751

Open
takoyakiwhite wants to merge 5 commits into
UnblockNeteaseMusic:enhancedfrom
takoyakiwhite:patch-xeapi
Open

添加 XEAPI 响应解密支持#1751
takoyakiwhite wants to merge 5 commits into
UnblockNeteaseMusic:enhancedfrom
takoyakiwhite:patch-xeapi

Conversation

@takoyakiwhite

Copy link
Copy Markdown

主要改动

  • 完整支持 XEAPI 响应解密(网易云 iOS 客户端)
  • 网易云返回 -460 (安全风险) 时自动触发音源替换
  • 增加可选的 User-Agent 和 M-Config-Info 请求头替换

takoyakiwhite and others added 5 commits August 8, 2026 09:23
Implements the new xeapi encryption and decryption logic, including X25519 key exchange,
AES-128-GCM, and custom transformations. This enables the proxy to handle requests
and responses from NetEase Cloud Music endpoints using this new scheme.
Prioritize song ID extraction from request parameters but fall back to the decrypted response body data when `netease.param` is empty, as is the case with `xeapi` encrypted requests. This improves robustness and ensures ID can be obtained even when request parameters are inaccessible.
Comment thread src/crypto.js
for (let i = 0; i < ciphertext.length; i++)
xored[i] = ciphertext[i] ^ random[i & 0x0f];
const encoded = Buffer.from(xored.toString('base64'));
const rotation = encoded.length ? (random[0] & 0x0f) % encoded.length : 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants