I successfully uploaded a video to YouTube using YouTube Data API v3. No third party libraries were used. Now I want to update the title and description of an uploaded video, but this seems impossible!
This should be a no-brainer, but YouTube refuses to accept this simple query:
curl --insecure -v -i -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer ACCESS_TOKEN_FROM_GOOGLE_HERE" -d '{"id":"YOUTUBE_VIDEO_ID_HERE","snippet":{"title":"My title","description":"My description","categoryId":"22"}}' "https://www.googleapis.com/youtube/v3/videos?part=snippet"
Even though I'm dead sure that the video does exist YouTube server responds with this:
{
"error": {
"errors": [
{
"domain": "youtube.video",
"reason": "videoNotFound",
"message": "The video that you are trying to update cannot be found. Check t
he value of the \u003ccode\u003eid\u003c/code\u003e field in the request body to
ensure that it is correct.",
"locationType": "other",
"location": "body.id"
}
],
"code": 404,
"message": "The video that you are trying to update cannot be found. Check the
value of the \u003ccode\u003eid\u003c/code\u003e field in the request body to e
nsure that it is correct."
}
}
Can somebody please show me the low-level commands (cannot use third party library) to successfully update the title and description of an uploaded video? Preferably using curl.
I am able to delete the file using the delete API. Hence, the ID is indeed correct.
It looks like you might be missing the "kind" value.
curl --insecure -v -i -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer ACCESS_TOKEN_FROM_GOOGLE_HERE" -d '{"id":"YOUTUBE_VIDEO_ID_HERE","kind":"youtube#video","snippet":{"title":"My title","description":"My description","categoryId":"22"}}' "https://www.googleapis.com/youtube/v3/videos?part=snippet"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With