feat: receive media messages (image, video, voice, file)#10
Open
jinjiel1994 wants to merge 4 commits into
Open
feat: receive media messages (image, video, voice, file)#10jinjiel1994 wants to merge 4 commits into
jinjiel1994 wants to merge 4 commits into
Conversation
Download and decrypt media from WeChat CDN, save to local disk, and forward file paths to Claude Code via MCP notifications. - Add interfaces for MediaField, ImageItem, VideoItem, VoiceItemFull, FileItem - Add downloadAndDecryptMedia() with AES-128-ECB decryption - Add extractMediaFromItem() handling types 2/3/4/5 - Modify polling loop to process media alongside text - Media saved to ~/.claude/channels/wechat/media/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Upload and encrypt media to WeChat CDN, then send via ilink API. - Add uploadAndSendMedia() with AES-128-ECB encryption + CDN upload flow - Add getUploadUrl() for /ilink/bot/getuploadurl endpoint - Register wechat_send_media tool (accepts file_path + media_type) - Support image, video, and file sending - Update MCP instructions to document media capabilities Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix CDN download param: use x-encrypted-query-param instead of x-encrypted-param - Add encrypt_type, mid_size, hd_size to image_item for proper rendering - Remove debug logging from upload flow Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Generate video thumbnail with ffmpeg for proper WeChat rendering - Extract play_length with ffprobe - Upload thumbnail to CDN separately and include as thumb_media - Add encrypt_type field to all media items - Clean up all debug logging Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
|
Thanks for the PR! The media receive/send implementation looks good overall. One minor note: Hardcoded thumbnail dimensions: In Everything else looks solid — the download/decrypt flow, dual AES key format handling, and error handling are well done. |
3 tasks
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.
Summary
~/.claude/channels/wechat/media/with timestamped filenamesReadtool to view images or process media filesSupported message types
MSG_ITEM_IMAGE.jpgMSG_ITEM_VOICEMSG_ITEM_FILEMSG_ITEM_VIDEO.mp4, includes duration/size metadataNotification format
Media info is appended to the text content as inline annotations:
No new dependencies
Uses only
node:crypto,node:fs, and nativefetch— all already available in the project.Test plan
🤖 Generated with Claude Code