本文介绍了用于自动生成频道的 gdata youtube 提要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以为自动生成的 YouTube 频道(又名主题")获取 gdata 供稿.

I'm trying to figure out if it's possible to get a gdata feed for an auto-generated youtube channel, aka a "Topic."

例如,这里是 JPop 频道:

For example, here's the JPop Channel:

http://www.youtube.com/channel/HC9BkB0bbvR-4

如果这是一个用户,我知道我可以得到一个像:http://gdata.youtube.com/feeds/base/users/{username}/uploads.但由于它不是用户,所以不起作用.

Were this a user, I know I could get a feed like: http:// gdata.youtube.com/feeds/base/users/{username}/uploads. But since it's not a user, that doesn't work.

我知道我可以进行如下搜索:http://gdata.youtube.com/feeds/api/videos?v=2&q=jpop,但这并不完全相同.

I know I could do a search like: http:// gdata.youtube.com/feeds/api/videos?v=2&q=jpop, but that's not exactly the same thing.

这个问题之前在 旧的 Youtube 开发者论坛,但当时不可用.

This question was asked before on the old Youtube Developer Forum, but at the time it wasn't available.

我查看了所有 API 文档以查看是否已更改,但找不到任何参考.

I've looked all through the API docs to see if that's changed, but can't find any reference to it.

我希望这里有人知道它是否已更改,文档是否尚未更新,或者该功能是否有预期的预计到达时间?

I was hoping someone here might know if it's changed, and the docs haven't been updated, or if there's an expected ETA for that feature?

推荐答案

您可以像订阅任何其他频道一样订阅自动生成的主题频道(以 HC 开头的频道)进行交互.

You can interact with auto-generated topic channels (those that begin with HC) by subscribing to them like any other channel.

如果您只想获取与频道关联的视频列表,则需要使用即将发布的 API v3,并且可以根据基础主题进行搜索.您可以使用 channels.list(id=CHANNEL_ID) 获取与给定频道相关的主题 ID:

If you just want to get a list of videos associated with the channel, though, you need to use the forthcoming v3 of the API, and you can do a search based on the underlying topic. You can get the topic id(s) related to a given channel using channels.list(id=CHANNEL_ID):

https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.list?part=topicDetails&id=HC9BkB0bbvR-4

(v3 目前尚未公开发布,因此您需要使用 Google APIs Explorer.)

(v3 isn't publicly released as of right now, so you need to use the Google APIs Explorer.)

返回 (Freebase) 主题 ID /m/025g__,然后您可以使用它来执行 search.list(topicId=TOPIC_ID, q=BLAH, type=video)

That returns (Freebase) topic id /m/025g__, which you can then use to do a search.list(topicId=TOPIC_ID, q=BLAH, type=video)

https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?part=snippet&type=video&q=j+pop&topicId=%252Fm%252F025g__

不幸的是,您现在无法在 v3 中执行仅指定 topicId= 而没有 q= 的搜索,但这是一个有望修复的错误很快.所以你暂时需要为 q= 参数指定一些有意义的东西,我只是使用 j pop.

Unfortunately, you can't do a search that just specifies a topicId= without a q= right now in v3, but that's a bug that will hopefully be fixed soon. So you do need to specify something meaningful for the q= parameter for the time being, and I'm just using j pop.

这篇关于用于自动生成频道的 gdata youtube 提要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 07:40