Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
W wxbot-client
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Metrics
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • 庞朝阳
  • wxbot-client
  • Merge requests
  • !5

You need to sign in or sign up before continuing.
Merged
Created May 29, 2026 by 庞朝阳@pangzhaoyangMaintainer

feat(wxhook): 视频/语音/文件下载链路 + type=49 XML 子类型分发

  • Overview 0
  • Commits 18
  • Changes 18

跟图片同范式给视频、语音、文件加上主动下载落盘:

  • 视频(type=43): download_attachment + poll wxhelper/video/{msg_id}.*
  • 语音(type=34): get_voice_by_msg_id 写入 ~/wxbot-cache/wxhook-voice/
  • 文件(type=49 sub=6): download_attachment + poll wxhelper/file/{原文件名}

type=49 大类按 二级分发:

  • 6 → 真正的文件下载入口,触发下载
  • 74 → 文件上传中占位 (实测发现配对出现),返 None 让上游丢弃避免重复
  • 5/57/33/36 → 链接/引用/小程序 placeholder
  • 其他 → '[xml:N]'

NormalizedMessage 扩展 file_name/file_size/duration 三个字段,小雷接入时 下游可直接拿到原文件名、字节数和音视频时长,无需再解 XML。

XML 元数据解析走轻量正则 (不上 ElementTree,微信非标 XML 容易报错), 基于实测真实样本验证 (语音 voicelength/voiceformat,视频 playlength/length/md5, 文件 title+totallen+fileext,均含 CDATA / 非 CDATA 两种写法)。

_discover_image_dir 重构成参数化 _discover_wxhelper_dir(kind), 覆盖 image/video/file 三个子目录,语音用 ~/wxbot-cache/wxhook-voice/ 自管。

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: feat/wxhook-adapter