修复朋友圈媒体路径凭证错配与打包版 WASM 解密运行时 - #133
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
朋友圈媒体加载存在两个主要问题:
/60、/150、/200、/480等缩略图路径隐式改写为/0,但仍携带缩略图 token/key。腾讯 CDN 的路径与凭证绑定,错配后会返回 400。此外,无有效封面的视频可能把视频下载地址送入图片接口;原始 HTTP 客户端日志也可能记录包含媒体凭证的完整 CDN URL。
修改内容
媒体 URL 与凭证
/60、/150、/200、/480和已有/0路径,只规范 HTTPS、token 与idx=1。variant=full时允许请求/0原图。打包运行时
WECHAT_TOOL_NODE_EXECUTABLE=process.execPath。WECHAT_TOOL_NODE_MODE=electron-run-as-node,仅在启动 WASM helper 子进程时设置ELECTRON_RUN_AS_NODE=1。runAsNodefuse 开启,不额外打包 Node sidecar。shutil.which("node")查找 Node。错误与日志
url查询参数整体脱敏。自动化与打包验收
验证结果
image/jpeg。a4283a268f8b259572655931aaac1b2e822de7852112284d55bd5d6186e1f657。499a0591e13af2ab06c1807a9faae6adced4092c98d56fc0f288f5b2a2e61b35。git diff --check通过。兼容性
/api/sns/media?variant=full接口请求。