转发脚本配置
本页面介绍创建任务时 repost 脚本的配置参数。
概述
repost 脚本用于自动转发 TikTok 视频。通过 API 提供多个目标帖子 URL 时,系统会为每个 URL 创建一个任务。使用 start_time 参数来控制任务的执行时间。
仅支持 TikTok
repost 脚本仅支持 TikTok。Instagram 没有原生转发功能。
脚本配置 (script_config)
script_config 对象包含转发脚本的参数。以下是可用参数:
参数
| 参数 | 类型 | 必需 | 默认值 | 描述 |
|---|---|---|---|---|
| target_post_urls | string[] | Yes* | [] | 要转发的目标帖子 URL 数组(每个 URL 一个任务) |
| target_post_url | string | Yes* | "" | 单个目标帖子 URL,或多个 URL 以换行/逗号分隔 |
备注
必须提供 target_post_urls 数组或 target_post_url 字符串。如果两者都提供,target_post_urls 优先。
任务创建
当提供多个目标帖子 URL 时,API 会为每个 URL 创建一个任务。例如,3 个 URL + 2 个设备 = 6 个任务。使用 start_time 参数控制任务的执行时间。
示例
转发单个帖子
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "repost",
"script_config": {
"target_post_url": "https://www.tiktok.com/@username/video/1234567890"
}
}'
转发多个帖子
转发多个帖子时,每个帖子创建一个任务:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "repost",
"script_config": {
"target_post_urls": [
"https://www.tiktok.com/@user1/video/111",
"https://www.tiktok.com/@user2/video/222",
"https://www.tiktok.com/@user3/video/333"
]
}
}'
这将创建 3 个独立的任务,立即执行。