Skip to content

Commit a3602df

Browse files
committed
sleep for 1sec after uploading
1 parent 55cea4c commit a3602df

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

youtubeuploader.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"net/http"
99
"os"
1010
"strings"
11+
"time"
1112

1213
"golang.org/x/oauth2"
1314
"google.golang.org/api/youtube/v3"
@@ -106,11 +107,13 @@ func main() {
106107
logf("Uploading file '%s'...\n", f.Video)
107108
video := uploadVideo(service, videoFile, upload, parseInt(f.UploadChunk, 0), quitChan)
108109
logf("Upload successful! Video ID: %v\n", video.Id)
110+
time.Sleep(time.Second)
109111
id = video.Id
110112
} else if id != "" {
111113
logf("Updating video %v...\n", id)
112114
updateVideo(service, id, upload)
113115
logf("Update successful!\n")
116+
time.Sleep(time.Second)
114117
}
115118
// upload thumbnail
116119
if id != "" && thumbnailFile != nil {

0 commit comments

Comments
 (0)