问题
I'd like to get a Response referring to a single Video on Youtube. Let's say that I know its ID and like to see if it is still on Youtube. How does the request have to look like?
I am using the google-api-client with client_id and client_secret and like to do something like this:
client.execute( :api_method => youtube.search.list, :parameters => {:id => my_video_id, :part => 'id,snippet' })
It just returns me a Set of default Video Data. It is unlikely, that this is a matter of authentication, because uploading and deleting videos works fine. But for this purpose I can't find the right way. What am I doing wrong?
回答1:
You should do a videos->list call with the videoId instead.
client.execute( :api_method => youtube.videos.list, :parameters => {:id => my_video_id, :part => 'id,snippet' })
来源:https://stackoverflow.com/questions/21857970/how-do-i-retrieve-a-video-by-id-with-youtube-api-v3