feat(monitor): 从超级编导按创建时间导入作品链接
Deploy VitePress site to Pages / build (push) Canceled after 0s
Deploy VitePress site to Pages / Deploy (push) Canceled after 0s

超级编导的数据中心里已经有每条分发作品的抖音链接,不用再一条条粘。按
「分发活动创建时间」选一段区间 → 预览作品/博主/播放数据 → 一键建成作品
模式的监控任务,建完默认立刻采一轮,主页信息第一轮就补全。

- 活动列表不支持日期过滤(传了也被静默忽略),只能全量拉下来本地按
  created_at 筛;边界按东八区算 —— 容器跑 UTC,按 localtime 会整体错开
  8 小时。
- data_center 必须带 video_status=-1,不带默认 0,接口返回空列表。
- share_url 是双斜杠形态,建任务时只取裸作品 id;video_link 的 id 提取
  也顺带认双斜杠了。
- 作品模式不拉创作者资料、没有账号快照,组头的主页链接一直出不来。
  作品上新增 creator_id(author.sec_uid),优先快照、再用作品兜底。
- token 存设置页(secret),不进仓库。
This commit is contained in:
2026-10-24 16:27:42 +08:00
parent 19b45908e3
commit 32cb9b1952
17 changed files with 1280 additions and 17 deletions
+11 -1
View File
@@ -988,6 +988,7 @@ async def list_creators(
func.count().label("note_count"),
func.max(MonitorNote.last_seen_at).label("last_seen_at"),
func.max(MonitorNote.creator_name).label("creator_name"),
func.max(MonitorNote.creator_id).label("creator_id"),
)
.where(MonitorNote.creator_hash != "")
.group_by(MonitorNote.task_id, MonitorNote.creator_hash)
@@ -1001,6 +1002,7 @@ async def list_creators(
"note_count": row.note_count,
"last_seen_at": row.last_seen_at,
"creator_name": row.creator_name or "",
"creator_id": row.creator_id or "",
}
stats = await _latest_creator_stats(session, task_ids=scope)
@@ -1042,8 +1044,16 @@ async def list_creators(
),
# 主页跳转。拿不到主页 id(小红书不落创作者资料、或者这个博主还没采过
# 资料)就是空串,界面不画按钮 —— 而不是给一个点开 404 的链接。
#
# **作品上的 id 是账号快照的兜底**:作品模式(以及超级编导导入)只拉
# 作品详情、不拉创作者资料,快照一行都没有 —— 但详情里的
# ``author.sec_uid`` 已经落在作品上了。没有这层兜底,这类任务里每个博主
# 都缺主页链接,而这恰恰是它们唯一能跳的地方。
"creator_url": adapters.creator_url(
task_platform.get(row_task, ""), stat.creator_id if stat else ""
task_platform.get(row_task, ""),
(stat.creator_id if stat else "")
or (work_row or {}).get("creator_id")
or "",
),
"note_count": (work_row or {}).get("note_count", 0),
"creator_fans": stat.fans if stat else None,