즐겨찾기 스크립트 구성
이 페이지에서는 작업 생성에 사용되는 favorite 스크립트의 구성 매개변수를 설명합니다.
개요
favorite 스크립트는 게시물을 TikTok의 즐겨찾기 / Instagram의 저장됨에 추 가합니다. API를 통해 여러 URL을 제공하면 URL당 하나의 작업이 생성됩니다. start_time 매개변수로 각 작업의 실행 시간을 제어할 수 있습니다.
이미 즐겨찾기에 추가된 게시물은 건너뜁니다
스크립트는 이미 즐겨찾기/저장된 게시물을 감지하고 건너뛰므로, 작업을 다시 실행해도 즐겨찾기가 해제되지 않습니다.
스크립트 구성 (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당 하나의 작업을 생성합니다. 예를 들어, 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": "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"
}'
사용자 이름 목록으로 즐겨찾기
특정 계정에 즐겨찾기 작업을 직접 생성:
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
}
}