feat(monitor): 粘贴视频链接换出博主主页
运营手上常常只有一条作品的分享链接,可监控任务认的是主页里的 sec_uid。 - 从整段分享文案里抠链接(链接前后都是字,按行切切不开),短链先展开, 再从中取作品 id,最后用详情接口换 author.sec_uid - 一次最多 20 条,串行 + 0.4 秒间隔;单条失败只在那一条上报错,不连累整批 - normalize_aweme 补上 creator_id:哈希拼不出主页地址,顺带让以后入库的 抖音作品也带主页链接 - 监控页左上角「视频转主页」,支持逐条复制和一键复制全部(http 下没有 navigator.clipboard,走 execCommand 兜底)
This commit is contained in:
@@ -551,3 +551,24 @@ export interface MonitorIdentity {
|
||||
last_ok_at: number | null
|
||||
last_error: string | null
|
||||
}
|
||||
|
||||
/**
|
||||
* 「视频链接 → 博主主页」的一条结果。
|
||||
*
|
||||
* `ok` 为 false 时 `error` 一定有值 —— 批量粘贴时每条各自成败,不能整批共用一个错误。
|
||||
*/
|
||||
export interface VideoLinkResult {
|
||||
input: string
|
||||
aweme_id: string
|
||||
ok: boolean
|
||||
nickname: string
|
||||
sec_uid: string
|
||||
profile_url: string
|
||||
error: string
|
||||
}
|
||||
|
||||
export interface VideoLinkResolveResponse {
|
||||
results: VideoLinkResult[]
|
||||
/** 超过一次能解析的上限,后面的没处理 —— 前端要说出来,不能默默截断。 */
|
||||
truncated: boolean
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user