I am trying to upload videos using the YouTube API. This code worked 7-8 months ago and I haven't made changes to it. I haven't uploaded any videos (or even done any other YouTube operations that would have used my rate limit) today or even this month, yet I get the following error:
googleapi: Error 403: The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>., quotaExceeded *googleapi.Error
My OAuth2 client has the following permission: Manage your YouTube videos
My code:
func (y *Youtube) Upload(vid Video) (resp *youtube.Video, err error) {
upload := &youtube.Video{
Snippet: &youtube.VideoSnippet{
Title: vid.Title,
Description: vid.Description,
CategoryId: vid.Category,
Tags: "my-tag",
},
Status: &youtube.VideoStatus{PrivacyStatus: "public"},
}
call := y.Service.Videos.Insert([]string{"snippet,status"}, upload)
var file *os.File
file, err = os.Open(vid.ABS)
if err != nil {
return
}
defer file.Close()
resp, err = call.Media(file).Do()
if err != nil {
return
}
return resp, err
}