# 视频号同一段日期重跑后，怎样合并评论而不重复计数？

[规范网址](https://social2api.com/guides/wechat-channels-retry-comment-duplicates/)

公开响应有作品 ID、评论正文、作者显示名与时间。可用这几列识别疑似重复，保留原文件和不能可靠判断的边界情况。

## Agent 提示词

~~~~text
请在 Social2api 使用微信视频号作品与评论，执行以下任务。
目标：合并重跑结果并标记疑似重复评论。
输入与对照示例：首次取数部分返回，次日重跑出现 12 条完全一致的记录。把它们标为疑似重复，先检查空时间和同名作者。
公开查询可先用免密钥合成示例；实时取数需要权限和部署支持。
按以下步骤完成：保存两份原始文件与各自的查询日期、参数和来源。 按 videoId、commentText、commentAuthor、commentPublishedAt 查找完全相同的记录。 空时间、同名作者或跨来源格式不一时保留待核对标记，再产出去重版。
交付能核对的结果和必要字段：videoId、commentText、commentAuthor、commentPublishedAt、provider。注明来源或限制，并以本页为操作参考。
https://social2api.com/guides/wechat-channels-retry-comment-duplicates/
~~~~

[导出重跑批次供核对](https://social2api.com/#workspace/channels)

[查看对应 API](https://social2api.com/docs/api/wechat-channels-videos/)

## 本页用到的 Social2api 接口

| 接口与参数文档 | 用途 |
| --- | --- |
| [微信视频号 视频评论列表](https://social2api.com/docs/api/catalog-wechat-channels-videos-comments-list/) · GET /v1/wechat\_channels/videos/comments/list | 微信视频号 视频评论列表。返回一页 data.items，以及可用的下一页游标。 |
| [微信视频号作品与评论](https://social2api.com/docs/api/wechat-channels-videos/) · POST /api/run · task=channels | 解析微信视频号账号，取回其公开视频以及每个视频的部分评论。 |

## 在 Social2api 使用微信视频号作品与评论

1. 保存两份原始文件与各自的查询日期、参数和来源。
2. 按 videoId、commentText、commentAuthor、commentPublishedAt 查找完全相同的记录。
3. 空时间、同名作者或跨来源格式不一时保留待核对标记，再产出去重版。

## 复制请求并试跑

将同参数的两份合成评论合并，练习用作品 ID、评论正文、作者和时间识别疑似重复。

这条请求使用合成样例，免登录、免 API Key，上游请求数为 0。要查真实数据，将 mode 改为 live，换成实际输入，并在 Authorization 中提供有相应任务权限的 Bearer API Key。可用 maxRequests 限制实时上游请求数。

~~~~bash
curl --fail-with-body -sS 'https://social2api.com/api/run' \
  -H 'Content-Type: application/json' \
  --data-binary @- <<'JSON'
{
  "task": "channels",
  "mode": "demo",
  "params": {
    "account": "评论复核示例账号",
    "limit": 3,
    "commentsPerVideo": 2,
    "since": "2026-10-12",
    "until": "2026-10-18"
  }
}
JSON
~~~~

## 把托管响应拆成作品表和评论表

将原始响应保存为 channels.json，把代码存为 split\_channels.py 后运行 python3 split\_channels.py channels.json。输出 videos.csv 和 comments.csv，通过 videoId 关联。三条作品、每条两条评论的样例应生成 3 条作品行和 6 条评论行。

托管结果没有独立评论 ID。comments.csv 的 sourceRow 仅定位本份输入。跨批次保留取数批次和原始行，正文、昵称与时间指纹只用于找疑似重复。需要平台评论 ID 时，用视频号作品评论接口读取 data.items\[\].id 和关联作品 ID。

~~~~python
import csv, json, sys
from pathlib import Path
source = Path(sys.argv[1])
rows = json.loads(source.read_text(encoding='utf-8'))['rows']
video_columns = ['videoId', 'title', 'publishedAt', 'likes', 'commentCount', 'url']
comment_columns = ['videoId', 'commentText', 'commentAuthor', 'commentPublishedAt', 'sourceRow']
videos, comments = {}, []
for position, row in enumerate(rows, 1):
    video_id = row['videoId']
    if not isinstance(video_id, str) or not video_id:
        raise ValueError(f'Expected a string videoId on row {position}')
    videos.setdefault(video_id, row)
    if row.get('commentText'):
        comments.append({**row, 'sourceRow': position})
for filename, fields, records in [('videos.csv', video_columns, videos.values()),
                                  ('comments.csv', comment_columns, comments)]:
    with open(filename, 'w', encoding='utf-8-sig', newline='') as output:
        writer = csv.DictWriter(output, fieldnames=fields, extrasaction='ignore')
        writer.writeheader()
        writer.writerows(records)
print(f'{len(videos)} videos, {len(comments)} comments')
~~~~

## 操作示例与核对

首次取数部分返回，次日重跑出现 12 条完全一致的记录。把它们标为疑似重复，先检查空时间和同名作者。

## 需要核对的字段

videoId、commentText、commentAuthor、commentPublishedAt、provider。

## 接口文档

- [/docs/](https://social2api.com/docs/)
- [微信视频号作品与评论](https://social2api.com/docs/api/wechat-channels-videos/)

## 相关用户讨论

- [相邻平台类比 · Reddit、其他社媒 · Is there a practical way to export entire reddit threads?](https://www.reddit.com/r/DataHoarder/comments/1pqywm4/is_there_a_practical_way_to_export_entire_reddit/)
- [相邻平台类比 · TikTok · 进行 TikTok 定性研究时，如何把作品元数据、评论与回复整理成可用于 Excel 分析的数据？](https://www.reddit.com/r/CompSocial/comments/1fez5z8/)

## 相关指南和问答

- [如何批量获取微信视频号历史作品和评论并导出 CSV](https://social2api.com/guides/wechat-channels-export-videos-comments/)

[导出重跑批次供核对](https://social2api.com/#workspace/channels)
