fix: TikTok API endpoints and privacy level handling

- Fix publish endpoint: /post/video/init/ → /post/publish/video/init/
- Replace broken /video/list/ with /post/publish/creator_info/query/
- Auto-select valid privacy level from creator options (sandbox fix)
- Update tools, manifest, REST routes for creator_info
This commit is contained in:
Garfield
2026-05-12 00:53:55 -04:00
parent 30232e3ef8
commit 7796de12bf
4 changed files with 60 additions and 68 deletions

View File

@@ -681,15 +681,14 @@ export function getOpenApiSpec(serverUrl: string) {
responses: { '200': { description: 'Profile info' } },
},
},
'/api/tiktok/videos': {
'/api/tiktok/creator-info': {
get: {
operationId: 'tiktok_get_videos',
summary: 'Get TikTok videos',
operationId: 'tiktok_get_creator_info',
summary: 'Get TikTok creator info',
parameters: [
{ name: 'max_count', in: 'query', schema: { type: 'integer' } },
{ name: 'account', in: 'query', schema: { type: 'string' } },
],
responses: { '200': { description: 'Video list' } },
responses: { '200': { description: 'Creator publishing info' } },
},
},
'/api/tiktok/video': {
@@ -1822,31 +1821,30 @@ export function getManifest(serverUrl: string, authEnabled: boolean) {
examples: [{ account: 'default' }],
},
{
name: 'tiktok_get_videos',
name: 'tiktok_get_creator_info',
category: 'tiktok',
description: 'List recent videos from the authenticated TikTok account',
when_to_use: 'User wants to see their recent TikTok videos and performance stats.',
description: 'Get TikTok creator publishing info including privacy levels and max video duration',
when_to_use: 'User wants to check their TikTok publishing capabilities before posting a video.',
input_schema: {
type: 'object',
properties: {
max_count: { type: 'number', description: 'Max videos to return (default: 10, max: 20)' },
account: { type: 'string', description: 'Which TikTok account to use (default: "default")' },
},
},
returns: {
type: 'array',
items: {
type: 'object',
properties: {
id: { type: 'string' },
title: { type: 'string' },
view_count: { type: 'number' },
like_count: { type: 'number' },
share_url: { type: 'string' },
},
type: 'object',
properties: {
creator_username: { type: 'string' },
creator_nickname: { type: 'string' },
creator_avatar_url: { type: 'string' },
privacy_level_options: { type: 'array', items: { type: 'string' } },
max_video_post_duration_sec: { type: 'number' },
comment_disabled: { type: 'boolean' },
duet_disabled: { type: 'boolean' },
stitch_disabled: { type: 'boolean' },
},
},
examples: [{ max_count: 10, account: 'default' }],
examples: [{ account: 'default' }],
},
{
name: 'tiktok_create_video',