Skip to main content

การตั้งค่าสคริปต์ Comment

หน้านี้อธิบายพารามิเตอร์การตั้งค่าสำหรับสคริปต์ comment ที่ใช้ตอนสร้างงาน

ภาพรวม

สคริปต์ comment ใช้สำหรับคอมเมนต์โพสต์บน TikTok หรือ Instagram อัตโนมัติ เมื่อคุณส่ง URL โพสต์เป้าหมายหลายรายการผ่าน API ระบบจะ สร้าง 1 งานต่อ URL เป้าหมาย 1 รายการ คุณสามารถใช้ start_time เพื่อกำหนดเวลาเริ่มของแต่ละงานได้

การตั้งค่าสคริปต์ (script_config)

อ็อบเจ็กต์ script_config เก็บพารามิเตอร์ของสคริปต์ comment ดังนี้

พารามิเตอร์

พารามิเตอร์ชนิดจำเป็นค่าเริ่มต้นคำอธิบาย
target_post_urlsstring[]ใช่*[]รายการ URL โพสต์เป้าหมายที่จะคอมเมนต์ (1 URL = 1 งาน)
target_post_urlstringใช่*""URL โพสต์เป้าหมายเดี่ยว หรือหลาย URL คั่นด้วยขึ้นบรรทัดใหม่/จุลภาค
comment_contentstringใช่""เนื้อหาคอมเมนต์ สามารถใส่หลายคอมเมนต์โดยคั่นด้วยขึ้นบรรทัดใหม่
comment_orderstringไม่"random"วิธีเลือกคอมเมนต์: random (สุ่ม) หรือ sequential (ตามลำดับ)
insert_emojibooleanไม่falseแทรกอีโมจิแบบสุ่มในคอมเมนต์หรือไม่
comment_image_pathstringไม่""พาธไฟล์รูปสำหรับคอมเมนต์รูป (เฉพาะ TikTok) รองรับทั้งพาธสัมบูรณ์ และพาธสัมพัทธ์กับ work_dir/upload/
note

ต้องระบุ target_post_urls หรือ target_post_url อย่างน้อยหนึ่งค่า หากส่งทั้งสองค่า ระบบจะใช้ target_post_urls ก่อน

คอมเมนต์รูปภาพ (เฉพาะ TikTok)

พารามิเตอร์ comment_image_path ช่วยให้คุณแนบรูปไปกับคอมเมนต์ได้ ฟีเจอร์นี้ รองรับเฉพาะ TikTok - Instagram ไม่รองรับการแนบรูปในคอมเมนต์ รูปจะถูกส่งเข้าอุปกรณ์และเลือกเป็นรูปแรกในแกลเลอรี

การสร้างงาน

เมื่อมี URL โพสต์เป้าหมายหลายรายการ API จะ สร้าง 1 งานต่อ URL โพสต์เป้าหมาย เช่น หากกำหนด URL 3 รายการและอุปกรณ์ 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": "comment",
"script_config": {
"target_post_url": "https://www.tiktok.com/@username/video/1234567890",
"comment_content": "คอนเทนต์ยอดเยี่ยมมาก! 🔥"
}
}'

ใช้หลายข้อความคอมเมนต์

ใส่หลายคอมเมนต์คั่นด้วยขึ้นบรรทัดใหม่ ระบบจะเลือกตาม comment_order:

curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "comment",
"script_config": {
"target_post_url": "https://www.tiktok.com/@username/video/1234567890",
"comment_content": "วิดีโอดีมาก!\nชอบคอนเทนต์นี้มาก!\nสู้ต่อไปนะ! 👏\nดีจริง ๆ!",
"comment_order": "random"
}
}'

คอมเมนต์หลายโพสต์

เมื่อคอมเมนต์หลายโพสต์ ระบบจะสร้างงานแยกสำหรับแต่ละโพสต์:

curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "comment",
"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"
],
"comment_content": "วิดีโอดี!\nยอดเยี่ยม!\nชอบมาก!",
"comment_order": "sequential"
}
}'

ตัวอย่างนี้จะสร้าง 3 งานแยกและทำงานทันที

คอมเมนต์ตามเวลา

ใช้ start_time เพื่อตั้งเวลาเริ่มงาน:

curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "comment",
"script_config": {
"target_post_url": "https://www.tiktok.com/@username/video/1234567890",
"comment_content": "คอมเมนต์ตามเวลา!"
},
"start_time": "14:30"
}'

คอมเมนต์พร้อมแทรกอีโมจิ

เปิดการแทรกอีโมจิอัตโนมัติ เพื่อให้คอมเมนต์ดูเป็นธรรมชาติมากขึ้น:

curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "comment",
"script_config": {
"target_post_url": "https://www.tiktok.com/@username/video/1234567890",
"comment_content": "สุดยอดมาก",
"insert_emoji": true
}
}'

คอมเมนต์ด้วยโหมดรายการ username

สร้างงานคอมเมนต์ให้บัญชีที่ระบุโดยตรง:

curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"usernames": ["@my_account1", "@my_account2"],
"script_name": "comment",
"script_config": {
"target_post_url": "https://www.tiktok.com/@target/video/123",
"comment_content": "วิดีโอนี้ดีมาก!"
}
}'

คอมเมนต์แบบกลุ่มบนหลายอุปกรณ์

curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_1", "device_2", "device_3"],
"script_name": "comment",
"script_config": {
"target_post_url": "https://www.tiktok.com/@viral/video/999",
"comment_content": "คอนเทนต์ดีมาก!\nผลงานยอดเยี่ยม!\nชอบมาก!",
"comment_order": "random"
},
"enable_multi_account": true
}'

ตัวอย่างคอมเมนต์ Instagram

API เดียวกันใช้กับโพสต์ Instagram ได้เช่นกัน:

curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "comment",
"script_config": {
"target_post_url": "https://www.instagram.com/p/ABC123/",
"comment_content": "ภาพสวยมาก! 📸",
"insert_emoji": true
}
}'

ตัวอย่างคอมเมนต์รูปบน TikTok

แนบรูปภาพไปกับคอมเมนต์ TikTok (Instagram ไม่รองรับ):

curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "comment",
"script_config": {
"target_post_url": "https://www.tiktok.com/@username/video/1234567890",
"comment_content": "ลองดูรูปนี้!",
"comment_image_path": "C:/images/my_image.jpg"
}
}'
พาธรูปภาพ

comment_image_path สามารถเป็น:

  • พาธสัมบูรณ์: C:/images/my_image.jpg หรือ /home/user/images/my_image.jpg
  • พาธสัมพัทธ์: my_image.jpg (อ้างอิงจาก work_dir/upload/)

ผลลัพธ์ (Response)

{
"code": 0,
"message": "success",
"data": {
"task_ids": [301, 302, 303],
"created_count": 3
}
}

ลำดับการเลือกคอมเมนต์

แบบสุ่ม (random)

  • สุ่มเลือกคอมเมนต์จากรายการที่ให้ไว้
  • เหมาะสำหรับทำให้คอมเมนต์ดูเป็นธรรมชาติ
  • เป็นค่าพฤติกรรมเริ่มต้น

แบบตามลำดับ (sequential)

  • เลือกคอมเมนต์ตามลำดับโดยอิง job_count
  • งานแรกใช้คอมเมนต์แรก งานที่สองใช้คอมเมนต์ที่สอง ไปเรื่อย ๆ
  • เมื่อถึงท้ายรายการจะวนกลับไปต้นรายการ
  • เหมาะสำหรับกระจายคอมเมนต์ที่แตกต่างกันในหลายงาน