feat(monitor): 粘贴视频链接换出博主主页
Deploy VitePress site to Pages / build (push) Canceled after 0s
Deploy VitePress site to Pages / Deploy (push) Canceled after 0s

运营手上常常只有一条作品的分享链接,可监控任务认的是主页里的 sec_uid。

- 从整段分享文案里抠链接(链接前后都是字,按行切切不开),短链先展开,
  再从中取作品 id,最后用详情接口换 author.sec_uid
- 一次最多 20 条,串行 + 0.4 秒间隔;单条失败只在那一条上报错,不连累整批
- normalize_aweme 补上 creator_id:哈希拼不出主页地址,顺带让以后入库的
  抖音作品也带主页链接
- 监控页左上角「视频转主页」,支持逐条复制和一键复制全部(http 下没有
  navigator.clipboard,走 execCommand 兜底)
This commit is contained in:
2026-10-23 08:55:26 +08:00
parent 8e398a5ba1
commit 1474e5e3eb
12 changed files with 651 additions and 6 deletions
+3
View File
@@ -442,6 +442,9 @@ def normalize_aweme(aweme: Dict[str, Any]) -> Dict[str, Any]:
# **秒**。adapters.time_scale 会把它换成毫秒,和 store 写出来的形态一致。
"create_time": _as_int(aweme.get("create_time")),
"creator_hash": anonymize_user_id(uid or author.get("sec_uid") or ""),
# 主页 id(sec_uid)。**哈希拼不出主页地址**,而详情接口的返回里现成就有这一段
# —— 不带出来,库里抖音作品的主页链接就全是空的。
"creator_id": str(author.get("sec_uid") or ""),
"nickname": nickname,
"liked_count": str(_as_int(statistics.get("digg_count"))),
"comment_count": str(_as_int(statistics.get("comment_count"))),