From 68a275dfd9efafef8d5d52b2350de23857a1b0d6 Mon Sep 17 00:00:00 2001 From: Allan Nava <allannava95@gmail.com> Date: Thu, 25 Jul 2024 22:20:21 +0200 Subject: [PATCH] added model content --- tiktok/content.go | 6 ++---- tiktok/model_content.go | 42 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 tiktok/model_content.go diff --git a/tiktok/content.go b/tiktok/content.go index e0428f1..62e2ac1 100644 --- a/tiktok/content.go +++ b/tiktok/content.go @@ -38,10 +38,8 @@ curl --location 'https://open.tiktokapis.com/v2/post/publish/video/init/' \ "video_cover_timestamp_ms": 1000 }, "source_info": { - "source": "FILE_UPLOAD", - "video_size": 50000123, - "chunk_size": 10000000, - "total_chunk_count": 5 + "source": "PULL_FROM_URL", + "video_url": "https://example.verified.domain.com/example_video.mp4", } }' */ diff --git a/tiktok/model_content.go b/tiktok/model_content.go new file mode 100644 index 0000000..4fe8a36 --- /dev/null +++ b/tiktok/model_content.go @@ -0,0 +1,42 @@ +package tiktok + +/* +{ + "data":{ + "creator_avatar_url": "https://lf16-tt4d.tiktokcdn.com/obj/tiktok-open-platform/8d5740ac3844be417beeacd0df75aef1", + "creator_username": "tiktok", + "creator_nickname": "TikTok Official", + "privacy_level_options": ["PUBLIC_TO_EVERYONE", "MUTUAL_FOLLOW_FRIENDS", "SELF_ONLY"] + "comment_disabled": false, + "duet_disabled": false, + "stitch_disabled": true, + "max_video_post_duration_sec": 300 + }, + "error": { + "code": "ok", + "message": "", + "log_id": "202210112248442CB9319E1FB30C1073F3" + } +} +*/ + +type QueryCreatorInfoResponse struct { + Data DataQueryCreatorInfo `json:"data"` + Error ErrorQueryCreatorInfo `json:"error"` +} + +type DataQueryCreatorInfo struct { + CreatorAvatarUrl string `json:"creator_avatar_url"` + CreatorUsername string `json:"creator_username"` + CreatorNickname string `json:"creator_nickname"` + PrivacyLevelOptions []string `json:"privacy_level_options"` + CommentDisabled bool `json:"comment_disabled"` + DuetDisabled bool `json:"duet_disabled"` + StitchDisabled bool `json:"stitch_disabled"` +} + +type ErrorQueryCreatorInfo struct { + Code string `json:"code"` + Message string `json:"message"` + LogId string `json:"log_id"` +}