การกำหนดค่าสคริปต์ Favorite
หน้านี้บันทึ กพารามิเตอร์การกำหนดค่าสคริปต์ favorite
ภาพรวม
สคริปต์ favorite เพิ่มโพสต์ไปยัง รายการโปรด (บน TikTok) / บันทึก (บน Instagram) เมื่อระบุ URL หลายรายการผ่าน API สร้างงานหนึ่งงานต่อ URL ควบคุมเวลาด้วย start_time
โพสต์ที่บันทึกแล้วจะถูกข้ามไป
สคริปต์ตรวจสอบโพสต์ที่บันทึกในรายการโปรด/บันทึกแล้ว และข้ามโพสต์เหล่านั้น ดังนั้นการรันซ้ำจะไม่ยกเลิกการบันทึก
การกำหนดค่าสคริปต์ (script_config)
พารามิเตอร์สำหรับสคริปต์ favorite:
พารามิเตอร์
| พารามิเตอร์ | ชนิด | จำเป็น | ค่าเริ่มต้น | คำอธิบาย |
|---|---|---|---|---|
| target_post_urls | string[] | Yes* | [] | อาร์เรย์ URL เป้าหมายสำหรับบันทึก (หนึ่งงานต่อ URL) |
| target_post_url | string | Yes* | "" | URL เดียวหรือหลาย URL คั่นด้วยบรรทัดใหม่/จุลภาค |
note
ต้องระบุ 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": "favorite",
"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": "favorite",
"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 งานแยกต่างห ากที่ดำเนินการทันที
กำหนดการบันทึกด้วยเวลาเริ่มต้น
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "favorite",
"script_config": {
"target_post_url": "https://www.tiktok.com/@username/video/1234567890"
},
"start_time": "14:30"
}'
บันทึกโพสต์ตามรายชื่อผู้ใช้
สร้างงาน favorite โดยตรงสำหรับบัญชีเฉพาะ:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"usernames": ["@my_account1", "@my_account2"],
"script_name": "favorite",
"script_config": {
"target_post_url": "https://www.tiktok.com/@target/video/123"
}
}'
ตัวอย่าง Instagram
บน Instagram สคริปต์ favorite บันทึก (บุ๊กมาร์ก) โพสต์:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "favorite",
"script_config": {
"target_post_url": "https://www.instagram.com/p/ABC123/"
}
}'
การตอบสนอง
{
"code": 0,
"message": "success",
"data": {
"task_ids": [601, 602, 603],
"created_count": 3
}
}
รูปแบบ 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/