评论助推(回复)脚本配置
本页介绍用于任务创建的 boost_comment 脚本的配置参数。
我该用哪个脚本?
有两个不同的评论脚本,功能并不相同:
comment—— 在帖子上发布一条全新的顶层评论。参见评论脚本配置。boost_comment(本页)—— 点赞并/或回复某条已有评论。这就是 "REPLY COMMENT"(回复评论)/ "Boost Comments" 功能。
如果你想回复评论,那就来对地方了。
概述
boost_comment 脚本会打开一个帖子,并与其置顶评论互动 —— 可以点赞该评论、回复该评论,或两者都做。它是应用内 Boost Comments 弹窗的 API 等价功能。
与 comment 脚本不同,boost_comment 脚本会在单个任务运行中处理全部目标 URL(它内部按换行拆分 target_comment_urls,逐个处理)。每台设备(按序列号模式)或每个账号(按用户名 / 多账号模式)创建一个任务 —— 而不是每个 URL 一个任务。
脚本配置 (script_config)
参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| target_comment_urls | string | 是 | "" | 要互动其置顶评论的帖子 URL。多个 URL 用换行符(\n)分隔。 |
| enable_like_comment | boolean | 是* | false | 点赞每个帖子的置顶评论。 |
| enable_reply_comment | boolean | 是* | false | 回复每个帖子的置顶评论。 |
| reply_contents | string | 当 enable_reply_comment 为 true 时必填 | "" | 回复文本。多条回复选项用换行符(\n)分隔;每个任务按 reply_order 选择其中一条。 |
| reply_order | string | 否 | "random" | 如何从 reply_contents 中选择回复:random(随机)或 sequential(顺序)。 |
| insert_emoji | boolean | 否 | false | 在回复中插入随机表情。 |
| username | string | 否 | "" | 运行前切换到该账号。省略时使用设备当前激活的账号。 |
至少需要启用一个动作
你必须至少启用一个动作:将 enable_like_comment 和/或 enable_reply_comment 设为 true。如果 enable_reply_comment 为 true,则 reply_contents 不能为空。否则 API 会返回错误 40001。
互动的是哪条评论?
脚本互动的是每个帖子的置顶(第一条)评论。在 target_comment_urls 中填写帖子 URL 即可 —— 无需指向某条单独评论的直链。
示例
回复评论(最常见的场景)
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "boost_comment",
"script_config": {
"target_comment_urls": "https://www.tiktok.com/@username/video/1234567890",
"enable_reply_comment": true,
"reply_contents": "Great point!\nI totally agree!\nThanks for sharing 🙌"
}
}'
回复将从 reply_contents 的三行中选择(默认随机)。
同时点赞并回复
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "boost_comment",
"script_config": {
"target_comment_urls": "https://www.tiktok.com/@username/video/1234567890",
"enable_like_comment": true,
"enable_reply_comment": true,
"reply_contents": "Couldn'\''t agree more!\nWell said!",
"reply_order": "sequential",
"insert_emoji": true
}
}'
在一个任务中互动多个帖子的评论
用换行符分隔多个 URL。它们都会在同一个任务内被处理:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "boost_comment",
"script_config": {
"target_comment_urls": "https://www.tiktok.com/@user1/video/111\nhttps://www.tiktok.com/@user2/video/222\nhttps://www.tiktok.com/@user3/video/333",
"enable_reply_comment": true,
"reply_contents": "Love this!\nAmazing!\nSo true!",
"reply_order": "random"
}
}'
仅点赞(不回复)
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "boost_comment",
"script_config": {
"target_comment_urls": "https://www.tiktok.com/@username/video/1234567890",
"enable_like_comment": true
}
}'
使用指定账号运行(用户名模式)
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"usernames": ["@my_account1", "@my_account2"],
"script_name": "boost_comment",
"script_config": {
"target_comment_urls": "https://www.tiktok.com/@target/video/123",
"enable_reply_comment": true,
"reply_contents": "Nice!\nGreat content!"
}
}'
每个账号创建一个任务,运行前各自切换到对应账号。
Instagram 示例
同一套 API 也适用于 Instagram 帖子:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "boost_comment",
"script_config": {
"target_comment_urls": "https://www.instagram.com/p/ABC123/",
"enable_reply_comment": true,
"reply_contents": "Beautiful! 😍\nLove it!"
}
}'
响应
{
"code": 0,
"message": "success",
"data": {
"task_ids": [301],
"created_count": 1
}
}
回复顺序
随机顺序 (random)
- 为任务从
reply_contents中随机选择一条回复。 - 让回复看起来更自然。
- 默认行为。
顺序模式 (sequential)
- 按任务序号(
job_count)选择回复:第一个任务用第一行,第二个任务用第二行,依此类推,到末尾后循环回开头。 - 适合将不同回复分配到多台设备/账号。
帖子 URL 格式
TikTok
https://www.tiktok.com/@username/video/1234567890123456
https://vm.tiktok.com/ABCDEFG/
Instagram
https://www.instagram.com/p/ABCDEFGHIJK/
https://www.instagram.com/reel/ABCDEFGHIJK/
comment 与 boost_comment 的区别
comment | boost_comment | |
|---|---|---|
| 功能 | 发布一条全新的顶层评论 | 点赞 / 回复某条已有评论 |
| 主要输入 | target_post_url(s) + comment_content | target_comment_urls + reply_contents |
| 任务拆分 | 每个 URL 一个任务 | 每台设备/账号一个任务(所有 URL 在同一任务内) |
| 文档 | 评论脚本 | 本页 |
最佳实践
- 变化你的回复:在
reply_contents中提供多行,避免不同账号的回复完全相同。 - 跨账号使用顺序模式:将
sequential顺序与多台设备/账号搭配,分散不同回复。 - 启用表情插入:设置
insert_emoji: true让回复更自然。 - 遵守平台限制:回复过于频繁可能触发限流。请将任务分散到不同时间。
错误码
| 错误码 | 说明 |
|---|---|
| 40001 | 缺少 target_comment_urls、未启用任何动作,或 enable_reply_comment 为 true 但 reply_contents 为空 |
| 40003 | 该脚本不支持通过 API 调用 |
| 40301 | API 访问需要 Pro+ 套餐 |