1

GData API 今天显示的行为与昨天不同。

我在我的 iOS 应用程序中获取几个播放列表,如下所示:

[[self youTubeService] fetchFeedWithURL:[[playlistLink content] sourceURL]
                                          delegate:self
                                          didFinishSelector:@selector(playlistTicket:finishedWithFeed:error:)];

在我的回调中

- (void)playlistTicket:(GDataServiceTicket *)ticket finishedWithFeed:(GDataFeedYouTubePlaylist *)feed error:(NSError *)error {

    if(!error){
        _receivedPlaylistFeeds += 1;

        NSMutableDictionary* sectionDict =  [[NSMutableDictionary alloc] init];
        NSMutableArray* sectionEntries = [[NSMutableArray alloc] init];

        for(GDataEntryYouTubeVideo* entry in feed.entries){

            GDataYouTubeMediaGroup* mediaGroup = [entry mediaGroup];
            GDataMediaKeywords* mediaKeywords = [mediaGroup mediaKeywords];
            NSArray* keyword = [mediaKeywords keywords];
        }
  }}          

关键字为零。昨天不是。我依赖这些关键字,不知道可能是什么问题。我在浏览器中检查了 [[playlistLink content] sourceURL],它加载了包含关键字的 xml。所以我不知道是什么导致了行为的改变。对我来说,它至关重要。该应用程序已在 AppStore 中发布...

4

2 回答 2

2

如果用户不是视频的所有者,则 media:keywords 将返回空。

http://apiblog.youtube.com/2012/08/video-tags-just-for-uploaders.html

编辑:请参阅下面关于我如何解决它的评论

于 2012-09-05T13:27:52.803 回答
1

我也依赖关键字......我的网页崩溃了两天,我不知道。

您仍然可以访问视频的关键字。当您设置 YouTube 请求设置时...您需要提供用户名和密码以验证您是所有者。

https://developers.google.com/youtube/2.0/developers_guide_protocol#Authentication

或者

https://developers.google.com/youtube/code,然后导航到代码的身份验证部分。

我的页面现在可以正常工作,因为我包含了两个附加参数。

于 2012-09-06T19:47:49.487 回答