diff --git a/yunke-server/scripts/scrape_via_page.py b/yunke-server/scripts/scrape_via_page.py index bb8acc0..10cd8a4 100644 --- a/yunke-server/scripts/scrape_via_page.py +++ b/yunke-server/scripts/scrape_via_page.py @@ -885,11 +885,23 @@ async def scrape_group_messages(cookie_str: str, max_groups: int = 500): def _normalize_msg_type(raw_type) -> str | None: - """Normalize a raw message type to our canonical type string.""" + """Normalize a raw message type to our canonical type string. + + 微信 type=2 = 图片(新版,fileTh 带完整 OSS URL;真机 A**杰对话确认 + 2026-08-20——旧映射漏掉它导致图片被存成 unknown 前端不渲染)。 + """ if raw_type is None: return None t = str(raw_type) - mapping = {"1": "text", "3": "image_legacy", "34": "voice", "43": "video", "47": "emoji", "49": "file"} + mapping = { + "1": "text", + "2": "image", # 新版图片(fileTh URL) + "3": "image_legacy", # 旧版图片(md5/键) + "34": "voice", + "43": "video", + "47": "emoji", + "49": "file", + } return mapping.get(t, "unknown")