feat(monitor): 组头上加一个跳到博主主页的按钮
`creator_hash` 是单向的,拼不出主页地址 —— 所以这个 id 必须在采集时单独存下来。 抖音的资料接口本来就返回 sec_uid,只是之前没落库。 * `monitor_creator_stat` 加 `creator_id` 列(老数据默认空,下一次采集补上); * 链接在 `adapters.creator_url()` 里拼,**空串是有意义的返回值**:平台不认识、 或者没拿到 id,就返回空,界面据此不画按钮 —— 画一个点开 404 的按钮比不画糟; * 没有作品的博主照样有链接:他恰恰是你想点进去看的那个人。 已知缺口:小红书那条路(爬虫子进程)根本不落创作者资料,所以那边没有链接。
This commit is contained in:
@@ -756,6 +756,11 @@ async def list_creators(
|
||||
"creator_alias": aliases.get(
|
||||
(task_platform.get(row_task, ""), creator_hash), ""
|
||||
),
|
||||
# 主页跳转。拿不到主页 id(小红书不落创作者资料、或者这个博主还没采过
|
||||
# 资料)就是空串,界面不画按钮 —— 而不是给一个点开 404 的链接。
|
||||
"creator_url": adapters.creator_url(
|
||||
task_platform.get(row_task, ""), stat.creator_id if stat else ""
|
||||
),
|
||||
"note_count": (work_row or {}).get("note_count", 0),
|
||||
"creator_fans": stat.fans if stat else None,
|
||||
"creator_total_favorited": stat.total_favorited if stat else None,
|
||||
|
||||
Reference in New Issue
Block a user