Skip to content

Commit

Permalink
added url.QueryEscape
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan-Nava authored Sep 19, 2024
1 parent 68a1ba5 commit 1170b9d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tiktok/content.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package tiktok

import (

"net/url"
"encoding/json"
"fmt"
)
Expand Down Expand Up @@ -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,
Expand All @@ -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)
Expand Down

0 comments on commit 1170b9d

Please sign in to comment.