YOUTUBE API : Retrieve video keywords

耗尽温柔 提交于 2019-12-10 20:54:44

问题


Recently youtube decided to output video keywords only to authenticated developper.

I register a developper key

and I'm try to get a XML that I'll parse by requesting

https://gdata.youtube.com/feeds/api/videos/COwIYbYQUrQ?key=MY_VERY_LONG_DEVELOPER_KEY

The output XML still send me

<media:keywords/>

What am I missing in the process?

Thanks


回答1:


YouTube makes the <media:keywords /> element empty unless you "authenticate" that you are the owner of the video. You can still see all of YOUR video's keywords if you provide your username and password in the YouTubeRequestSettings constructor.

In .NET:

YouTubeRequestSettings settings = new YouTubeRequestSettings(appname, developerskey, username, password);

For PHP: https://developers.google.com/youtube/2.0/developers_guide_php#ClientLogin_for_Installed_Applications




回答2:


Haven't really touched the Youtube API, but

<media:keywords/> 

is an empty element. It means that there is no data for the element "media:keywords". My guess is that the the uploader hasn't specified any keywords for the video in question (these keywords are optional to all uploaders, which means that your script will have to deal with such occurrences).

After having a look at the video in question (ID: COwIYbYQUrQ), I can see that my suspicions seem to be correct because the uploader hasn't actually specified any keywords.



来源:https://stackoverflow.com/questions/12784410/youtube-api-retrieve-video-keywords

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!