我正在使用YouTube EDU类别文件,http://gdata.youtube.com/schemas/2007/educategories.cat如YouTube API开发者指南中所述。
文件中的类别编号似乎与实际类别不对应。例如,该文件包含:
<atom:category term='326' label='Italian' xml:lang='en-US'>
<yt:parentCategory term='49'/>
</atom:category>
指示类别326应当是"意大利语"。但是,如果我尝试使用以下方法检索该类别的课程:http://gdata.youtube.com/feeds/api/edu/courses?v=2&category=326然后我上了计算机科学的课程。以下是回复摘录:
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:media='http://search.yahoo.com/mrss/' xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:yt='http://gdata.youtube.com/schemas/2007' gd:etag='W/"C0cMR3YzfSp7I2A9WhJaF08."'>
<id>tag:youtube.com,2008:edu:course</id>
<updated>2012-10-08T18:31:26.885Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#course'/>
<title>Courses for category 326</title>
<logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo>
<link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/edu/courses'/>
<link rel='http://schemas.google.com/g/2005#batch' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/edu/courses/batch'/>
<link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/edu/courses?start-index=1&max-results=25&category=326'/>
<link rel='service' type='application/atomsvc+xml' href='http://gdata.youtube.com/feeds/api/edu/courses?alt=atom-service'/>
<author>
<name>YouTube</name>
<uri>http://www.youtube.com/</uri>
</author>
<generator version='2.1' uri='http://gdata.youtube.com'>YouTube data API</generator>
<openSearch:totalResults>12</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<openSearch:itemsPerPage>25</openSearch:itemsPerPage>
<entry>
<id>tag:youtube.com,2008:edu:course:0DB77CB540B41DFF</id>
<updated>2012-10-08T18:31:26.885Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#course'/>
<category scheme='http://gdata.youtube.com/schemas/2007/educategories.cat' term='326'/>
<title>CS606 Compiler Construction</title>
<summary>Compiler Construction</summary>
<link rel='lectures' href='http://gdata.youtube.com/feeds/api/edu/lectures?course=0DB77CB540B41DFF'/>
<link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/edu/courses/0DB77CB540B41DFF'/>
<media:group>
<media:thumbnail url='http://i.ytimg.com/vi/nVsUbG65TWY/default.jpg' height='90' width='120' yt:name='default'/>
<media:thumbnail url='http://i.ytimg.com/vi/nVsUbG65TWY/hqdefault.jpg' height='360' width='480' yt:name='hqdefault'/>
</media:group>
<yt:playlistId>0DB77CB540B41DFF</yt:playlistId>
</entry>
为什么我看不到我指定类别的正确课程?
这看起来像是YouTube缓存问题。如果我足够刷新,我会看到它在意大利语和计算机科学之间切换。你介意在这里归档一个bug吗。https://code.google.com/p/gdata-issues/issues/entry?template=YouTube%20(缺陷%20报告)
我还将向我的联系人报告此问题。