diff --git a/tiktok/content.go b/tiktok/content.go index 17d33a9..31f07c1 100644 --- a/tiktok/content.go +++ b/tiktok/content.go @@ -1,6 +1,8 @@ package tiktok import ( + + "net/url" "encoding/json" "fmt" ) @@ -65,6 +67,8 @@ func (o *tiktok) PostVideoInit(title, videoUrl string, privacyLevel string) (*Pu if !CheckPrivacyLevel(privacyLevel) { return nil, PrivacyLevelWrong } + encodedVideoUrl := url.QueryEscape(videoUrl) + // request := &PublishVideoRequest{ PostInfo: PostInfo{ Title: title, @@ -75,7 +79,7 @@ func (o *tiktok) PostVideoInit(title, videoUrl string, privacyLevel string) (*Pu }, SourceInfo: SourceInfo{ Source: "PULL_FROM_URL", - VideoUrl: videoUrl, + VideoUrl: encodedVideoUrl, }, } resp, err := o.restyPost(API_POST_PUBLISH_VIDEO_INIT, request)