Question

I have an ID of a Youtube video and like to add a Thumbnail with the google-api-client (Ruby). My request looks like this

result = client.execute(:api_method => youtube.thumbnails.set, :parameters => { :videoId => my_video_id, :media_body => file })

What result.data returns is this

<Google::APIClient::Schema::Youtube::V3::ThumbnailSetResponse:0x86435518 DATA:{"error"=>{"code"=>500, "message"=>nil}}>

I can't figure out, what the problem is here. I tried to use a path to a file on my local machine as well as a URL. Even an empty String as the file location or leaving out the media_body leads to the 500 error.

Does anyone of you know, what's going on here and why I don't get a clear error response?

Edit: It seems to be not the fault of the google-api-client, because testing the same request in the Google APIs Explorer produces the same result:

Response

500 Internal Server Error

cache-control:  private, max-age=0
content-encoding:  gzip
content-length:  66
content-type:  application/json; charset=UTF-8
date:  Wed, 19 Feb 2014 14:24:23 GMT
expires:  Wed, 19 Feb 2014 14:24:23 GMT
server:  GSE

{
 "error": {
  "code": 500,
  "message": null
 }
}
Was it helpful?

Solution

Not all channels are enabled for custom thumbnails; I suspect that if you're getting an error, it might be because you're attempting to set a custom thumbnail for a video in a channel that isn't enabled. There's more info at https://support.google.com/youtube/answer/72431?hl=en

Could you follow the steps in that help article and see whether you have an option in the web UI to set a custom thumbnail? If you don't, then your channel isn't enabled.

Getting back a HTTP 500 response is obviously unhelpful, though, and makes it difficult to confirm that that's what's going on. We can follow up with the engineering team about that to get a helpful error returned once we confirm whether your channel is enabled or not.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top